Skip to main content
Glama

Pre Check Code

pre_check_code

Scan code for risky patterns before making changes, using the current action and file path to identify potential errors and prevent debugging issues.

Instructions

主动预防:检查代码中可能的风险模式

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo要检查的代码字符串
actionNo正在尝试的操作描述(如 "用 try-catch 包裹")
filepathNo要检查的文件路径

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only says 'check' and does not state whether the tool is read-only, whether it has side effects, whether it requires permissions, or what it returns on failure. The read-only nature is implied but never explicit.

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 one short, front-loaded phrase with no filler or redundant content. It communicates the core intent immediately. However, its extreme brevity sacrifices useful detail, keeping it from a 5.

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

Completeness2/5

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

Even with an output schema and 100% parameter coverage, the description leaves out what risk patterns are targeted, how 'action' and 'filepath' influence the check, and when this tool should be invoked instead of check_syntax or other siblings. For a proactive pre-check tool, this is a notable 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%, so the parameters are already documented in the schema. The description itself adds no extra meaning to 'action' or 'filepath' beyond their schema descriptions, but this is acceptable given the full coverage. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: checking code for risk patterns. It is distinguishable from siblings like check_syntax (syntax checking) and search_code (searching), though it does not explicitly name those siblings. The purpose is clear but somewhat broad.

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

Usage Guidelines2/5

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

The phrase '主动预防' (proactive prevention) implies this tool is for pre-checking code before an operation, but no explicit when-to-use or when-not-to-use guidance is provided. It does not name alternatives or exclusions, so an agent must infer usage context.

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