race
Run multiple tasks in parallel and return the first successful result, canceling the rest. Used for speculative execution or testing multiple strategies.
Instructions
Run multiple approaches in parallel, return the first to succeed.
All tasks start simultaneously. As soon as one completes without error, its ref is returned. Remaining tasks are abandoned (their containers are killed). Use for speculative execution or when multiple strategies might work.
Args: tasks: JSON array of task objects (same format as par). max_concurrency: Max agents running simultaneously (default: 5).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tasks": "<tasks>"
},
"name": "race"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasks | Yes | ||
| max_concurrency | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |