Skip to main content
Glama

git_diff

Show local code changes in a repository to review edits and plan next steps. Supports staged/unstaged diffs, path filtering, and unified context lines.

Instructions

git diff inside a project root (unstaged by default). Free local I/O — the review loop: ChatGPT reads this and decides next steps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoRestrict the diff to a path inside the root.
cachedNoDiff staged (cached) changes instead of unstaged.
contextNoUnified context lines (default 3).
projectNoProject path the user named in chat (armed via init). Pass it explicitly on every call. If no project has been named, ask the user; never guess.
session_tokenNoSession token returned by init (or create_project). Required for every project tool call in this chat. A new chat must be re-armed.
redact_secretsNoRedact known secret patterns (default true).
Behavior3/5

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

The description discloses that git diff operates on unstaged changes by default and describes the operation as 'free local I/O,' implying it is read-only and side-effect-free. However, it does not mention prerequisites like the session token or project path, nor the output format, leaving gaps given no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences; the first front-loads the core action, and the second adds usage context. The second sentence is slightly vague ('Free local I/O — the review loop') but not wasteful.

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

Completeness3/5

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

The description is brief and lacks explicit mention of output format or required invocation context (project/session), but given the schema and the standard nature of git diff, it is minimally adequate. No output schema exists, so the description should have stated what the tool returns.

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?

The schema covers all six parameters with meaningful descriptions, so the description adds minimal additional meaning. The only extra context is 'unstaged by default,' which complements the `cached` parameter but is already implied by schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs `git diff` inside a project root and defaults to unstaged changes. This is specific and identifiable among sibling tools, though it does not explicitly name alternatives.

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 says 'the review loop: ChatGPT reads this and decides next steps,' which provides a clear context for when to use the tool. However, it does not explicitly state when not to use it or name alternative tools like git_status or git_log.

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/psrisuphan/cheap-labor'

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