Skip to main content
Glama

doc_diff

Read-only

Compare document revisions to see what changed, returning a unified diff with added and removed counts, rename tracking, and truncation for large diffs.

Instructions

What changed in a document: rev alone shows that commit's change; add base to diff two revisions. A unified diff with added/removed counts; follows renames, truncates large diffs. Use doc_at for the whole text at a revision.

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": {
      "path": "<path>"
    },
    "name": "doc_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
revNoThe newer revision; HEAD (the default) is the current one. Prefer a sha from doc_history: HEAD~N counts the whole mind's commits, not this doc's.HEAD
baseNoThe older revision; omit it for the doc's version just before `rev`.
pathYesPath of the doc, e.g. notes/cdc.md.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.8.0
    • changedInput schema / properties / base / description
      Previous value: -"The older one; omit for the doc's previous version."New value: +"The older revision; omit it for the doc's version just before `rev`."
    • changedInput schema / properties / path / description
      Previous value: -"The doc."New value: +"Path of the doc, e.g. notes/cdc.md."
    • changedInput schema / properties / rev / description
      Previous value: -"The newer revision (sha or HEAD~N)."New value: +"The newer revision; HEAD (the default) is the current one. Prefer a sha from doc_history: HEAD~N counts the whole mind's commits, not this doc's."
  2. First observedv2.7.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover the read-only, closed-world safety profile, so the bar is lower; the description still adds real context by disclosing the output shape (unified diff with added/removed counts), rename-following behavior, and truncation on large diffs. Truncation in particular is a behavioral trait an agent needs to know when interpreting results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, front-loaded with the core purpose, then behavior, then the alternative routing. No redundant wording and nothing repeated from the schema verbatim.

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?

With no output schema, the description supplies the return format and truncation caveat; parameter count is low and fully documented. An agent has everything needed to invoke it and interpret the result.

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 coverage is 100%, so a baseline of 3 applies, but the description earns extra credit by explaining the interaction between rev and base (rev alone = that commit's change; base added = two-revision diff) and the default base of 'version just before rev'. This is relational meaning the schema describes only piecewise.

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 ('What changed in a document') and immediately clarifies the two operating modes (rev alone vs. rev+base). It is clearly distinguishable from doc_at, which the description explicitly contrasts.

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?

Explicitly routes the agent to doc_at when the full text at a revision is wanted, and explains the rev-only vs. base modes. It stops short of stating failure conditions (invalid rev, missing path) or when this tool should not be used, so it falls just short of fully explicit guidance.

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