Skip to main content
Glama

Git PR context

git_pr_context
Read-only

Collects commit lists, changed file statuses, and diffstats between a head and base ref so you can write accurate pull request descriptions.

Instructions

Collect the commits and file changes of a branch vs a base ref (for writing a PR description): commit list, changed files with status, and a diffstat over base...head.

Input Schema

NameRequiredDescriptionDefault
cwdNoRepository path
baseNoBase ref to compare against (default 'main')main
headNoHead ref (default 'HEAD')HEAD

Output Schema

NameRequiredDescriptionDefault
baseYes
headYes
filesYes
changesYes
commitsYes
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A3.7/5.0
Behavior4/5

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

readOnlyHint=true already declares the safety profile, and the description usefully specifies that the output is an aggregate of three artifacts (commits, file statuses, diffstat) rather than a raw diff. It doesn't mention size/truncation behavior for large branches, which is the main remaining gap.

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 front-loaded sentence that puts the resource and range before the use case. Minor deduction for the trailing ellipsis, which leaves the enumeration looking truncated rather than finished.

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?

Read-only, fully documented parameters with sensible defaults, and an output schema that carries return-value detail. The description is close to complete for this complexity; only edge-case behavior on very large comparisons is 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 coverage is 100%, so base, head, and cwd are already documented with defaults. The description's 'base...head' phrasing reinforces the range semantics but adds no format details beyond the schema, so the baseline 3 applies.

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?

States a specific verb ('Collect') and concrete resources (commit list, changed files with status, diffstat) over a base...head range, plus the intent ('for writing a PR description'). It implicitly separates itself from single-purpose siblings like git_log and git_diff by being an aggregate, but never names them explicitly.

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 parenthetical 'for writing a PR description' gives a use context, which is useful. However there is no explicit guidance on when to prefer this over git_log, git_diff, or git_status, nor any stated exclusions or prerequisites.

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