Skip to main content
Glama

Diff Files

diff_files
Read-onlyIdempotent

Generate a unified diff between two files. Use the output with apply_patch to apply changes. Returns isIdentical=true when files match, meaning no patch is required.

Instructions

Generate a unified diff between two files. Output feeds directly into apply_patch. isIdentical=true means files match — no patch needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
originalYesPath to original file
modifiedYesPath to modified file
contextNoLines of context to include in the diff
ignoreWhitespaceNoIgnore leading/trailing whitespace when comparing lines
stripTrailingCrNoStrip trailing carriage returns before diffing

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
diffNoUnified diff content
isIdenticalNoTrue if files are identical
linesAddedNoLines added
linesRemovedNoLines removed
hunksCountNoNumber of diff hunks
truncatedNoDiff content truncated?
resourceUriNoFull diff content URI
Behavior4/5

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

Annotations already indicate read-only, non-destructive, idempotent behavior. Description adds useful context about unified diff format and integration with apply_patch, surpassing annotation coverage.

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?

Two sentences, no wasted words, front-loaded with action and output context. Highly efficient.

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?

Given the presence of output schema and rich annotations, the description provides essential context about output consumption by 'apply_patch' and the meaning of 'isIdentical', making the tool complete for an AI agent.

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 description coverage is 100%, so baseline is 3. Description does not add parameter-level details beyond what the schema provides, though it adds output context.

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 verb 'generate' and resource 'unified diff between two files', and connects to sibling tool 'apply_patch'. It distinguishes from other tools like 'edit' or 'search_and_replace'.

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 states output feeds into 'apply_patch' and explains the 'isIdentical' flag meaning no patch needed, providing clear context for when to use. Slightly lacking explicit 'when not to use' compared to 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/j0hanz/filesystem-mcp'

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