Skip to main content
Glama

get_incremental_diff_context

Generate hyper-compact git diff context for PRs, showing changed symbols and dependents. Achieves 98%+ token savings for code review and debugging.

Instructions

Calculates hyper-compact PR git diff context (changed symbols + downstream blast radius dependents) for 98%+ token savings during code review and debugging.

Behavior:

  • Read-only: Inspects git diff and local AST; does not stage, commit, or revert any git changes.

  • Idempotent: Deterministic for the same git working tree status.

  • 100% Offline: Local git CLI and AST processing.

Usage Guidelines:

  • When to use: Provide focused context during code review, PR description generation, or bug hunting for pending changes with 98%+ token reduction.

  • Sibling Routing: For full repository context, use 'get_project_context_tree'. For single-symbol impact analysis, use 'analyze_change_impact'.

Returns: Structured Markdown diff context with changed symbol signatures, diff hunks, and caller references.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_refNoGit revision or branch to diff against (default: 'HEAD~1').HEAD~1
project_rootNoGit repository root path (default: current directory)..

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / base_ref / description
      Added value: +"Git revision or branch to diff against (default: 'HEAD~1')."
    • addedInput schema / properties / project_root / description
      Added value: +"Git repository root path (default: current directory)."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden — and it does: it discloses read-only semantics ('does not stage, commit, or revert'), idempotency/determinism, and full offline/local-CLI execution. It also sketches the return shape, which is unusually thorough for a tool with zero annotation coverage.

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?

Front-loaded with the core purpose and cleanly sectioned into Behavior / Usage / Returns, so it scans well. Minor deduction because the '98%+ token savings' claim is repeated in two sections and reads as promotional padding rather than added 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?

For a two-parameter read-only diff tool, the description covers purpose, routing, behavioral guarantees, and return format. Since an output schema already exists, the inline 'Returns' note is surplus but harmless, and nothing an agent needs to invoke this correctly is missing.

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% and both parameters (base_ref, project_root) carry their own defaults and descriptions, so the schema does the heavy lifting. The description adds no syntax, format, or edge-case guidance for base_ref beyond what the schema already states, so the baseline 3 applies.

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?

States a specific verb and resource — 'Calculates hyper-compact PR git diff context' — and immediately narrows the output to 'changed symbols + downstream blast radius dependents.' The sibling-routing line makes its boundary against 'get_project_context_tree' and 'analyze_change_impact' explicit, so an agent can distinguish it without opening any schema.

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

Usage Guidelines5/5

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

Provides an explicit 'When to use' condition (code review, PR description generation, bug hunting on pending changes) and names two concrete alternatives with the condition that selects each. Nothing about tool selection is left to inference.

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