Skip to main content
Glama
AlanNiew

code-review-mcp

by AlanNiew

review_changes

Review git changes to produce an evidence pack for code review, showing modified files, risk signals, and new line hits.

Instructions

审查一个 git 变更,返回「审查证据包」:改了哪些文件、风险在哪、新增行命中了什么。

这是本服务器的旗舰工具。它只返回事实,不返回审查结论——每一条 findings/signal 都需要审查者回到源码确认后再决定是否成立、什么级别。

Args: scope: 审查范围。 - "working"(默认):所有未提交改动 = 未暂存 + 已暂存 + 未跟踪文件(含源码与配置) - "staged":只审已暂存(git add 过的) - "base":审 base...HEAD(git merge-base 三点差异),必须同时给 base base: 基线分支/提交,如 "main"、"origin/main"、commit sha;仅 scope="base" 时使用 directory: 仓库目录(也可以是仓库内子目录,此时只审该子目录下的变更), 默认当前工作目录

返回: - scope / range / base_commit / head_commit - stats:文件数、增删行、按状态分组、语言分布 - files[]:每个变更文件含 path、status、additions、deletions、language、 priority(high/medium/low)、signals、findings(只含新增行命中,按行号排序)、 function_deltas(Python 函数圈复杂度/长度前后对比) - signals[]:变更级信号(dependency_added / database_schema / ci_or_build / api_contract / test_change / secret_added / security_finding / large_change / config_change);只有 SEC005(硬编码密钥)记为 secret_added,其余安全命中记为 security_finding - focus[]:按风险排序的深审入口(形如 "path:line — 描述") - limits:skipped(被跳过的文件及原因)、truncated、notes

使用顺序:focus → priority=high 的文件 → signals → limits。 需要看调用方、类型定义、测试时直接读文件;不要只凭本工具输出下结论。 非 git 仓库会返回 {"error", "hint"},单文件场景请改用 analyze_file。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseNo
scopeNoworking
directoryNo.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations the description carries the full burden, and it does substantial work: it discloses that output is facts-only and not review verdicts, that every finding needs source confirmation, that limits include skipped/truncated files, that non-git repos return an error+hint, and it defines signal classification (SEC005 vs security_finding). The one gap is that it never explicitly states the tool is read-only and has no side effects on the repository.

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 organized into Args / Returns / usage-order blocks, so it is easy to scan. It is nonetheless long, and the Returns enumeration is dense; it earns most of its length because no output schema exists, but it could be slightly tighter.

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 3-param flagship tool with no annotations and no output schema, the description covers parameters, return structure, traversal order, error paths, and sibling routing. An agent has everything needed to call it correctly and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully and does: scope enumerates all three accepted values with precise meanings, base is documented with examples and gated to scope='base', and directory explains both the default (cwd) and the subdirectory-scoping behavior. This is more informative than the schema itself.

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 ('审查一个 git 变更') and names the concrete deliverable ('审查证据包'), then enumerates exactly what that pack contains. It also distinguishes itself from a sibling by routing single-file work to analyze_file: '单文件场景请改用 analyze_file'.

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?

Gives explicit defaults and selection conditions for each scope ('working' default = unstaged+staged+untracked, 'staged', 'base' requires base), plus an explicit alternative for the single-file case. It further specifies the recommended traversal order (focus → priority=high files → signals → limits) and the non-git-repo fallback.

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