Skip to main content
Glama

git_get_diff

Get a git diff between two refs or commits to compare branches, inspect commit ranges, or review changes.

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 must carry behavioral transparency. It mentions paging via charOffset and maxChars, but does not describe the output format (e.g., unified diff), handling of errors, or limits. Adequate but not comprehensive.

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 sentences: first states purpose, second provides usage scenarios. Very concise with no wasted words. Could be slightly more structured, but efficient.

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?

With 5 well-documented parameters, no output schema, and no annotations, the description explains the core functionality and provides paging guidance. It misses details about diff output format but is fairly complete for a simple tool.

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 coverage is 100% with descriptions for each parameter. The description reinforces usage of maxChars and charOffset for large diffs, adding marginal value beyond the schema. Baseline 3 is appropriate.

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' and lists specific use cases like comparing a feature branch to main. It distinguishes itself from siblings like git_get_context and JIRA tools by focusing on git diffs.

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 this tool ('when you need to compare a feature branch to main...') and provides guidance for large diffs. It does not include when-not-to-use or alternative tools, but the sibling names provide context.

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