Skip to main content
Glama

refactor

Analyzes code structure to provide refactoring suggestions, step-by-step guidance, and risk assessment, supporting goals like readability, complexity reduction, or performance improvement.

Instructions

当用户需要重构代码、改善代码结构时使用。分析代码结构,提供重构建议、重构步骤和风险评估

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo要重构的代码
goalNo重构目标:improve_readability(可读性)、reduce_complexity(复杂度)、performance(性能)。可选
Behavior3/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. It states the tool 'analyzes code structure, provides refactoring suggestions, steps, and risk assessment', but does not clarify if it modifies code directly or is read-only, nor does it disclose any side effects or prerequisites.

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 extremely concise with two short sentences, front-loading the purpose. Every word contributes meaning, and there is no unnecessary fluff.

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

Completeness4/5

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

Given the lack of output schema, the description mentions the tool provides 'suggestions, steps, and risk assessment', which gives a reasonable idea of outputs. However, it could be more complete by detailing the output structure or clarifying that it does not modify code.

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 coverage is 100%: both 'code' and 'goal' have clear descriptions. The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

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 the tool's purpose: refactoring code and improving structure. It uses specific verb 'refactor' and resource 'code structure', and distinguishes from siblings like code_review or fix_bug by focusing on restructuring existing code.

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 explicitly says 'Use when the user needs to refactor code, improve code structure', providing clear context for when to use. However, it does not mention when not to use or compare with alternative tools, lacking explicit exclusions.

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/mybolide/mcp-probe-kit'

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