Skip to main content
Glama

delegate

Delegate a bounded file-edit task to a local executor with strict write scope and runnable acceptance checks, then get a receipt with cited evidence and a diff.

Instructions

Give the local executor a bounded task in a project and get a receipt.

The contract is strict (TANDEM_STRICT=0 relaxes it): a call is refused unless it gives a goal with concrete targets, write_globs that name files, and verify_commands that can fail. When the checks only look for text or files (grep, test, ls), or the task writes files whose look no command proves (HTML, CSS, SVG, UI components), constraints are required too. For every constraint the executor must cite, at finish, the line that satisfies it: the server looks the quote up in the file, sends the work back when a constraint has none, and lists the cited lines in the receipt. Constraints are atomic: one requirement each, at most 160 characters, so that every requirement gets its own cited line. When every check already passes before the work and no constraint is given, the job stops before the executor starts, because nothing would prove the work. Accepting a job needs its job_evidence (the cited lines) or its job_diff read.

goal: what to do, precise and self-contained (files, names, exact values, expected behaviour). workspace: absolute path of the project folder; the executor cannot leave it. verify_commands: shell commands that must exit 0 for the work to be accepted (tests, build, a grep that must find or not find something). They run after the executor finishes in an isolated sandbox with secret env vars stripped; their failures go back to it for up to max_repairs attempts. Give at least one whenever you can. The files they name (and test folders) are read only for the executor unless write_globs names them. write_globs: files it may write, as globs relative to the workspace. Required; a glob that matches every file ('', '**/') is refused. allow_run: regular expressions of commands the executor itself may run (empty: none). Every part of a pipeline or chain must match one. A pattern matches anywhere in the part: start it with ^ (for example '^pytest\b') so that it names the command and not one of its arguments. immutable: files or globs relative to the workspace that are always read only. read_globs: optional files or globs relative to the workspace the executor may read via read_file, list_files, and search (empty: all workspace files). Note: if allow_run is also set, shell commands run against the mounted workspace and are not filesystem-filtered by read_globs; omit allow_run when strict read confinement is required. context: facts it needs and cannot find in the files. constraints: explicit, checkable contract requirements (coordinates, selectors, invariants) injected into the executor prompt and listed in the receipt for post-run inspection. wait_seconds: how long this call waits; a longer task keeps running, poll it with job_status. baseline: run the checks once before the work. The executor starts from their failures, and the receipt says when a check already passed, which means it proves nothing about this work. max_seconds: time limit of the job (0: none). checks_network: allow network access inside the sandbox when running verify_commands. unjailed_checks: run verify_commands outside bubblewrap (for checks needing host resources).

Every file the executor changes is journalled (and command changes are snapshotted): job_diff shows the change, job_rollback undoes it without overwriting later user edits. The syntax of every changed file is checked before the checks run. Good tasks: mechanical edits across files, a function plus its test, docs brought in line with a change, renames. Poor tasks: design choices, anything without a check.

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": {
      "goal": "<goal>",
      "workspace": "<workspace>"
    },
    "name": "delegate"
  }
}

Input Schema

NameRequiredDescriptionDefault
goalYes
modelNo
contextNo
baselineNo
allow_runNo
immutableNo
max_stepsNo
workspaceYes
read_globsNo
constraintsNo
max_repairsNo
max_secondsNo
write_globsNo
wait_secondsNo
checks_networkNo
unjailed_checksNo
verify_commandsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.6.1
    • addedInput schema / properties / constraints
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Constraints",
      +  "type": "array"
      +}
    • addedInput schema / properties / read_globs
      Added value: +{
      +  "default": [],
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Read Globs",
      +  "type": "array"
      +}
  2. First observedv3.0.1

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does: refusal conditions (no goal with targets, no write_globs, no failable verify_commands, wildcard globs), the pre-run abort when all checks already pass, sandbox env-var stripping, bubblewrap jailing, network gating, and post-run journalling/rollback semantics. Failures loop 'up to max_repairs attempts' and every changed file is syntax-checked before verification, which an agent could not infer from any structured field.

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?

The purpose is front-loaded and the parameter list is scannable, and most of the length is earned by genuine contract detail. However, the opening paragraph packs refusal rules, constraint-citation mechanics, and an env-var aside (TANDEM_STRICT=0) into dense prose before the parameter list, so the ordering is not optimal.

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 complex 17-parameter mutation-adjacent tool with no annotations, the description covers what an agent needs: refusal contract, sandbox behavior, acceptance criteria, polling, rollback, and task-fit guidance. An output schema exists, so the absence of return-value detail is not a gap.

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 supply parameter meaning, and it largely does: goal, workspace, verify_commands, write_globs, allow_run (including the '^pytest\b' anchoring advice), immutable, read_globs, context, constraints (atomic, 160 chars), wait_seconds, baseline, max_seconds, checks_network, unjailed_checks, and max_repairs are all explained. Only model and max_steps go undocumented, which is a small but real gap in a 17-parameter 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?

Opens with a specific verb, resource and outcome: 'Give the local executor a bounded task in a project and get a receipt', which separates it from control-plane siblings. The body reinforces the distinction by pointing to job_status for polling and job_diff for inspecting the recorded change.

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 states when to supply verify_commands ('Give at least one whenever you can') and when not to combine options ('omit allow_run when strict read confinement is required'). It also draws the boundary in both directions with 'Good tasks: mechanical edits across files... Poor tasks: design choices, anything without a check.'

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