Skip to main content
Glama
robertcprice

GLM-4.7 MCP Server

by robertcprice

glm_refactor

Refactor code with targeted instructions to improve structure and cleanup. Provide file path and working directory to receive refactored code and a clear explanation.

Instructions

Refactor code using GLM.

Use for: improving code structure, applying patterns, cleanup.

Args: file_path: Path to file to refactor instructions: Refactoring instructions working_directory: Project directory model: "haiku" or "sonnet"

Returns: Refactored code and explanation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNosonnet
file_pathYes
instructionsYes
working_directoryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations, the description must disclose behavioral traits itself. It only mentions the return value ('Refactored code and explanation') but does not state whether the tool modifies the file in place, requires special permissions, or behaves in a read-only manner. This ambiguity is a significant gap for a refactoring tool.

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 tightly structured with a clear purpose statement, 'Use for' list, 'Args' block, and 'Returns' line. Every sentence earns its place, with no filler or redundancy. It is concise and easy to scan.

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?

The description covers the high-level purpose, parameters, and return, but it omits critical context about side effects (e.g., does it write to the file?) and any constraints or prerequisites. Since there are no annotations and no detailed output schema guidance, this incompleteness leaves the agent guessing about the tool's operational behavior.

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?

The schema has no descriptions (0% coverage), so the description's 'Args' section is the sole source of parameter semantics. It provides one-line clarifications for each parameter (e.g., 'Path to file to refactor') and lists model choices, which adds some meaning beyond the bare property names. However, the explanations are shallow and mostly repeat the parameter names, so they are adequate but not rich.

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 opens with a specific verb+resource: 'Refactor code using GLM,' and immediately follows with concrete use cases ('improving code structure, applying patterns, cleanup'). This clearly distinguishes it from sibling tools like glm_ask, glm_summarize, and glm_implement, which have different purposes.

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 'Use for:' line explicitly states the target scenarios (improving structure, applying patterns, cleanup), giving the agent clear context for when to invoke this tool. However, it does not mention when not to use it or name alternative tools, so it stops short of full exclusion guidance.

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/robertcprice/glm-mcp-server'

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