Skip to main content
Glama
fegone
by fegone

delegate_batch

Dispatch up to 4 independent sub-tasks in parallel using a single call, benefiting from KV cache prefix reuse for faster prompt processing.

Instructions

Despacha hasta N agentes EN PARALELO en una sola llamada, usando asyncio.gather. Útil cuando el orquestador quiere ejecutar N sub-tareas independientes simultáneamente en backends que soportan paralelismo nativo (e.g., llama.cpp con --parallel 4).

USE WHEN you have multiple independent sub-tasks and your backend has parallel slots available (delegate cap = 4 = heavy-coding throughput sweet-spot; oMLX allows 8). With same agent_name reused across tasks, you also benefit from KV cache prefix reuse on the shared system prompt (~30-50% prompt-processing savings).

LIMITATION: Sub-agents launched via Claude Code's Agent/Task tool do NOT inherit parent's MCP servers, so this tool cannot be called from within a sub-agent. It only works from the main orchestrator session. Sub-agents that need parallelism should use httpx.AsyncClient + asyncio.gather directly against your LiteLLM endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tasksYesList of task dicts. Each dict has the same keys as delegate_to_local_agent's parameters: {agent_name, task, workdir?, max_turns?, model?, max_tokens?}. agent_name and task are required; rest use defaults. Hard cap MAX_BATCH_SIZE (4) tasks per call. For more, split into multiple calls or use sequential delegate_to_local_agent calls.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses parallelism, batch size cap, KV cache benefits, and the sub-agent limitation. However, lacks details on error handling or behavior on partial failures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded main purpose, but some sections (limitation, alternatives) are lengthy. Still efficient overall.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, usage, parameters, and limitations well. With output schema present, return format is not needed. Minor gaps like error behavior do not detract significantly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only parameter 'tasks' is described beyond schema: explains it is a list of dicts with keys matching delegate_to_local_agent and a hard cap, adding value over the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it dispatches up to N agents in parallel using asyncio.gather, contrasting with the sibling delegate_to_local_agent which handles single agents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use (multiple independent sub-tasks with parallel slots) and when not to use (cannot be called from sub-agent), with clear alternative suggestions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fegone/claude-code-delegate-local'

If you have feedback or need assistance with the MCP directory API, please join our Discord server