Skip to main content
Glama

Git Staged Diff

git_staged_diff
Read-onlyIdempotent

Retrieve the staged diff and file status list to write a commit message. Use this read-only tool to inspect changes before committing.

Instructions

Return the staged diff (git diff --cached) plus a per-file status list, for writing a commit message.

This is the first step of the aicommit workflow: read the diff, write a Conventional Commit message, then call git_commit. Read-only.

Args:

  • repo_path (string, optional): repository path (default: server cwd)

  • max_bytes (number, optional): truncate the diff above this size (default 100000)

Returns JSON: { diff, files: [{ path, status }], isEmpty, truncated }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathNoPath to the git repository. Defaults to the server's working directory.
max_bytesNoTruncate diff above this many bytes
Behavior4/5

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

Description reinforces the read-only annotations and adds details about return structure (diff, files, isEmpty, truncated) and truncation behavior. No contradictions with 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?

The description is extremely concise: two sentences for purpose and workflow, then parameter and return details. Every sentence adds value, and the structure front-loads the key information.

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?

Even without an output schema, the description fully details the return JSON structure. It covers purpose, parameters with defaults, return fields, and workflow integration, making it complete for a simple tool with two parameters.

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?

The description adds default values for both parameters (repo_path: server cwd, max_bytes: 100000) beyond the input schema, which only describes them without defaults. Schema coverage is 100%, so the addition is helpful but not essential.

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?

Description clearly states the tool returns the staged diff and per-file status for writing a commit message, distinguishing it from siblings like git_commit and git_status. The verb 'Return' and resource 'staged diff' are specific.

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?

Explicitly positions the tool as the first step of the aicommit workflow, guiding the agent to call git_commit after. While it doesn't list when not to use it, the workflow context provides clear usage guidance.

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/BenBen2109/ai-git-mcp'

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