Skip to main content
Glama

Agent worktree diff

get_agent_diff

Retrieve an isolated agent's worktree changes against its starting commit, including uncommitted and untracked files, with per-file line counts and a size-capped unified diff.

Instructions

An isolated agent's changes: everything in its managed worktree, committed or not and untracked files included, against the commit it started from (the snapshot for snapshot isolation). Returns per-file line counts and a unified diff capped at max_chars (default 20000, cut at a line end; truncated says so).

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": {
      "agent": "<agent>"
    },
    "name": "get_agent_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentYes
max_charsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden, and it does add real context: scope (committed, uncommitted, untracked), baseline semantics, return shape, and truncation with a `truncated` indicator. It still leaves out error behavior for unknown/cleaned-up agents, whether it is purely read-only, and any cost or size caveats beyond max_chars.

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?

A single front-loaded sentence whose clauses each add information: scope, baseline, return content, and truncation. It is dense with parentheticals but no sentence is wasted; slight readability cost from packing everything into one sentence.

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?

With no output schema and no annotations, the description does the necessary work of describing the return payload (per-file line counts plus unified diff) and truncation signaling. The remaining gap is the semantics of the required `agent` argument and failure modes, which for a two-parameter read tool is a modest omission.

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

Parameters3/5

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

Schema coverage is 0%, so the description must compensate. It handles max_chars thoroughly (default 20000, line-end cut, `truncated` flag), but the required `agent` parameter is only implied by 'an isolated agent's' — no indication whether it takes an agent ID, name, or worktree identifier.

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?

States a specific verb and resource ('get_agent_diff' → an isolated agent's changes in its managed worktree) and defines the comparison baseline precisely (the commit it started from, or the snapshot for snapshot isolation). It is unambiguous what the tool returns, though it never names a sibling (e.g. get_agent_result) to contrast against.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: an agent reading 'an isolated agent's changes' can infer this is for inspecting worktree modifications, but there is no explicit when-to-use, when-not-to-use, or pointer to an alternative for related questions like an agent's final output or event history.

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