Skip to main content
Glama
AlanNiew

code-review-mcp

by AlanNiew

analyze_file

Identify security vulnerabilities, code complexity problems, and style violations in a single file to help maintain high-quality code.

Instructions

分析单个文件的代码质量、复杂度和安全问题。

会运行所有适用的规则:

  • 安全规则(SEC001-SEC012):eval/exec、shell 注入、pickle、弱哈希、硬编码密钥、SSL 关闭等

  • 复杂度规则(COMPLEX001-005):函数长度、圈复杂度、认知复杂度、参数个数、嵌套深度

  • 风格规则(STYLE001-004):行长、TODO、末尾空白、调试残留

Args: file_path: 要分析的文件路径(相对于项目根目录或绝对路径)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
Behavior4/5

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

Without annotations, the description carries full burden. It details the specific rule categories (SEC001-012, COMPLEX001-005, STYLE001-004), giving transparent insight into what checks are performed. It does not disclose side effects but the tool is read-only by nature.

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?

The description is structured with an overview, rule categories list, and an Args section. While not extremely concise, every sentence adds information. It is well-organized and front-loaded with the core purpose.

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?

Despite detailed rule listings, the description lacks information about return values or error handling (e.g., file not found). With no output schema, the agent must guess the response format. Some behavioral gaps remain.

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 0%, so description compensates by explaining file_path meaning: relative to project root or absolute path. This adds significant value beyond the schema, which only provides type and title.

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 clearly states it analyzes code quality, complexity, and security for a single file. It lists specific rule categories, and the sibling tools (check_project, list_rules, review_diff) provide context that this is file-level analysis, distinguishing it from project-level or diff-focused tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for single-file analysis but does not explicitly state when to use it versus alternatives like check_project or review_diff. No when-not-to-use guidance or prerequisites are provided.

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/AlanNiew/code-review-mcp'

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