curl -X POST "https://api.danubeai.com/v1/tools/call/batch" \
-H "danube-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"calls": [
{
"tool_id": "tool_weather_001",
"tool_input": {"city": "San Francisco"}
},
{
"tool_id": "tool_weather_001",
"tool_input": {"city": "New York"}
}
]
}'
from danube import DanubeClient
with DanubeClient(api_key="dk_...") as client:
results = client.tools.batch_execute([
{"tool_id": "tool_weather_001", "parameters": {"city": "San Francisco"}},
{"tool_id": "tool_weather_001", "parameters": {"city": "New York"}},
])
for r in results:
print(f"{r.tool_id}: {'ok' if r.success else r.error}")
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'dk_...' });
const results = await client.tools.batchExecute([
{ toolId: 'tool_weather_001', toolInput: { city: 'San Francisco' } },
{ toolId: 'tool_weather_001', toolInput: { city: 'New York' } },
]);
for (const r of results) {
console.log(`${r.toolId}: ${r.success ? 'ok' : r.error}`);
}
{
"results": [
{
"tool_id": "tool_weather_001",
"success": true,
"result": {
"temperature": "18C",
"condition": "Partly cloudy"
},
"error": null
},
{
"tool_id": "tool_weather_001",
"success": true,
"result": {
"temperature": "5C",
"condition": "Clear"
},
"error": null
}
]
}
Tools
Batch Call Tools
Execute multiple tools in a single request
POST
/
v1
/
tools
/
call
/
batch
curl -X POST "https://api.danubeai.com/v1/tools/call/batch" \
-H "danube-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"calls": [
{
"tool_id": "tool_weather_001",
"tool_input": {"city": "San Francisco"}
},
{
"tool_id": "tool_weather_001",
"tool_input": {"city": "New York"}
}
]
}'
from danube import DanubeClient
with DanubeClient(api_key="dk_...") as client:
results = client.tools.batch_execute([
{"tool_id": "tool_weather_001", "parameters": {"city": "San Francisco"}},
{"tool_id": "tool_weather_001", "parameters": {"city": "New York"}},
])
for r in results:
print(f"{r.tool_id}: {'ok' if r.success else r.error}")
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'dk_...' });
const results = await client.tools.batchExecute([
{ toolId: 'tool_weather_001', toolInput: { city: 'San Francisco' } },
{ toolId: 'tool_weather_001', toolInput: { city: 'New York' } },
]);
for (const r of results) {
console.log(`${r.toolId}: ${r.success ? 'ok' : r.error}`);
}
{
"results": [
{
"tool_id": "tool_weather_001",
"success": true,
"result": {
"temperature": "18C",
"condition": "Partly cloudy"
},
"error": null
},
{
"tool_id": "tool_weather_001",
"success": true,
"result": {
"temperature": "5C",
"condition": "Clear"
},
"error": null
}
]
}
Overview
Execute up to 10 tool calls in a single request. Each call is executed independently — a failure in one does not affect others. Results are returned in the same order as the input calls. Auth: Requires API key (danube-api-key header). API key permissions are checked per tool.
Body Parameters
Response
Example
curl -X POST "https://api.danubeai.com/v1/tools/call/batch" \
-H "danube-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"calls": [
{
"tool_id": "tool_weather_001",
"tool_input": {"city": "San Francisco"}
},
{
"tool_id": "tool_weather_001",
"tool_input": {"city": "New York"}
}
]
}'
from danube import DanubeClient
with DanubeClient(api_key="dk_...") as client:
results = client.tools.batch_execute([
{"tool_id": "tool_weather_001", "parameters": {"city": "San Francisco"}},
{"tool_id": "tool_weather_001", "parameters": {"city": "New York"}},
])
for r in results:
print(f"{r.tool_id}: {'ok' if r.success else r.error}")
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'dk_...' });
const results = await client.tools.batchExecute([
{ toolId: 'tool_weather_001', toolInput: { city: 'San Francisco' } },
{ toolId: 'tool_weather_001', toolInput: { city: 'New York' } },
]);
for (const r of results) {
console.log(`${r.toolId}: ${r.success ? 'ok' : r.error}`);
}
{
"results": [
{
"tool_id": "tool_weather_001",
"success": true,
"result": {
"temperature": "18C",
"condition": "Partly cloudy"
},
"error": null
},
{
"tool_id": "tool_weather_001",
"success": true,
"result": {
"temperature": "5C",
"condition": "Clear"
},
"error": null
}
]
}
MCP Tool
This endpoint is also available as thebatch_execute_tools MCP tool:
result = await mcp.call_tool("batch_execute_tools", {
"calls": [
{"tool_id": "tool_weather_001", "tool_input": {"city": "San Francisco"}},
{"tool_id": "tool_weather_001", "tool_input": {"city": "New York"}}
]
})
⌘I
