Skip to main content
Glama

inline_variable

Inline a local variable by replacing all its usages with the initializer expression. Apply the returned text edits to delete the declaration and substitute the variable.

Instructions

Inline a local variable by replacing all usages with its initializer expression.

Returns the text edits needed to inline the variable. The caller should apply these edits to perform the inlining.

USAGE: Position cursor on variable declaration or usage OUTPUT: Edits to delete declaration and replace usages with initializer

IMPORTANT: Uses ZERO-BASED coordinates. SAFETY: Will refuse if variable is modified after initialization.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to source file
lineYesZero-based line number of variable declaration or usage
columnYesZero-based column number
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses that the tool returns text edits (not applied automatically), the safety condition, and zero-based coordinates. Could mention if it is a read-only operation (it modifies code, so not read-only, but that is implied).

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 well-structured: purpose, return value, usage, output, important notes, safety, prerequisite. Each sentence adds value with no redundancy.

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

Completeness4/5

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

Given no output schema, the description explains the return type (text edits) and how to use them ('caller should apply'). It covers prerequisites and safety. Lacks details on edit format, but sufficient for a refactoring tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with basic descriptions. The tool description adds extra context: coordinates are zero-based and should point to variable declaration or usage. This goes beyond the schema's 'Path to source file' and 'Zero-based line number'.

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 'Inline a local variable by replacing all usages with its initializer expression.', which is a specific verb+resource. It distinguishes from siblings like 'extract_variable' (opposite) and 'inline_method' (different resource).

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?

Explicitly states prerequisites: 'Requires load_project to be called first.' and usage: 'Position cursor on variable declaration or usage.' Also mentions safety condition: 'Will refuse if variable is modified after initialization.' Does not explicitly mention when not to use, but provides clear context.

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/pzalutski-pixel/javalens-mcp'

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