Skip to main content
Glama

file_diff

Generate a unified diff between any two files, independent of git, with options for context lines and ignoring whitespace.

Instructions

Returns a unified diff between two arbitrary files. Works outside git — for tracked files use the git tool's diff subcommand instead, which understands refs and the index. Use context_lines to control surrounding context and ignore_whitespace to skip formatting-only changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_aYesPath to the first file (the 'before' side). Absolute path, file:// URI, or workspace-relative path.
file_bYesPath to the second file (the 'after' side). Absolute path, file:// URI, or workspace-relative path.
context_linesNoLines of context shown around each change (default 3)
ignore_whitespaceNoIgnore whitespace-only differences
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It clearly indicates a read-only diff operation, works outside git, and explains the effect of two parameters. It does not explicitly state that files are not modified, but that is implicit in the 'diff' operation. Slightly more detail about potential edge cases could improve it, but the core behavior is transparent.

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?

The description is compact and front-loaded, stating the purpose in the first sentence. It contains only 41 words and every sentence carries functional information, such as the git alternative and parameter hints.

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?

The tool is simple, with all four parameters documented in the schema. The description clearly states the return format (unified diff), provides usage guidelines, and references relevant parameters. Given no output schema, the description adequately covers what is needed for an agent to invoke this tool effectively.

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?

The input schema already covers all parameters with descriptions (100% coverage), so the baseline is 3. The description adds value by explaining how context_lines and ignore_whitespace affect the output, reinforcing the schema's semantics without merely duplicating it.

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?

The description clearly states the tool returns a unified diff between two files, with a specific verb and resource. It also explicitly contrasts with the git tool's diff subcommand, effectively distinguishing it from a sibling tool.

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?

The description provides explicit guidance on when to use this tool instead of the git tool (for non-tracked files) and mentions how to control context and whitespace handling. This directly addresses usage alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plumbkit/plumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server