Skip to main content
Glama

git_get_diff

Get a diff between two git refs or commits to compare branches, inspect commit ranges, or review changes. Supports paging through large diffs with offset.

Instructions

Get a diff between two git refs or commits. Use when you need to compare a feature branch to main, inspect a specific commit range, or review changes between two refs. For large diffs, increase maxChars or use charOffset to page through them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoPathNoPath to the git repository (defaults to cwd)
fromRefNoBase ref or commit
toRefNoTarget ref or commit (requires fromRef)
maxCharsNoMax characters to return (default 8000). Increase for large diffs.
charOffsetNoSkip this many characters from the start (for paging large diffs)
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses paging behavior (charOffset) and maxChars limit, but does not explicitly state that the operation is read-only or mention any side effects, rate limits, or auth requirements. The description is adequate but not rich in behavioral detail.

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 two sentences, front-loading the purpose and following up with usage context and practical tips. Every sentence earns its place, and there is no wasted text.

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?

Given the tool's simplicity (5 parameters, all documented), the absence of an output schema is acceptable. The description covers what the tool does, when to use it, and how to handle large diffs. It is complete for its complexity level.

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 baseline is 3. The description adds value by explaining the purpose of maxChars and charOffset for handling large diffs, but does not provide additional semantics beyond what the schema already conveys. The parameters are straightforward.

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 clearly states 'Get a diff between two git refs or commits' with specific verb and resource. It also lists concrete use cases (compare feature branch to main, inspect commit range) that distinguish it from sibling tools like git_get_context.

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 explicitly says when to use the tool (compare branches, inspect ranges, review changes) and provides guidance for large diffs (increase maxChars, use charOffset). It lacks explicit exclusions or alternatives, but the context is clear.

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/stubbedev/atlassian-mcp'

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