Code Refactor
Server Details
Refactor legacy code into modern, idiomatic code without changing its behavior.
Glama couldn't complete the latest health check. If this server requires authentication, missing or expired test credentials may be the cause. A test profile lets Glama authenticate for health checks and discover tools; it is separate from your personal connections.
If you are the author, claim ownership, then add or update a test profile under Admin → Test Profile.
- Status
- Unhealthy
- Last Tested
- Transport
- Streamable HTTP · MCP 2025-06-18
- URL
- Repository
- zhouhengchang/code-refactor
- GitHub Stars
- 0
- Server Listing
- code-refactor
TDQS
Scored across 2 tools
check_status and refactor_code have clearly distinct purposes: one verifies service/model availability, the other performs the actual refactoring action. There is no overlap, and the status tool is explicitly framed as a prerequisite, making selection unambiguous.
Both tool names follow the same snake_case verb_noun pattern (check_status, refactor_code). The convention is consistent and predictable.
The server has only 2 tools, one of which is a simple health check. While the set is focused, the surface feels thin for a code-refactoring service and falls below the typical 3-15 tool sweet spot.
The core action (refactor_code) and a service readiness check (check_status) cover the basic workflow. Minor gaps remain, such as no preview/dry-run, batch processing, or configuration options for refactoring style/target language.
Available Tools
2 toolscheck_status检查服务状态AInspect
检查重构服务与云端模型(DeepSeek)是否可用,返回后端类型、模型名与密钥校验状态。建议在调用 refactor_code 前先调用本工具。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It usefully discloses what is inspected and reported (backend type, model name, key validation), but is silent on whether the check performs a live network/API call, possible latency or failure modes, and how an unavailable result should be interpreted.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, zero waste: the first front-loads what is checked and returned, the second front-loads the calling guideline. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple, no-argument health-check with no output schema, the description compensates by naming the three returned fields and the availability signal. It stops short of describing error/unavailable states or how to act on them, which is the only remaining gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters (schema coverage 100%, empty object), so there is no parameter semantics to explain; the baseline of 4 applies. The description correctly adds no redundant parameter talk.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: checking availability of the refactoring service and the DeepSeek cloud model, plus the returned fields (backend type, model name, key validation status). It is unmistakably distinct from the sibling refactor_code, which performs the actual refactoring rather than checking readiness.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly routes the agent: 'suggest calling this tool before calling refactor_code.' The sibling is named and the condition that selects this tool (pre-flight precondition) is stated, leaving nothing to inference for a zero-parameter status check.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
refactor_code重构代码AInspect
把遗留代码重构为现代规范代码,行为保持不变。会做语义化重命名、补全类型标注、生成中文注释、优化结构。适用于 Python / JavaScript / TypeScript / Java / Go / Rust / C / C++。
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 待重构的原始代码全文。 | |
| task | Yes | 重构要求,自然语言描述。例如:把函数名与变量名改为有意义的命名,补充类型标注与中文注释,保持行为不变。 | |
| language | No | 代码语言,如 python / javascript / java / go。留空或 auto 表示自动识别。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and it does deliver real behavioral content: the behavior-preservation guarantee and the disclosure that it injects Chinese comments and type annotations into the code. However, it is silent on the things an agent most needs — whether refactored code is returned as text or written to files, whether changes are reversible, size/length limits, and any auth requirements. That is a meaningful gap for a mutation-style tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences, front-loaded with the core action and the behavior-preservation contract before the transformation list and language scope. No filler, no repetition of the title.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a code-transformation tool with zero annotations and no output schema, the definition covers input expectations well but leaves the return contract entirely unstated — the agent cannot tell whether it receives refactored source, a diff, or a file write. Adequate but with a clear, load-bearing gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3 and the schema already explains 'code', 'task' (with an example prompt), and 'language' (including the auto-detect convention). The description's language list loosely reinforces the 'language' parameter but adds no syntax, format, or constraint detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource (refactor legacy code into modern idiomatic code) plus the invariant contract ('行为保持不变') and the exact set of transformations performed. The supported-language list further bounds scope, so an agent knows precisely what this tool does without opening the schema. The only sibling, check_status, is unrelated, so no sibling differentiation is needed or possible.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Applicability is only implied through '适用于 Python / JavaScript / ...' — it tells the agent which inputs qualify but not when to prefer refactoring over, say, generating code fresh, nor any exclusions or prerequisites. With no comparable sibling there is no alternative to route to, but the description still never says when this tool is the right call.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
- First observed
check_status - First observed
refactor_code
Related MCP Connectors
Audit and repair any public GitHub repo. Free survey; paid source, unified diffs and a pull request.
Rewrites Claude-English into plain English, preserving meaning, code and structure.
Coding guidelines and best-practice guides for 130+ languages, frameworks, and tools.
Find retiring AI models and outdated API SDKs in your code, with dates, replacements and guides.
Related MCP Servers
- AlicenseAqualityDmaintenanceAnalyzes JavaScript/TypeScript projects for code modernization opportunities, checks browser compatibility via Can I Use, searches MDN documentation, and recommends modern Web API alternatives to reduce bundle size and improve performance.611 npm5MIT
- AlicenseAqualityAmaintenanceProvides software design guidance via MCP, including SOLID principles, design patterns, pattern scaffolding, and heuristic code-smell detection to help review and refactor code.445 npmMIT
- AlicenseAqualityCmaintenanceEnables LLMs to apply Martin Fowler's 71+ refactoring patterns to codebases through a pluggable, language-agnostic architecture. Supports previewing and applying refactorings, analyzing code smells, and inspecting code structure with safe-by-default operations.529 PyPI5MIT
- AlicenseAqualityCmaintenanceProvides AI-callable tools for modernizing legacy applications, including stack detection, API contract extraction, SQL to Flyway conversion, and migration effort estimation.4MIT
Glama MCP Gateway
Add one secure layer between your agents and this server.