This is the complete technical reference for Toolcog’s API meta-tools. These tools are exposed via the Model Context Protocol (MCP) and enable AI to discover, learn, and execute API operations.
| Tool | Purpose | Behavior |
|---|---|---|
find_api | Discover operations | Semantic search, read-only |
learn_api | Learn interfaces | TypeScript generation, read-only |
call_api | Execute operations | HTTP requests, may modify state |
All tools return the same response structure:
interface ToolResult { content: Array<{ type: "text"; text: string }>; isError?: boolean;}isError: false or undefined indicates successisError: true indicates an error occurredDiscovers API operations matching a natural language intent using semantic search.
| Parameter | Type | Required | Description |
|---|---|---|---|
intent | string | Yes | What you want to accomplish |
{ "type": "object", "properties": { "intent": { "type": "string", "description": "The behavior of the API operation you intend to perform" } }, "required": ["intent"]}The intent should describe behavior, not entities:
| Good Intent | Bad Intent |
|---|---|
| ”create a new customer with email and payment info" | "stripe customer" |
| "list all repositories for a user" | "github repos" |
| "send a transactional email with template" | "sendgrid email” |
Good intents:
Bad intents:
Returns a markdown-formatted list of matching operations:
Found 3 API operation(s):
- stripe/customers.create — create a new customer with email and payment details- stripe/customers.update — modify an existing customer's information- braintree/customers.create — create a customer in the payment vaultEach result includes:
serviceName/operationName — The operation identifierResults are ranked by semantic similarity. The top 10 matches are returned.
No API operations found matching your intent. Try rephrasing your search.{ content: [{ type: "text", text: "Missing intent parameter" }], isError: true}text-embedding-3-small for vector embeddingsRetrieves TypeScript type declarations for an operation’s request and response interfaces.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
operation | string | Yes | — | Operation identifier |
request | boolean | No | true | Include request types |
response | boolean | No | false | Include response types |
{ "type": "object", "properties": { "operation": { "type": "string", "description": "The API operation to learn about (format: serviceName/operationName)" }, "request": { "type": "boolean", "description": "Include request types", "default": true }, "response": { "type": "boolean", "description": "Include response types", "default": false } }, "required": ["operation"]}Operations must be specified as serviceName/operationName:
github/repos.createstripe/customers.createsendgrid/mail.sendInvalid formats return an error.
Returns TypeScript type declarations:
interface CreateCustomerRequest { email: string; name?: string; description?: string; metadata?: Record<string, string>; payment_method?: string; address?: Address;}
interface Address { line1: string; line2?: string; city: string; state?: string; postal_code: string; country: string;}The response includes:
$ref chains)Types are resolved to a depth of 2 indirections. Deep circular references are truncated with inline comments.
Invalid format:
Invalid operation format. Expected: serviceName/operationNameOperation not found:
Operation not found: stripe/invalid.operationNo types available:
No type information available for this operation.Executes an API operation with the provided arguments.
| Parameter | Type | Required | Description |
|---|---|---|---|
operation | string | Yes | Operation identifier |
arguments | object | Yes | Arguments by location |
interface Arguments { path?: Record<string, unknown>; // Path parameters query?: Record<string, unknown>; // Query string parameters header?: Record<string, unknown>; // Request headers body?: unknown; // Request body server?: Record<string, unknown>; // Server URL variables cookie?: Record<string, unknown>; // Cookie values}{ "type": "object", "properties": { "operation": { "type": "string", "description": "The API operation to call (format: serviceName/operationName)" }, "arguments": { "type": "object", "properties": { "path": { "type": "object", "description": "Path arguments" }, "query": { "type": "object", "description": "Query arguments" }, "header": { "type": "object", "description": "Header arguments" }, "body": { "description": "Body argument" } }, "required": [] } }, "required": ["operation", "arguments"]}{ "operation": "github/repos.create", "arguments": { "body": { "name": "my-new-repo", "description": "A repository created via Toolcog", "private": true } }}Returns the HTTP response:
{ "status": 201, "statusText": "Created", "body": { "id": 123456789, "name": "my-new-repo", "full_name": "user/my-new-repo", "private": true, "html_url": "https://github.com/user/my-new-repo" }}Response fields:
status — HTTP status code (e.g., 200, 201, 400, 500)statusText — HTTP status text (e.g., “OK”, “Created”, “Bad Request”)body — Decoded response body (JSON parsed if applicable)Missing operation:
Missing "operation" parameterMissing arguments:
Missing "arguments" parameterInvalid format:
Invalid operation format. Expected: serviceName/operationNameOperation not found:
Operation not found: stripe/invalid.operationAuthorization required:
When credentials are missing or insufficient, the response includes:
{ "status": 401, "statusText": "Unauthorized", "body": { "error": "authorization_required", "message": "This operation requires authorization", "connect_url": "https://toolcog.com/connect?owner={owner}&bridge={bridge}&scope=repo" }}The connect_url can be provided to the user to authorize the service.
Credentials are resolved automatically based on the operation’s security requirements:
| Credential Type | Satisfies Schemes |
|---|---|
| OAuth | oauth2, http:bearer |
| API Key | apiKey |
| HTTP Basic | http:basic |
| HTTP Bearer | http:bearer |
Credentials must match the scheme name declared in the operation’s security requirements.
User-Agent: env.USER_AGENT automaticallyAll tools follow consistent error patterns:
Missing or invalid parameters return immediately with isError: true:
{ content: [{ type: "text", text: "Error message describing the issue" }], isError: true}Operations must match serviceName/operationName:
/All tools require an active MCP session. Outside a valid session:
Session not foundUnexpected errors are caught and returned as:
{ content: [{ type: "text", text: error.message }], isError: true}2025-06-18
| Tool | readOnlyHint | destructiveHint | openWorldHint |
|---|---|---|---|
find_api | true | — | true |
learn_api | true | — | true |
call_api | — | true | true |
readOnlyHint: true — Tool doesn’t modify statedestructiveHint: true — Tool may modify stateopenWorldHint: true — Tool accesses external systemsJSON-RPC 2.0 over the configured transport (stdio, SSE, WebSocket).
Always use find_api before claiming an operation doesn’t exist:
1. find_api("create a payment intent")2. learn_api("stripe/payment_intents.create", request: true)3. call_api("stripe/payment_intents.create", arguments: {...})Use learn_api before complex operations:
When call_api returns authorization_required:
connect_url from the responsefind_api results for correct namelearn_api to learn the interfacefind_api workscall_api handles auth