Tool Execution & Jobs API
Execute discovered tools and manage long-running tasks.Overview
Two execution modes:- Direct Execution (
/execute_tool) - Synchronous, immediate results - Job Queue (
/jobs/*) - Asynchronous, background execution
| Mode | Best For | Response Time |
|---|---|---|
| Direct | Quick operations | < 5 seconds |
| Job Queue | Long tasks | Hours/days |
POST /execute_tool
Execute a tool directly (admin only)Authentication
Required (Admin key)Request Body
| Field | Type | Required | Description |
|---|---|---|---|
tool | string | Yes | Tool name |
arguments | object | Yes | Tool parameters |
mode | string | No | Execution mode |
Request Examples
Simple Execution:Response Format
Success (200):Error Codes
| Code | HTTP | Meaning |
|---|---|---|
TOOL_NOT_FOUND | 404 | Tool doesn’t exist |
INVALID_ARGUMENTS | 400 | Missing/invalid params |
EXECUTION_ERROR | 500 | Tool execution failed |
EXECUTION_TIMEOUT | 504 | Tool took too long |
RATE_LIMIT_EXCEEDED | 429 | Too many executions |
POST /jobs/submit
Submit async job for executionAuthentication
RequiredRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
tool | string | Yes | Tool name |
arguments | object | Yes | Tool parameters |
Request Example
Response Format
GET /jobs/
Poll job status and retrieve resultsAuthentication
RequiredPath Parameters
| Parameter | Type | Required |
|---|---|---|
job_id | string | Yes |
Request Example
Response Format (Queued)
Response Format (Running)
Response Format (Completed)
Response Format (Failed)
Job Status Values
| Status | Meaning |
|---|---|
queued | Waiting for execution |
running | Currently executing |
completed | Finished successfully |
failed | Execution error |
canceled | User canceled |
timeout | Exceeded time limit |
DELETE /jobs/
Cancel a queued jobAuthentication
Required (Job owner only)Path Parameters
| Parameter | Type | Required |
|---|---|---|
job_id | string | Yes |
Request Example
Response Format
Error Cases
Can’t cancel running job (400):GET /jobs
List user’s recent jobsAuthentication
RequiredQuery Parameters
| Parameter | Type | Default | Max |
|---|---|---|---|
limit | integer | 20 | 100 |
offset | integer | 0 | - |
status | string | all | queued, running, completed, failed |
Request Examples
List Recent Jobs:Response Format
Polling Strategy
Exponential Backoff
Event Stream Polling
Webhook Notifications
For long-running jobs, register webhooks instead of polling:Register Webhook
Webhook Payload
Best Practices
1. Use Jobs for Long Operations
2. Handle All Job States
3. Store Job IDs
4. Implement Timeout Logic
Rate Limiting
Execution endpoints have rate limits:| Plan | Requests/min | Max Concurrent |
|---|---|---|
| Free | 10 | 1 |
| Pro | 100 | 5 |
| Enterprise | Custom | Custom |