Skip to main content
Glama

code_review

Read-onlyIdempotent

Analyzes code, Git diffs, or managed Plans to check delivery consistency across changed files, tests, APIs, and architecture evidence. Detects semantic issues without acting as a static scanner.

Instructions

当用户需要审查代码、真实 Git diff 或托管 Plan 的交付一致性时使用。MCP 可确定性收集 changed files、Plan 声明范围、产物、测试、公共契约、架构和 revision 证据;代码语义问题仍由 Agent 审查,不伪装成静态扫描器

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo要审查的代码。可以是代码片段、完整文件或 git diff 输出
focusNo审查重点:security(安全)、performance(性能)、quality(质量)、all(全部)。可选,默认 all
plan_idNo可选托管 Plan ID。提供后读取 Plan 状态并比较 declaredScope、产物、测试、架构证据和 revision
base_refNodiff_mode=range 时的基线 Git ref
head_refNodiff_mode=range 时的目标 Git ref
diff_modeNoGit diff 范围。auto 默认审查相对 HEAD 的 staged+unstaged 变更;working 仅未暂存;staged 仅已暂存;range 使用 base_ref/head_ref
file_pathNo要审查的文件路径(相对 project_root 或绝对路径)。未传 code 时从磁盘读取
project_rootNo项目根目录绝对路径。未传 code/file_path 时,可从该 Git 仓库自动收集真实 diff
max_diff_charsNo最大 diff 字符数,1000-500000,默认 120000。超出时明确标记 truncated

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed6 schema fields changedv4.0.0
    • addedInput schema / properties / base_ref
      Added value: +{
      +  "description": "diff_mode=range 时的基线 Git ref",
      +  "type": "string"
      +}
    • addedInput schema / properties / diff_mode
      Added value: +{
      +  "description": "Git diff 范围。auto 默认审查相对 HEAD 的 staged+unstaged 变更;working 仅未暂存;staged 仅已暂存;range 使用 base_ref/head_ref",
      +  "enum": [
      +    "auto",
      +    "working",
      +    "staged",
      +    "range"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / head_ref
      Added value: +{
      +  "description": "diff_mode=range 时的目标 Git ref",
      +  "type": "string"
      +}
    • addedInput schema / properties / max_diff_chars
      Added value: +{
      +  "description": "最大 diff 字符数,1000-500000,默认 120000。超出时明确标记 truncated",
      +  "type": "number"
      +}
    • addedInput schema / properties / plan_id
      Added value: +{
      +  "description": "可选托管 Plan ID。提供后读取 Plan 状态并比较 declaredScope、产物、测试、架构证据和 revision",
      +  "type": "string"
      +}
    • changedInput schema / properties / project_root / description
      Previous value: -"项目根目录绝对路径。配合 file_path 解析相对路径"New value: +"项目根目录绝对路径。未传 code/file_path 时,可从该 Git 仓库自动收集真实 diff"
  2. Changed2 schema fields changedv3.6.11
    • addedInput schema / properties / file_path
      Added value: +{
      +  "description": "要审查的文件路径(相对 project_root 或绝对路径)。未传 code 时从磁盘读取",
      +  "type": "string"
      +}
    • addedInput schema / properties / project_root
      Added value: +{
      +  "description": "项目根目录绝对路径。配合 file_path 解析相对路径",
      +  "type": "string"
      +}
  3. Changed3 schema fields changedv3.0.16
    • addedInput schema / additionalProperties
      Added value: +true
    • changedInput schema / properties / code / description
      Previous value: -"需要审查的代码"New value: +"要审查的代码。可以是代码片段、完整文件或 git diff 输出"
    • changedInput schema / properties / focus / description
      Previous value: -"审查重点:quality, security, performance, all(默认 all)"New value: +"审查重点:security(安全)、performance(性能)、quality(质量)、all(全部)。可选,默认 all"
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

注释已声明readOnlyHint和idempotentHint,描述在此基础上补充了'确定性收集 changed files、Plan声明范围、产物、测试、公共契约、架构和revision证据,代码语义问题由Agent审查',揭示了工具的行为边界和非侵入性,未与注释矛盾。

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?

描述仅两句话,第一句点明目的,第二句解释行为边界,无废话。结构紧凑,信息前置,非常高效。

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

工具较复杂(9参数,无输出模式),描述覆盖了适用场景和行为边界,但未说明输出格式或返回内容。缺少输出说明使得完整性不足,但Schema已完整描述参数,基本可用。

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描述覆盖率为100%,所有9个参数已在输入模式中详细说明。描述未添加任何参数相关的内容,因此按照规则基线3分。

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?

描述明确使用'当用户需要审查代码、真实 Git diff 或托管 Plan 的交付一致性时使用',具体指出了三种适用场景,动词'审查'配合资源'代码/diff/Plan'。进一步说明工具职责边界(收集证据,不伪装静态扫描器),与兄弟工具code_insight等自然区分。

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?

描述直接给出了使用条件(审查代码、diff、Plan一致性),提供了清晰的上下文。但未明确罗列何时不适合使用,也未提及兄弟工具作为替代,因此无法达到最高分。

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mybolide/mcp-probe-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server