Skip to main content
Glama

git_diff

Read-onlyIdempotent

View unstaged, staged, or all code changes in a project. Returns a structured summary, file list, and size-limited diff without modifying anything.

Instructions

Structured read-only git diff for a registered project root. mode=unstaged|staged|both. Returns numstat summary, file list, and a byte-capped unified diff with truncated=true when clipped. Optional path under root. lease_id optional. No mutations. For uncovered Git ops use exec_run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoboth
pathNo
projectNodemo
lease_idNo
max_bytesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, and the description adds useful details about output truncation ('byte-capped unified diff with truncated=true when clipped') and the no-mutations policy. It does not contradict 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?

Three sentences, front-loaded with the core purpose. Each sentence contributes essential information: purpose/modes, output/truncation, and caveats/alternative. No wasted words.

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 moderate complexity, the description covers purpose, output behavior, optional parameters, and an alternative fallback. The existence of an output schema reduces the need to explain return values further, and the description is self-contained for a developer.

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 description coverage is 0%, but the description compensates by explaining mode values, path scope ('under root'), lease_id optionality, and max_bytes via the byte-capping behavior. It doesn't explicitly explain the 'project' parameter, but the overall semantics are adequately conveyed.

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 'Structured read-only git diff for a registered project root' with specific modes (unstaged|staged|both). It distinguishes from siblings by specifying the output (numstat summary, file list, unified diff) and mentions exec_run as an alternative for uncovered Git ops.

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?

It explicitly provides usage context (git diff, modes, optional path/lease_id) and names an alternative: 'For uncovered Git ops use exec_run.' This satisfies the when/when-not/alternatives criterion, even though it doesn't explicitly mention git_status.

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/davidlosasgonzalez/codeagent-mcp'

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