Skip to main content
Glama

delegate_task

Assign tasks to headless CLI agents with capability matching, isolated worktrees, and post-run checks for verified delegation.

Instructions

Delegate a task to a headless CLI agent or role.

The default agent='auto' selects an installed worker by capability. Pass required_capabilities when the orchestrator already knows what the task needs, and exclude_agents to keep the human-facing orchestrator out of the worker pool. Direct agent selection and static roles remain available as explicit overrides. If worktree is True, the agent runs in an isolated git worktree branching from cwd. checks are shell commands run after the agent finishes (for example a test command); read their outcome with job_review before spending anything on the job's output. memory_mode controls dispatch memory: auto (the default) infers an opaque Git checkout identity when no project is supplied, explicit requires memory_project, and off disables memory. An explicit project overrides inference. Raw prompts are never stored in memory. on_limit='handoff' is opt-in and requires worktree=True; only a configured, provider-specific quota signature can rotate to another available agent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
roleNo
agentNo
modelNo
writeNo
checksNo
effortNo
promptNo
on_limitNostop
worktreeNo
agent_nameNodefault_agent
backgroundNo
memory_modeNoauto
exclude_agentsNo
memory_projectNo
required_capabilitiesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv1.8.0
    • addedInput schema / properties / memory_mode
      Added value: +{
      +  "default": "auto",
      +  "title": "Memory Mode",
      +  "type": "string"
      +}
    • addedInput schema / properties / on_limit
      Added value: +{
      +  "default": "stop",
      +  "title": "On Limit",
      +  "type": "string"
      +}
  2. Changed13 schema fields changedv1.4.0
    • addedInput schema / properties / agent / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / agent / default
      Added value: +null
    • removedInput schema / properties / agent / type
      Removed value: -"string"
    • addedInput schema / properties / checks
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Checks"
      +}
    • addedInput schema / properties / cwd
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Cwd"
      +}
    • addedInput schema / properties / effort
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Effort"
      +}
    • addedInput schema / properties / exclude_agents
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Exclude Agents"
      +}
    • addedInput schema / properties / memory_project
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Memory Project"
      +}
    • addedInput schema / properties / prompt / default
      Added value: +""
    • addedInput schema / properties / required_capabilities
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Required Capabilities"
      +}
    • addedInput schema / properties / role
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Role"
      +}
    • addedInput schema / properties / worktree
      Added value: +{
      +  "default": false,
      +  "title": "Worktree",
      +  "type": "boolean"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "agent",
      -  "prompt"
      -]
  3. Addedv1.1.0

TDQS

A3.9/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full disclosure burden — and it does substantial work: it reveals git worktree isolation "branching from cwd," post-run checks semantics, memory persistence modes (auto infers an opaque Git checkout identity, explicit requires memory_project, off disables memory), and the privacy guarantee that "Raw prompts are never stored in memory." It also discloses the handoff constraint requiring "a configured, provider-specific quota signature" to rotate agents. Material behaviors remain undisclosed — notably what write=false vs true controls and how background dispatch behaves — so it is strong but not exhaustive.

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?

Tight prose blocks each cover a distinct concern — purpose, agent selection, worktree isolation, checks, memory, on_limit — with the core purpose front-loaded in the first sentence. The length (roughly 150 words) is justified by 16 parameters and zero schema descriptions, and there are no filler sentences. A bulleted layout would improve scannability, but nothing here is wasted.

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

Completeness3/5

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

The output schema relieves the return-value burden, and the description covers the most behaviorally complex parameters well. But for a 16-parameter tool with no annotations and 0% schema coverage, key semantics are still missing: the default on_limit='stop' behavior, what the write flag controls, background/async execution semantics, and effort/model/agent_name overrides. The description is adequate for an expert caller but incomplete for an agent that must reason correctly about all 16 fields.

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?

Schema description coverage is 0%, so the description must compensate, and it does for the least obvious parameters: agent selection with capability-based auto default, required_capabilities, exclude_agents, memory_mode with its auto/explicit/off semantics, memory_project overrides, worktree isolation, checks as post-run shell commands, and the on_limit handoff path. However, several parameters (background, write, effort, model, agent_name, prompt) receive no clarification, leaving gaps an agent must infer from parameter names alone.

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

Purpose4/5

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

The description opens with a specific verb+resource+target: "Delegate a task to a headless CLI agent or role." The 'headless' qualifier differentiates this execution-side dispatching from contextual siblings like route_task and the memory tools, though no sibling is named explicitly in the purpose statement. The rest of the description reinforces the purpose by explaining how automatic agent selection delegates to installed workers.

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

Usage Guidelines4/5

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

Gives concrete when-to conditions: pass required_capabilities "when the orchestrator already knows what the task needs," use exclude_agents to keep the human-facing orchestrator out of the worker pool, and opt into on_limit='handoff' only with worktree=True. It also directs the caller to "read their outcome with job_review before spending anything on the job's output," which is a useful follow-up pointer. It never names an alternative tool to choose instead (such as preferring route_task for routing-only decisions), so it stops short of explicit when-not guidance.

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

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/adityarya24/mindsync-ai'

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