Skip to main content
Glama

review_diff

Read-only

Get a second-opinion code review of your diff using a local model. Provide diff text or a git range to receive structured findings with severity and suggestions.

Instructions

Second-opinion code review of a diff by a LOCAL model; returns structured findings.

Give either diff text, or git_range and let the server run git diff in cwd (defaults: cwd = current dir, range = HEAD i.e. all uncommitted changes). Examples: git_range="--staged", git_range="main...HEAD". focus narrows the review ("concurrency", "error handling"). Findings carry file, line, severity (critical/major/minor/nit), summary and suggestion.

Use it as a first pass before or alongside your own review, then verify each finding against the code — it is a cheap second opinion, not a verdict.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
diffNo
focusNo
thinkNo
git_rangeNo
timeout_sNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNo
notesNo
secondsNo
summaryYesTwo or three sentences on overall quality and risk
verdictYes
findingsYes
diff_charsNo
output_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false, so the description must carry behavioral context. It discloses that the server may run `git diff` in cwd, that the model is local, that findings are structured with severity levels, and that the output is not authoritative. This is exactly the kind of context an agent needs.

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 compact but information-dense, front-loading the purpose, then parameter semantics, then usage caveats. Every sentence contributes, and the examples are positioned where they are most useful.

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 output schema and read-only annotation, the description is complete: an agent knows how to supply input, what defaults apply, what results look like, and how much to trust them. The only undeclared parameters are clearly optional and self-explanatory.

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?

With 0% schema description coverage, the description compensates well: it explains `diff` vs `git_range`, provides `git_range` examples (`--staged`, `main...HEAD`), documents the `cwd` default, and defines `focus`. However, `think` and `timeout_s` are not explained, so it does not fully cover all six parameters.

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 states a specific verb and resource: 'Second-opinion code review of a diff by a LOCAL model; returns structured findings.' This clearly differentiates it from sibling tools like search_code, summarize, and index_codebase. It also names the output format, leaving no ambiguity about what the tool does.

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?

It gives explicit usage context: use as a first pass before or alongside your own review, verify findings against the code, and treat it as 'a cheap second opinion, not a verdict.' It does not explicitly name sibling alternatives or state when not to use it, which keeps it from a 5.

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