Skip to main content
Glama

Diff one file between two history versions

diff_file
Read-only

Compare two versions of a project file and show changed lines marked as insertions, deletions, and unchanged context.

Instructions

Shows what changed in one file between two versions from list_history. Changed lines are marked with ~, insertions as [+text+] and deletions as [-text-], with a few lines of context.

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>",
      "from": "<from>",
      "to": "<to>"
    },
    "name": "diff_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesVersion to diff to (`to_version` of a list_history entry).
fromYesVersion to diff from (`from_version` of a list_history entry, or an earlier `to_version`).
pathYesProject-relative path of the file, as it was named in the versions compared.
project_idNoOverleaf project id from list_projects or open_project. Opens the project if it is not already active. Pass it on every call when MCP sessions may change between calls. Writes without it only go to the project last confirmed by open_project or by a write naming it.
context_linesNoUnchanged lines to show around each change (default: 2).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, so the description carries the burden of output disclosure and does so well: it explains the diff notation (`~` for changed, [+text+] insertions, [-text-] deletions) and that surrounding context lines are shown. It stops short of stating behavior for edge cases such as a nonexistent path or a version where the file was renamed.

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?

A single front-loaded sentence with zero filler: the purpose leads, and the output-notation clause and context-lines clause each add distinct information.

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, the description correctly explains the return format and notation, which is the main thing an agent needs. It is nearly complete, with only error and edge-case behavior left undocumented.

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 100%, so from/to/path/project_id/context_lines are already fully documented in the schema, including the note that from/to correspond to list_history versions. The description restates the version-source relationship without adding syntax or format detail beyond the schema; baseline 3 applies.

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 ('Shows what changed in one file between two versions') and names list_history as the source of the version identifiers, so an agent can distinguish this from read_file or list_history without opening the schema.

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?

The reference to 'two versions from list_history' implies the prerequisite workflow (call list_history first), but there is no explicit when/when-not guidance or named alternative for inspecting a file's current content versus its history.

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