Tool calling

Let the model call functions in your code to fetch data before it answers.

We recommend installing the Respan MCP so your AI coding tool can work with your prompts, logs, and traces directly. Authenticate with your Respan API key from the API keys page:

$claude mcp add \
> --transport http \
> --header "Authorization: Bearer YOUR_RESPAN_API_KEY" \
> respan \
> https://mcp.respan.ai/mcp

See the MCP docs for OAuth setup and other clients.

New to prompts? Start with the Quickstart.
For schema, deployment, streaming, and logging, see Advanced features.

Configure tools on your prompt, and the model can call them to fetch data before it answers. Respan returns the tool call; your code runs the matching function and sends the result back. The functions live in your code, so they can be anything: a database query, an internal API, or hardcoded values.

In the prompt editor, open the Tools tab and add a tool with a JSON schema describing its name, description, and parameters.

The prompt editor Tools tab with a check_stock tool defined by a JSON schema: a name, description, and a required sku string parameter.
1{
2 "name": "check_stock",
3 "description": "Look up how many units of a product are in stock.",
4 "parameters": {
5 "type": "object",
6 "required": ["sku"],
7 "properties": {
8 "sku": { "type": "string", "description": "Product SKU, e.g. SKU-1001" }
9 }
10 }
11}

With the tool configured, the model decides when to call it. Commit and deploy the prompt to make the change live.

The playground shows the model deciding to call the tool, but it can’t run the function for you.