Skip to main content
Glama

git_diff

Return Git diffs showing changed files and diff text, with truncation to prevent context overload. Use for reviewing code changes and comparing working tree to index.

Instructions

Returns the Git diff for a repository, showing changed files and diff text. Output is capped to prevent context flooding, with a truncated flag if the cap was hit. The repo path must be within allowed roots.

Use this when investigating what code changes were made, comparing working tree to index, or reviewing staged changes. Does not modify system state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYes
cachedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states output is capped to prevent context flooding with a truncated flag, the repo path must be within allowed roots, and the tool does not modify system state. These are concrete behavioral traits that an agent needs to know, making this highly 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 two short paragraphs with no filler. The primary function is front-loaded in the first sentence, with key behavioral notes (truncation, allowed roots) following immediately. The second paragraph provides usage guidance without redundancy. Every sentence earns its place.

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 has an output schema, so return value details are covered there. The description covers the critical aspects: what it returns, truncation behavior, path restrictions, read-only nature, and usage context. It is complete for an agent to decide when and how to call it correctly.

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 schema provides zero descriptions for the two parameters (repo and cached), so the description must add meaning. It implicitly explains the 'cached' parameter through the phrase 'comparing working tree to index, or reviewing staged changes,' which maps directly to cached=true. While repo is self-explanatory, the description could be more explicit about parameter semantics, but it does give enough context to guide correct invocation.

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 Git diff for a repository, listing changed files and diff text. It distinguishes this tool from siblings like git_status and git_log by focusing on the diff operation and explicitly mentioning the 'cached' parameter's role in comparing working tree to index.

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?

The description specifies when to use the tool ('investigating what code changes were made, comparing working tree to index, or reviewing staged changes') but does not explicitly mention alternatives or when not to use it. While these use cases clearly separate it from other git tools, the lack of explicit exclusions or alternative references keeps it just short of a 5.

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/Ronit-k/MCPilot'

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