Skip to main content
Glama

get_git_diff

Retrieve the deterministic Git diff of repository changes to inspect modifications, optionally scoped by path or staged status.

Instructions

Retrieve the deterministic Git diff of changes made in the repository.

Args: path: Optional relative file or directory path to scope the diff. cached: If True, inspects staged changes (git diff --cached) (default: False).

Returns: JSON string containing diff string, has_changes boolean, and changed_files list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
cachedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

No annotations exist, so the description carries the behavioral burden. It discloses staged-change behavior via cached, mentions determinism, and specifies the JSON return fields. However, it does not explicitly state the default scope as unstaged changes only or that untracked files are excluded.

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 front-loaded with the main purpose and uses compact Args/Returns sections. Every sentence adds meaningful information, with no filler or unnecessary repetition.

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 simple tool with two optional parameters and no annotations, the description covers the operation, inputs, and return shape. It is slightly incomplete because it does not clarify the default diff scope or mention edge cases like no changes or invalid paths, and it does not guide selection among siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description fully documents both parameters beyond the schema. Path is explained as a relative file/directory scope, and cached is explained as switching to staged changes with a default. This fully compensates for the sparse schema.

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 identifies a specific action ('Retrieve') and resource ('deterministic Git diff'), and clarifies optional path and cached scoping. It is clearly distinct from siblings like get_repository_status or list_files. The purpose is unambiguous.

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

Usage Guidelines3/5

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

The description implies when to use the tool through its name and purpose, but it does not explicitly state when to choose this over alternatives. There is no mention of get_repository_status or other sibling tools, and no exclusions are provided.

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