Skip to main content
Glama

compare_text_files

Compare two existing text files as a read-only diff to identify differences without editing either file. Adjust context lines to control how much surrounding text appears.

Instructions

Compare two Owner-scoped existing files without editing either.

Use to compare two existing Owner-scoped text files as a read-only diff. before_path and after_path are files, not patches; context_lines adjusts displayed context only.

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": {
      "before_path": "<before_path>",
      "after_path": "<after_path>"
    },
    "name": "compare_text_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
after_pathYesSecond existing file to show on the right/new side of a read-only comparison.
before_pathYesFirst existing file to show on the left/old side of a read-only comparison.
context_linesNoRead-only diff context lines, 0 to 8; default 3.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does reasonably well: it declares the operation read-only, says neither file is edited, states the Owner-scope prerequisite, and rules out patch semantics. It does not cover edge cases such as binary/large files or encoding, which leaves a modest gap for a file-comparison tool.

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?

Two short sentences, front-loaded with the core operation, with no filler. There is mild redundancy between the first sentence and the 'Use to compare two existing Owner-scoped text files' opener, but the parameter clarifications in the second sentence earn their space.

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?

An output schema exists, so return format needn't be described, and the description covers scope, read-only semantics, and the file-vs-patch distinction. What remains missing is minor edge-case behavior, which is acceptable for a three-parameter diff tool.

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 the baseline is 3, but the description adds genuine meaning: before_path and after_path must be existing files and are not patches, and context_lines only affects displayed context rather than the diff itself. That last point is real clarification beyond the schema's 'diff context lines, 0 to 8' wording.

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?

The description states a specific verb and resource ('compare two ... text files as a read-only diff') and clarifies the inputs are files rather than patches, which distinguishes it from the preview_source_patch / request_source_patch_dev siblings. It stops short of naming an alternative explicitly, but the operation is unambiguous.

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?

'Use to compare two existing Owner-scoped text files as a read-only diff' gives a clear context for invocation, and 'files, not patches' implicitly excludes patch workflows. However, there is no explicit when-not guidance, no pointer to the sibling that should be used for non-Owner-scoped or single-file reads, and no note on what to do if a path is missing.

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