Add a server from the marketplace to your stack
POST https://api.toolrouter.ai/v1/stacks/{stack_id}/servers
Authorization: Bearer YOUR_API_KEY
enable_all_tools
Show Tool Selection
true
false
enabled_tools
curl -X POST "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/servers" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "server_id": "gmail", "enable_all_tools": true }'
curl -X POST "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/servers" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "server_id": "gmail", "enable_all_tools": false, "enabled_tools": ["gmail_send_email", "gmail_search_emails"] }'
curl -X POST "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/servers" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "server_id": "gmail", "enable_all_tools": false }'
{ "message": "Server gmail added to stack stack_123e4567-e89b-12d3-a456-426614174000 with 5 tools enabled" }
{ "message": "Server gmail added to stack stack_123e4567-e89b-12d3-a456-426614174000 with 2 tools enabled" }
{ "message": "Server gmail added to stack stack_123e4567-e89b-12d3-a456-426614174000 with 0 tools enabled" }
{ "detail": "Server gmail already exists in stack" }
{ "detail": "Unauthorized" }
{ "detail": "Stack not found" }
{ "detail": "Server gmail not found" }
{ "detail": "Too many requests" }
{ "detail": "Failed to add server to stack" }