Skip to main content
Glama
xlian-fe

MCP Code Review Server

by xlian-fe

generate_code_review

Generate detailed code review reports by comparing branches or commits, producing HTML documents with author filtering and AI-generated summaries.

Instructions

生成代码Review报告。支持两种模式:

模式一:分支对比模式(需要 target_branch) 对比开发分支与目标分支的代码差异。

模式二:Commit Hash 模式(需要 from_commit,不需要 target_branch) 指定一个起始 commit hash,获取该 commit 之后到开发分支的所有变更并生成报告。

使用场景:

  • 迭代结束后,需要在小组内分享代码改动

  • 代码评审会议前准备Review材料

  • 记录本次迭代的技术细节

使用方式: 直接调用此工具即可。如果不传 file_descriptions,系统会返回变更文件列表,你需要根据每个文件的完整路径理解其功能,生成简短的中文功能描述(50字以内),然后再次调用此工具传入 file_descriptions 参数。

参数说明:

  • repo_path: Git仓库的本地路径

  • dev_branch: 开发分支名称(你的工作分支)

  • target_branch: 目标对比分支(通常是main/master/develop),使用 from_commit 模式时可不传

  • from_commit: 起始 commit hash,指定后无需 target_branch

  • author: 你的Git用户名或邮箱(用于筛选你的提交,可选)

  • output_path: HTML报告输出路径(可选,默认生成在仓库根目录)

  • file_descriptions: 文件功能描述列表(可选,不传则返回文件列表供你生成描述)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authorNoGit提交作者名称或邮箱(用于筛选特定作者的提交,可选)
repo_pathYesGit仓库的本地路径
ai_summaryNoAI生成的代码审查总结(可选)。当传入 file_descriptions 后,系统会返回所有文件的diff内容,你需要分析这些diff并生成符合Code Review规范的技术总结,包括:技术思路、疑难解决、特殊说明、关键改动细节等。生成后通过此参数传入,系统会将其展示在报告中。
dev_branchYes开发分支名称
from_commitNo起始 commit hash。指定后,将获取该 commit 之后到 dev_branch 的所有变更,无需指定 target_branch。
output_pathNoHTML报告输出路径(可选,默认在仓库根目录生成)
target_branchNo目标对比分支(如main、master、develop)。使用 from_commit 模式时可不传。
file_descriptionsNo文件功能描述列表(可选),每个元素包含文件路径和对应的功能描述。如果不传,系统会返回变更文件列表,你需要根据每个文件的完整路径理解其功能,生成简短的中文描述(50字以内),然后再次调用此工具传入。
Behavior4/5

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

No annotations are provided, so the description carries the full burden of disclosing behavior. It clearly explains the interactive two-step process (returning changed files when file_descriptions is omitted, then requiring a second call with descriptions) and the mode-selection rules. This goes beyond a simple purpose statement, though it does not cover every potential edge case.

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 well-structured with clear headings for modes, use cases, usage, and parameters. While lengthy, every section provides necessary context for a complex tool, and the purpose is front-loaded. No redundant or filler sentences are present.

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 tool's complexity (two modes, interactive workflow, 8 parameters, no output schema), the description is remarkably complete. It covers mode selection, the file_descriptions round-trip, output path behavior, and usage scenarios, giving an agent everything needed to invoke the tool correctly.

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?

The description includes a dedicated parameter section that explains the role of each parameter and adds semantic context beyond the schema. It clarifies the mutually exclusive relationship between target_branch and from_commit, which is not fully evident from the schema alone. With 100% schema coverage, the baseline is 3, but the added mode logic raises it to 4.

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 starts with '生成代码Review报告', a specific verb and resource that clearly states the tool's purpose. It further distinguishes itself from sibling tools like get_changed_files and list_branch_authors by focusing on report generation, not just listing files or authors.

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?

The description provides explicit usage scenarios (end-of-iteration sharing, code review preparation, technical record keeping) and explains the two operation modes. However, it does not explicitly mention when not to use this tool or direct users to alternative sibling tools, stopping short of a perfect score.

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

Install Server

Other Tools

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/xlian-fe/mcp-xl-code-review'

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