Skip to main content
Glama

get_refactor_candidates

Identify complex functions called from multiple files as candidates for extraction into shared modules to improve code maintainability.

Instructions

Find functions with high complexity called from many files — candidates for extraction to shared modules

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_cyclomaticNoMin cyclomatic complexity (default: 5)
min_callersNoMin distinct caller files (default: 2)
limitNoMax results (default: 20)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tool finds candidates but does not disclose behavioral traits such as whether it performs read-only analysis, requires specific permissions, has rate limits, or what the output format looks like. For a tool with no annotations, this leaves significant gaps in understanding its operation.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part earns its place by specifying what is found and why, making it easy to scan and understand quickly.

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

Completeness3/5

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

Given no annotations and no output schema, the description is adequate for a read-like analysis tool but incomplete. It covers the purpose well but lacks details on behavioral aspects and output, which are important for a tool with parameters and no structured output documentation.

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%, with clear descriptions for min_cyclomatic, min_callers, and limit. The description adds no additional parameter semantics beyond what the schema provides, such as explaining how complexity and caller thresholds interact. Baseline 3 is appropriate as the schema does the heavy lifting.

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 verb 'Find' and the resource 'functions with high complexity called from many files', specifying they are 'candidates for extraction to shared modules'. It distinguishes from siblings like get_complexity_report or get_call_graph by focusing on refactoring candidates rather than general complexity or call data.

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 implies usage for identifying refactoring opportunities, but does not explicitly state when to use this tool versus alternatives like plan_refactoring or extract_function. No exclusions or prerequisites are mentioned, leaving usage context inferred rather than clearly defined.

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/nikolai-vysotskyi/trace-mcp'

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