Skip to main content
Glama

git_diff

Show changes between commits, a commit and the working tree, or staged changes inside a Docker sandbox, with optional filtering by file path.

Instructions

Shows changes between commits, commit and working tree, etc.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sandboxId": "<sandboxId>"
    },
    "name": "git_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoSpecific file path
cachedNoView staged changes
sandboxIdYesTarget sandbox identifier

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. "Shows" implies a read-only operation, but the description never says whether a git repository must already exist in the sandbox, what the diff output looks like, or what happens for an untracked/invalid file path.

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?

A single short sentence that is front-loaded with the core verb and resource. The trailing "etc." is the only wasted token and it slightly undercuts precision.

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?

With three documented parameters and no output schema, the structured fields cover the mechanics of calling it. However, for a diff tool the shape of the returned output and the requirement of an initialized repo are meaningful gaps that the description leaves unaddressed.

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 description coverage is 100%, so the schema already documents file, cached, and sandboxId, making 3 the baseline. The description's reference to "commit and working tree" loosely maps to the cached/staged concept but adds no format, path-syntax, or defaulting detail beyond the schema.

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?

"Shows changes between commits, commit and working tree" states a specific verb and resource and even sketches the diff comparison modes, so an agent knows this is a diff tool. It stops short of distinguishing itself from siblings like git_log or git_status, and the trailing "etc." blurs the scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no exclusions, and no mention of the adjacent tools (git_log, git_status) that an agent might confuse this with. The agent must infer from the name alone that this is the tool for inspecting diffs rather than history or status.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.