Skip to main content
Glama

refactor_suggestions

Analyze code in a specified programming language and suggest refactoring improvements for readability, performance, or maintainability.

Instructions

Suggest code refactoring improvements

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "language": "<language>"
    },
    "name": "refactor_suggestions"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesCode to refactor
focusNoRefactoring focus area
languageYesProgramming language

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden. 'Suggest' hints at a non-mutating advisory operation, but it says nothing about whether the code is stored, how many suggestions are returned, how deep the analysis goes, or any limits on input size.

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

Conciseness4/5

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

It is a single front-loaded sentence with zero filler, though its brevity borders on under-specification rather than efficient conciseness.

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?

For a tool with three parameters and no output schema, the definition should clarify the shape of the returned suggestions or the scope of analysis. It leaves both entirely unaddressed.

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%, including an enum for focus, so the schema already documents every parameter. The description adds no meaning beyond it, which makes the baseline 3 appropriate.

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 gives a specific verb ('Suggest') and resource ('code refactoring improvements'), so the agent knows it produces suggestions rather than applying edits. However, it does not distinguish itself from the sibling analyze_code, which an agent could plausibly choose instead.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus analyze_code or generate_tests, and no stated prerequisites or exclusions. The agent must infer selection purely from the name and one-line purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.