Skip to main content
Glama

Delegate task

delegate_task

Enqueue a self-contained coding task for a DevIntern worker to implement in its own checkout and open a PR. Use for agreed, reviewable handoffs; include scope, acceptance criteria, and verification.

Instructions

Enqueue an ad-hoc task for a workspace repo, exactly like devintern worker add --json: a DevIntern worker implements it in its own checkout and usually opens a PR. Use it only for work the user agreed to hand off, preferably independent pieces that can be reviewed separately. The brief must be self-contained: the worker does not see this chat, uncommitted edits, or local-only files, so include the goal, relevant files, acceptance criteria, scope limits, and verification commands, and push commits it depends on. The body is limited to 20000 characters. Pass a stable idempotencyKey so a retry returns the same task (deduplicated: true) instead of a second one. For dependent work, enqueue each step now with after: [earlier taskKey] (any repo in the workspace; a step in another repo waits for that PR to merge) instead of waiting. Each task opens its own PR from its own branch; it cannot push to an existing PR. To branch from an existing remote branch and open the PR into it, put a Target branch: <branch> line in the body (it overrides stacking). Success means queued, not implemented: follow up with wait_for_tasks or get_task. When this is refused because direct delegation is off, use propose_task.

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": {
      "repo": "<repo>",
      "title": "<title>",
      "body": "<body>"
    },
    "name": "delegate_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYesSelf-contained Markdown brief (at most 20000 characters)
repoYes[[repos]] name (see get_workspace_config)
afterNoTask keys (any repo in the workspace) this task starts after; one in another repo always waits for its PR to merge
modelNo
titleYesShort task title; also names the branch
effortNoReasoning effort: low, medium, or high
harnessNoPin the run to this agent harness
dependencyModeNostacked: once a same-repo dependency succeeded, branch from its branch and open this PR against it; the worker retargets and rebases the PR after the dependency merges. merged: wait for the dependency's PR to merge. Default: the workspace's [defaults].dependency_mode
idempotencyKeyNoStable key for retries of the same dispatch

Output Schema

NameRequiredDescriptionDefault
idNo
repoNo
statusNo
messageNo
taskKeyNo
warningsNo
dependsOnNo
errorCodeNoSet on failure: stable error code
nextStepsNoSet on failure: steps to run next (`command` runs on the worker host)
deduplicatedNo
dependencyModeNo
dependencyStateNo
dependencyReasonNo
harnessPausedUntilNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only give the safety profile (not read-only, not destructive, not inherently idempotent), and the description adds substantial behavior beyond that: the worker cannot see the chat, uncommitted edits, or local files; each task opens its own PR from its own branch and cannot push to an existing PR; cross-repo dependencies wait for PR merge; the 20000-character limit; and that success means queued, not implemented. The idempotentHint=false annotation is not contradicted — the description explains dedup is opt-in via a stable idempotencyKey.

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?

Dense but almost every clause carries actionable information, and the core purpose plus the key constraint (self-contained brief) are front-loaded. It reads as one long undifferentiated paragraph and repeats the 20000-character limit already present in the schema, which slightly hurts scanability.

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

Completeness5/5

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

For a 9-parameter dispatch tool with an output schema, the description covers everything an agent needs to call it correctly: brief requirements, idempotency/retry semantics, dependency handling, branch targeting, and what to do after queueing (wait_for_tasks or get_task). Return values are correctly left to the output schema.

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

Parameters5/5

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

Schema coverage is already 89%, yet the description still adds meaning the schema cannot: what a 'self-contained brief' must contain (goal, relevant files, acceptance criteria, scope limits, verification commands, pushed commits), why idempotencyKey must be stable, how `after` keys behave across repos, and that a 'Target branch:' line in the body overrides stacking. That is real semantic guidance layered on top of structured fields.

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?

States a specific verb and resource ('Enqueue an ad-hoc task for a workspace repo') and pins the semantics to a known CLI equivalent (`devintern worker add --json`), then explains what actually happens (worker implements in its own checkout, usually opens a PR). An agent can distinguish this from propose_task and the read-only task tools without opening a schema.

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?

Explicit when-to-use ('only for work the user agreed to hand off, preferably independent pieces'), explicit alternative for dependent work ('enqueue each step now with after: [earlier taskKey] instead of waiting'), a routing rule when direct delegation is disabled ('use propose_task'), and a live alternative for branching ('Target branch: <branch>' instead of waiting). This is about as complete as usage guidance gets.

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