Skip to content

delegate_to_agent

delegate_to_agent is a built-in tool that lets one agent delegate a task to another agent. This enables multi-agent workflows where a general-purpose assistant can route specialised questions to domain-specific agents and get results back.

When the LLM calls delegate_to_agent:

  1. The orchestrator activates the target agent.
  2. A nested agent turn runs with the provided message.
  3. The target agent’s result is returned directly to the calling agent.

The delegating agent always gets the result back and can continue its own turn with that information.

name: delegate_to_agent
parameters:
- name: agent_id
type: string
required: true
description: The identifier of the target agent to delegate to.
- name: message
type: string
required: true
description: Context message passed to the target agent explaining the task.

Not every installed agent appears as a delegation target. An agent is available for delegation when:

  • It is installed and visible to the user.
  • Its routing is set to routing: delegate, or it uses routing: auto and resolved to delegate.

Self-delegation is prevented — the currently running agent is filtered out of the available target list.

A personal assistant agent might delegate to specialists:

agent.md
## Delegation rules
- If the user asks about weather, delegate to `weather-agent`.
- If the user asks about calendar or scheduling, delegate to `calendar-agent`.
- For everything else, handle it yourself.
When delegating, use `delegate_to_agent` with a clear `message` explaining the user's request.
{
"tool": "delegate_to_agent",
"parameters": {
"agent_id": "weather-agent",
"message": "The user is asking about the weather forecast for Berlin this weekend. They prefer Celsius."
}
}

The message field is critical. It’s injected into the target agent’s context as a system-level handoff note. Write it as if you’re briefing a colleague:

  • Good: “The user wants to know the weather in Berlin this weekend. They prefer Celsius.”
  • Bad: “weather berlin”

A clear message helps the target agent respond accurately without asking the user to repeat themselves.