Skip to main content
Glama

review_patch

Review a unified git diff against Zero-Framework-Tolerance rules, scan changed files for violations on newly introduced lines, and return a PASS/REVIEW/FAIL verdict.

Instructions

Review a unified diff (git diff / gh pr diff output) against the Zero-Framework-Tolerance rules. Every changed code file is scanned with the full engine union (CodebaseCSI, constitution prose rules, Python AST, tree-sitter xast) and findings are attributed to the lines the change introduces; pre-existing debt in touched files is counted separately and never fails the gate. Supply files (path -> full new-version content) for full-fidelity AST analysis; without it, added lines are scanned as fragments. Returns JSON: verdict (FAIL/REVIEW/PASS), per-file findings with new-file line numbers, totals, and the engines that ran. Deterministic and offline: fetch the diff yourself (e.g. gh pr diff) and post reviews yourself. A PASS gates nothing but markers - gates G1-G5 remain the reviewer's responsibility.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffYesUnified diff text, e.g. from `git diff` or `gh pr diff`.
filesNoOptional map of changed-file path (new version) to its complete file content, enabling full-file AST analysis instead of fragment scanning.
excludeNoOptional fnmatch globs for paths the gate must not judge: detector rule definitions and test fixture corpora contain hunted patterns as data.
test_globsNoProject-specific test path globs added to the built-in conventions (tests/*, test_*.py, *.spec.ts, *_test.go, ...).
require_testsNoC-03 enforcement: flag production-logic changes when the diff touches no test files. 'warn' surfaces them for judgement, 'fail' gates the verdict. Default off; the reviewing agent should normally pass 'warn'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.6.0

TDQS

A4.6/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does so: deterministic and offline, no fetching or posting side effects, pre-existing debt counted separately and never fails the gate, and an explicit caveat that a PASS gates nothing but markers while G1-G5 remain the reviewer's responsibility. This is unusually complete behavioral context for a mutation-free analysis tool.

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 purpose and verdict semantics, then parameters, then caveats; every sentence carries information (engines, attribution rules, offline contract). It is dense and longer than average, but the length is justified by the tool's complexity rather than padding.

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?

With no output schema, the description compensates by enumerating the return payload: verdict (FAIL/REVIEW/PASS), per-file findings with new-file line numbers, totals, and engines that ran. Combined with the offline/gating caveats, an agent has everything needed to invoke and interpret the tool.

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?

Schema coverage is already 100%, so baseline is 3, but the description adds rationale beyond the schema: `files` as path -> full new-version content for AST analysis, `exclude` to keep detector definitions and fixture corpora out of judgement, and a recommendation on require_tests. Only `test_globs` gets no extra prose beyond the schema.

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+resource ('Review a unified diff') and immediately scopes the domain: Zero-Framework-Tolerance rules, engine union, line-level attribution. It is clearly distinguishable from siblings like scan_code_for_violations, which does not operate on a diff.

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?

Gives concrete operational conditions: supply `files` for full-fidelity AST analysis vs. fragment scanning without it, normally pass require_tests='warn', and fetch the diff / post reviews yourself. It does not explicitly compare against the sibling tools (e.g., when to prefer scan_code_for_violations over reviewing a diff), so it falls just short of a 5.

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