Skip to main content
Glama

get_file_diff

Read-only

Extract the complete diff for a single file from a loaded diff. Get all changes for one file without fetching the entire chunk.

Instructions

Extract the complete diff for a single file from a loaded diff. Returns the diff --git header and all hunks for that file. Use this when you need changes for one specific file without fetching the entire chunk. Auto-loads the diff file if not already loaded. Supports exact file paths or glob patterns that match exactly one file. Use list_chunks with file_details to see per-file line counts and decide whether to use this tool or get_chunk. CRITICAL: You must use an absolute directory path - relative paths will fail.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesExact file path or glob pattern matching a single file within the diff (e.g., 'src/main.py', '*.config')
absolute_file_pathYesAbsolute path to the diff file
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses auto-loading behavior and path requirement. No contradictions with annotations.

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?

Every sentence serves a purpose: purpose, usage guidance, behavioral note, error condition. Concise and front-loaded with essential information.

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 no output schema, the description explains return value. With good annotations and clear parameter semantics, it provides complete contextual information for correct usage.

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 covers both parameters with descriptions, but the tool description adds valuable context: file_path can be exact path or glob, and absolute_file_path must be absolute. Adds nuance beyond schema.

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 action ('extract'), the resource ('complete diff for a single file'), and the output ('diff --git header and all hunks'). It distinguishes from sibling tools like get_chunk and list_chunks.

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?

Explicitly tells when to use ('when you need changes for one specific file'), references sibling tools for decision-making ('Use list_chunks... decide whether to use this tool or get_chunk'), and includes a critical requirement ('absolute directory path - relative paths will fail').

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/peteretelej/diffchunk'

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