Documentation Index
Fetch the complete documentation index at: https://docs.runtools.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Connected Apps let users connect providers such as GitHub, Google, Slack, Microsoft, Discord, LinkedIn, and X. Tool Hub execution can then resolve provider credentials server-side without the caller passing raw OAuth tokens.
Raw OAuth token retrieval is not a public SDK method. Use connection management helpers and hosted tool execution instead of building your own token plumbing.
Connect With The CLI
runtools login
runtools oauth connect github
runtools oauth status
runtools oauth set-default github
runtools oauth disconnect github
Use custom scopes when needed:
runtools oauth connect google \
--scopes "https://www.googleapis.com/auth/gmail.modify"
Connect With The SDK
const { authUrl } = await rt.auth.connect('github', {
scopes: ['repo', 'read:user'],
});
// Redirect the user to authUrl.
const connected = await rt.auth.isConnected('github');
const connections = await rt.auth.listConnections();
if (connections[0]) {
await rt.auth.setDefault(connections[0].id);
}
When you run a Tool Hub action, RunTools resolves credentials in this order:
- Per-request
credentials
credentialOverrides that point at stored secrets
- Stored credentials for the installed tool
- Matching user or org secrets
- Connected OAuth account for the tool’s provider
const result = await rt.tools.execute('github', {
action: 'list_repos',
params: { owner: 'runtools-ai' },
});
BYOA Provider Configs
Bring-your-own-app configs let an organization use its own OAuth client for a provider.
await rt.auth.setProviderConfig('github', {
clientId: process.env.GITHUB_CLIENT_ID!,
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
scopes: 'repo,read:user',
});
const configs = await rt.auth.listProviderConfigs();
await rt.auth.deleteProviderConfig('github');
curl -X POST https://auth.runtools.ai/v1/oauth/configs \
-H "X-API-Key: $RUNTOOLS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "github",
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"scopes": "repo,read:user"
}'
Custom tools declare OAuth needs in their credential spec. RunTools maps the connected provider token into the credential field before running the tool.
import { defineTool } from '@runtools/sdk';
export default defineTool({
name: 'my-google-tool',
description: 'Read Google Drive metadata',
credentials: {
required: ['accessToken'],
schema: {
accessToken: {
type: 'string',
description: 'Google OAuth access token',
},
},
oauth: {
provider: 'google',
scopes: ['https://www.googleapis.com/auth/drive.readonly'],
credentialMapping: { accessToken: 'access_token' },
},
},
actions: {
list_files: {
description: 'List Drive files',
parameters: {
type: 'object',
properties: {
query: { type: 'string' },
},
},
execute: async (params, credentials) => {
const response = await fetch('https://www.googleapis.com/drive/v3/files', {
headers: {
Authorization: `Bearer ${credentials.accessToken}`,
},
});
return response.json();
},
},
},
});
API Reference
| Method | Path | Description |
|---|
GET | /v1/oauth/providers | List providers |
GET | /v1/oauth/start/{provider} | Start an OAuth connection flow |
GET | /v1/oauth/connections | List connections |
DELETE | /v1/oauth/connections/{id} | Disconnect by connection ID |
POST | /v1/oauth/connections/{id}/set-default | Mark a connection as default |
GET | /v1/oauth/status/{provider} | Check provider connection status |
GET | /v1/oauth/configs | List BYOA provider configs |
POST | /v1/oauth/configs | Create or update a BYOA provider config |
DELETE | /v1/oauth/configs/{provider} | Delete a BYOA provider config |