Meta-tool Pattern
How Galadri achieves fast, parallel tool execution through a single batched interface.
The Problem
Standard AI tool calling works sequentially: the model calls one tool, waits for the result, then calls the next. If an agent needs to search Google Maps, check recalls, and look up gas prices, that is three round-trips to the model, each adding latency and token cost.
The Solution
Galadri gives the model a single tool called execute_actions whose schema describes ALL available tools. The model constructs one JSON payload with multiple actions:
{
"actions": [
{ "tool": "google-maps-search", "args": { "query": "oil change near Phoenix, AZ" } },
{ "tool": "nhtsa-recall-search", "args": { "year": 2020, "make": "Toyota", "model": "Camry" } },
{ "tool": "web-search", "args": { "query": "2020 Toyota Camry common issues" } }
]
}All three actions execute in parallel. Results return in one batch. This reduces a 3-round-trip interaction to a single round-trip, dramatically improving latency and cost.
Sequential Dependencies
When actions depend on each other (e.g., search for shops, then book the best one), the model calls the meta-tool multiple times. This is expected. The model recognizes sequential dependencies and chains tool rounds appropriately. Up to 5 tool rounds are allowed per request.
Execution Modes
Each tool has an execution mode:
- Sync — The result is returned to the model before it generates a response. Used for lookups, searches, data queries.
- Fire-and-forget — The model receives
"status": "initiated"immediately. The tool continues executing in the background. Used for emails, image generation, and other write operations.
Mixed batches
A single batch can contain both sync and fire-and-forget tools. The response returns as soon as all sync tools complete. Fire-and-forget tools do not slow down the response.
Error Handling
Every action in a batch gets an explicit result with a status. Failed actions are never omitted from the response, because omission would cause the model to hallucinate the outcome.
{
"results": [
{ "tool": "google-maps-search", "status": "success", "data": { "places": [...] } },
{ "tool": "nhtsa-recall-search", "status": "error", "error": "API rate limit exceeded" },
{ "tool": "web-search", "status": "success", "data": { "results": [...] } }
]
}The model is instructed to communicate failures to the user rather than guessing or ignoring them. See the Tools reference for per-tool details.