Skip to main content
Glama

git_diff

Read-only

Inspect Git working-tree or staged changes without executing shell commands, optionally limiting output to specific repository paths and returning only statistics.

Instructions

Read the Git working-tree or staged diff without running a shell command, optionally limited to specific paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoGit repository directory; defaults to the workspace.
pathsNoLimit the diff to these repository paths.
stagedNoRead the staged diff instead of the working-tree diff.
max_bytesNoMaximum diff bytes.
stat_onlyNoReturn only diff statistics.
context_linesNoLines of context around each hunk.
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, covering the safety profile. The description adds the implementation detail that no shell command is executed, which is minor but useful. It does not describe output shape, truncation, or size limits, though these are partly reflected in the schema.

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?

One front-loaded sentence with no filler. Every element earns its place: the read behavior, the working-tree/staged distinction, the no-shell-command note, and optional path scoping.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only Git diff tool with well-documented optional parameters and safety annotations, the description is largely complete. It could mention the output format or default behavior when no paths are given, but those are inferable from the tool name and schema.

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 documentation coverage is 100%, so the baseline is 3. The description reinforces the meaning of 'staged' and 'paths' but does not add semantic detail beyond what the input schema already provides for the six parameters.

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 states a specific verb ('Read'), a precise resource ('Git working-tree or staged diff'), and an optional scoping behavior ('limited to specific paths'). It clearly identifies this as the diff-reading tool among siblings like git_status and git_show, and conveys that it does not invoke a shell command.

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 gives clear usage context: it reads working-tree or staged diffs and can be scoped to paths. It implicitly contrasts with shell_command by noting it runs without a shell command, though it does not explicitly describe when to prefer alternative Git tools or shell commands.

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/JonusNattapong/ChatGPTMCP'

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