Tools API
Manage agent tools.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/agents/{id}/tools | List tools |
| POST | /api/agents/{id}/tools | Create tool |
| GET | /api/agents/{id}/tools/{toolId} | Get tool |
| PUT | /api/agents/{id}/tools/{toolId} | Update tool |
| DELETE | /api/agents/{id}/tools/{toolId} | Delete tool |
List Tools
bash
GET /api/agents/{id}/toolsResponse
json
{
"tools": [
{
"id": "tool-123",
"name": "search_database",
"description": "Search the knowledge base",
"type": "function",
"created_at": "2024-12-01T00:00:00Z"
}
]
}Create Tool
bash
POST /api/agents/{id}/tools
Content-Type: application/jsonRequest Body
json
{
"name": "search_database",
"description": "Search the knowledge base for information",
"type": "function",
"config": {
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search query"
}
},
"required": ["query"]
}
}
}Update Tool
bash
PUT /api/agents/{id}/tools/{toolId}Delete Tool
bash
DELETE /api/agents/{id}/tools/{toolId}Tool Types
| Type | Description |
|---|---|
api | External API call |
function | Custom function |
mcp | MCP server tool |