Skip to main content
Glama

suggest_refactoring

Analyze code to suggest refactoring improvements for readability, performance, and maintainability using project-specific patterns for single or multiple files.

Instructions

Analyze code and suggest refactoring improvements with project-specific patterns (handles both single and multi-file)

WORKFLOW: Ideal for creating production-ready code, tests, and documentation TIP: Generate unlimited iterations locally, then review with Claude SAVES: Claude context for strategic decisions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
analysisDepthNoLevel of analysis detaildetailed
analysisTypeNoType of refactoring to focus oncomprehensive
codeNoThe code to analyze for refactoring (for single-file analysis)
contextNoOptional context for project-specific refactoring
filePathNoPath to single file to refactor
filesNoArray of specific file paths (for multi-file analysis)
focusAreasNoAreas to focus on for refactoring
languageNoProgramming languagejavascript
maxDepthNoMaximum directory depth for multi-file discovery (1-5)
projectPathNoPath to project root (for multi-file refactoring analysis)
Behavior2/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 of behavioral disclosure. It mentions that the tool 'handles both single and multi-file' analysis and includes workflow tips, but fails to describe critical behavioral traits such as whether this is a read-only analysis or if it modifies code, what permissions or authentication might be needed, rate limits, error handling, or what the output looks like. For a complex 10-parameter tool with no annotations, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with sections like 'WORKFLOW', 'TIP', and 'SAVES', but it's not front-loaded with core functionality—the first sentence is clear, but subsequent sections add tangential advice rather than essential tool behavior. Sentences like 'SAVES: Claude context for strategic decisions' are vague and don't earn their place in a tool description, making it feel cluttered and inefficient for an AI agent.

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?

Given the tool's complexity (10 parameters, no annotations, no output schema), the description is incomplete. It lacks information on behavioral traits, output format, error conditions, and how it differs from sibling tools. While it covers purpose and some usage context, it doesn't provide enough detail for an AI agent to confidently select and invoke this tool in a production environment, especially compared to related siblings like 'analyze_code_quality'.

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 schema already documents all 10 parameters thoroughly with descriptions, defaults, and enums. The description adds no specific parameter information beyond implying support for 'single and multi-file' analysis, which loosely relates to parameters like 'code', 'filePath', 'files', and 'projectPath'. This meets the baseline of 3 since the schema does the heavy lifting, but the description doesn't add meaningful semantic value beyond what's in the structured data.

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 clearly states the tool's purpose: 'Analyze code and suggest refactoring improvements with project-specific patterns (handles both single and multi-file)'. It specifies the verb ('analyze and suggest'), resource ('code'), and scope ('single and multi-file'). However, it doesn't explicitly differentiate from siblings like 'analyze_code_quality' or 'analyze_single_file', which appear related but have different focuses.

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 includes a 'WORKFLOW' section that implies usage context ('Ideal for creating production-ready code, tests, and documentation') and a 'TIP' with practical advice ('Generate unlimited iterations locally, then review with Claude'). However, it lacks explicit guidance on when to use this tool versus alternatives like 'analyze_code_quality' or 'analyze_single_file', and doesn't mention exclusions or prerequisites for use.

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/houtini-ai/houtini-lm'

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