Skip to main content
Glama
Project Scope MCP Server

Project Scope MCP Server

refactor_inline_variable

Replaces all usages of a variable with its value and removes the declaration, simplifying code while preserving behavior.

Instructions

Inline a variable by replacing all usages with its value and removing the declaration.

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": {
      "path": "<path>",
      "filePath": "<filePath>",
      "variableName": "<variableName>",
      "line": "<line>"
    },
    "name": "refactor_inline_variable"
  }
}

Input Schema

NameRequiredDescriptionDefault
lineYesLine number of the variable declaration
pathYesRoot path of the repository
applyNoApply changes (default: false)
filePathYesPath to the file
variableNameYesName of the variable to inline

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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 that all usages are replaced and that the declaration is removed, which signals a broad mutation. However, it does not mention permissions, reversibility, conflict handling, or preview/apply behavior.

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 definition is a single tight sentence with no wasted wording. The core operation is front-loaded and immediately understandable.

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?

The tool is a refactoring mutation with five parameters and no annotations or output schema. The description covers the core effect, but it leaves gaps around usage guidance, safety, and preview/apply semantics. The rich schema helps, but the description should do more for a mutation tool.

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 all five parameters are already documented in the input schema. The description adds no parameter-specific meaning beyond the schema, such as how line and variableName interact or how apply affects execution. A baseline score of 3 is 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 states a specific refactoring verb and resource: inlining a variable. It also explains the mechanics, replacing all usages with the value and removing the declaration. It does not explicitly distinguish this from sibling refactors such as extract or rename, but the operation itself is clear.

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?

The description explains what the operation does, but gives no guidance on when to use it, when not to use it, or which sibling refactoring tool to choose instead. There are no prerequisites or conditions for safe use.

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