Skip to main content
Glama

Review Diff

review_diff
Read-onlyIdempotent

Risk-scan a unified diff the way a senior reviewer triages a PR. FREE.

Flags added lines matching known risk patterns (injection sinks, disabled TLS, downloads piped into a shell, credential-store reads, broad deletes, persistence, bare excepts, debug prints, TODOs, N+1 hints, leaked secrets) with the new-file line number and a severity (1 low - 4 high). Typical input {"diff": ""} returns {"added_lines": N, "risk_score": 0-100 (100 = no risky pattern found; lower = riskier), "verdict": "...", "secrets": [...], "findings": [{"line": N, "severity": 1-4, "issue": "...", "code": "..."}], "note": "..."}.

Use on a unified diff, when only the change matters. Not for whole-file analysis (complexity_report, ai_code_smell_scan). Errors: on invalid, missing, or malformed input this tool never raises a protocol error; it returns {"error": ""}. Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "diff": "<diff>"
    },
    "name": "review_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
diffYesA unified diff exactly as produced by `git diff`, text with @@ hunk headers and +/- line prefixes. Only added (+) lines are scanned.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / diff / description
      Previous value: -"A unified diff exactly as produced by `git diff` — text with\n@@ hunk headers and +/- line prefixes. Only added (+) lines are\nscanned."New value: +"A unified diff exactly as produced by `git diff`, text with\n@@ hunk headers and +/- line prefixes. Only added (+) lines are\nscanned."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world, yet the description adds behavior genuinely beyond them: an error contract (never raises a protocol error, returns an {"error": ...} body), a retry guarantee, the exact pattern classes scanned, and the counterintuitive risk_score direction (100 = clean). The severity scale 1-4 and the flagged-line semantics are disclosed up front.

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 action, then patterns, then usage/exclusions, then errors — a sensible order. Minor waste in the vague simile "the way a senior reviewer triages a PR" and the bare marketing token "FREE.", plus a full return-value dump that duplicates the output schema.

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 one-parameter scanning tool, everything an agent needs is present: accepted input format, what is scanned, severity and score semantics, error and retry behavior, and sibling disambiguation. Since an output schema exists, the inline response example is redundant but harmless rather than a completeness gap.

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 the single parameter's description already explains git-diff format, @@ hunk headers, +/- prefixes and that only added lines are scanned. The description's "typical input" JSON restates this without adding syntax or edge-case meaning, so the baseline of 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?

The description states a specific verb and resource ("Risk-scan a unified diff") and immediately scopes it to change-only analysis, naming the siblings it is not for (complexity_report, ai_code_smell_scan for whole-file analysis). An agent can distinguish this from its six siblings 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?

It gives an explicit inclusion rule ("Use on a unified diff, when only the change matters") and an explicit exclusion routing agents to whole-file alternatives by name. That is the when/when-not/alternative triad in two sentences.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.