Retrieve all enabled tools from a stack in various formats
GET https://api.toolrouter.ai/v1/stacks/{stack_id}/tools
Authorization: Bearer YOUR_API_KEY
Show Available Schema Formats
default
openai
anthropic
Show Default Schema Tool Object
Show OpenAI Schema Tool Object
Show Function Object
Show Anthropic Schema Tool Object
curl -X GET "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools" \ -H "Authorization: Bearer YOUR_API_KEY"
curl -X GET "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools?schema=openai" \ -H "Authorization: Bearer YOUR_API_KEY"
curl -X GET "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools?schema=anthropic" \ -H "Authorization: Bearer YOUR_API_KEY"
{ "tools": [ { "name": "gmail_send_email", "description": "Send an email through Gmail", "input_schema": { "type": "object", "properties": { "to": { "type": "array", "items": {"type": "string"}, "description": "List of recipient email addresses" }, "subject": { "type": "string", "description": "Email subject" }, "body": { "type": "string", "description": "Email body content" } }, "required": ["to", "subject", "body"] }, "server": "gmail" }, { "name": "linear_create_issue", "description": "Create a new issue in Linear", "input_schema": { "type": "object", "properties": { "title": { "type": "string", "description": "Issue title" }, "description": { "type": "string", "description": "Issue description" }, "teamId": { "type": "string", "description": "Team ID" } }, "required": ["title", "teamId"] }, "server": "linear" } ] }
{ "tools": [ { "type": "function", "function": { "name": "gmail_send_email", "description": "Send an email through Gmail", "parameters": { "type": "object", "properties": { "to": { "type": "array", "items": {"type": "string"}, "description": "List of recipient email addresses" }, "subject": { "type": "string", "description": "Email subject" }, "body": { "type": "string", "description": "Email body content" } }, "required": ["to", "subject", "body"] } } }, { "type": "function", "function": { "name": "linear_create_issue", "description": "Create a new issue in Linear", "parameters": { "type": "object", "properties": { "title": { "type": "string", "description": "Issue title" }, "description": { "type": "string", "description": "Issue description" }, "teamId": { "type": "string", "description": "Team ID" } }, "required": ["title", "teamId"] } } } ] }
{ "tools": [ { "name": "gmail_send_email", "description": "Send an email through Gmail", "input_schema": { "type": "object", "properties": { "to": { "type": "array", "items": {"type": "string"}, "description": "List of recipient email addresses" }, "subject": { "type": "string", "description": "Email subject" }, "body": { "type": "string", "description": "Email body content" } }, "required": ["to", "subject", "body"] } }, { "name": "linear_create_issue", "description": "Create a new issue in Linear", "input_schema": { "type": "object", "properties": { "title": { "type": "string", "description": "Issue title" }, "description": { "type": "string", "description": "Issue description" }, "teamId": { "type": "string", "description": "Team ID" } }, "required": ["title", "teamId"] } } ] }
import openai import requests # Get tools in OpenAI format headers = {"Authorization": "Bearer YOUR_API_KEY"} tools_response = requests.get( "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools?schema=openai", headers=headers ) tools = tools_response.json()["tools"] # Use with OpenAI chat completions response = openai.chat.completions.create( model="gpt-4", messages=[{"role": "user", "content": "Send an email to john@example.com"}], tools=tools )
import anthropic import requests # Get tools in Anthropic format headers = {"Authorization": "Bearer YOUR_API_KEY"} tools_response = requests.get( "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools?schema=anthropic", headers=headers ) tools = tools_response.json()["tools"] # Use with Anthropic API client = anthropic.Anthropic() response = client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=1024, tools=tools, messages=[{"role": "user", "content": "Send an email to john@example.com"}] )
{ "detail": "Unauthorized" }
{ "detail": "Stack not found" }
{ "detail": "Too many requests" }
{ "detail": "Failed to get tools" }