Overview
Returns a list of all enabled tools from a specific stack. This endpoint supports multiple schema formats to match different AI framework requirements, including OpenAI and Anthropic formats.Endpoint
GET https://api.toolrouter.ai/v1/stacks/{stack_id}/tools
Authentication
This endpoint requires an API key. Include it in the Authorization header:Authorization: Bearer YOUR_API_KEY
Path Parameters
string
required
The unique identifier of the stack to get tools from
Query Parameters
string
default:"default"
The schema format for the returned tools
Show Available Schema Formats
Show Available Schema Formats
default: Standard ToolRouter formatopenai: OpenAI-compatible format for use with OpenAI’s APIanthropic: Anthropic-compatible format for use with Claude API
Response
array
Array of tool objects formatted according to the specified schema
Show Default Schema Tool Object
Show Default Schema Tool Object
Show OpenAI Schema Tool Object
Show OpenAI Schema Tool Object
Example Request
Default Format
curl -X GET "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(
"https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools",
headers=headers
)
tools = response.json()
const response = await fetch('https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const tools = await response.json();
OpenAI Format
curl -X GET "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools?schema=openai" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
params = {
"schema": "openai"
}
response = requests.get(
"https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools",
headers=headers,
params=params
)
openai_tools = response.json()
Anthropic Format
curl -X GET "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools?schema=anthropic" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
params = {
"schema": "anthropic"
}
response = requests.get(
"https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/tools",
headers=headers,
params=params
)
anthropic_tools = response.json()
Example Responses
Default Format
{
"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"
}
]
}
OpenAI Format
{
"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"]
}
}
}
]
}
Anthropic Format
{
"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"]
}
}
]
}
Integration Examples
Using with OpenAI
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
)
Using with Anthropic
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"}]
)
Use Cases
- AI Integration: Get tools in the format needed for your AI framework
- Dynamic Tool Discovery: Programmatically discover available tools in a stack
- Application Setup: Configure your application with the tools available in a stack
- Documentation Generation: Generate tool documentation for your applications
Error Responses
Invalid or missing API key
{
"detail": "Unauthorized"
}
Stack not found
{
"detail": "Stack not found"
}
Rate limit exceeded
{
"detail": "Too many requests"
}
Server error occurred
{
"detail": "Failed to get tools"
}

