Skip to main content
Glama
JSungMin

vs-token-safer

replace_symbol_body

Replace a declaration body by naming it, using language-server outline for precise span. Preview by default; apply writes.

Instructions

Replace a whole declaration (function/method/class body, signature included) by NAMING it — the language-server outline supplies the exact span, so you don't Read the file into context or count lines for an exact-match Edit. Default PREVIEW returns the affected file:line; apply=true writes. Token-cheap symbol-level editing instead of read-whole-file-then-Edit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesDeclaration name to replace (e.g. a function/class name).
bodyYesNew full text for the declaration (signature + body).
pathNoFile holding the symbol (pins the outline; else resolved via the index).
lineNo0-based line to disambiguate same-named symbols (optional).
applyNoWrite to disk (default false = preview only).
projectPathNo
backendNo
maxResultsNo
Behavior3/5

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

No annotations exist, so the description carries full burden. It discloses default preview mode (apply=false), that apply=true writes to disk, and that the language-server outline supplies the exact span. However, it does not mention error handling (e.g., symbol not found), side effects beyond disk write, or the exact return format beyond file:line. This is adequate but leaves gaps.

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?

The description is two sentences long, which is concise. However, the second sentence is somewhat dense, combining multiple ideas (default preview, apply flag, token-cheap advantage). It could be slightly restructured for readability, but overall it is appropriately sized and front-loaded.

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 complexity (8 parameters, 2 required), no output schema, and no annotations, the description is insufficiently complete. It does not explain what happens if the symbol is missing, the exact output format beyond file:line, or scenarios where disambiguation fails. The description covers the main idea but lacks crucial operational details for reliable use.

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 coverage is 63%, meaning some parameters lack descriptions. The description adds context for symbol, body, path, line, and apply (e.g., 'default false = preview only'), but does not describe projectPath, backend, or maxResults. It compensates partially but not fully for the undocumented parameters.

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 tool replaces a whole declaration by naming it, using the language-server outline to avoid reading the file. It distinguishes itself from siblings like rename and insert-by-symbol by focusing on replacing the entire body including signature, and from the edit tool by being token-cheap and symbol-level. The verb 'replace' and resource 'declaration' are specific.

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?

The description explicitly says to use when you want to replace a declaration by name without reading the file, and contrasts with reading then editing. It implies alternatives (edit tool) but does not exhaustively list when not to use or give explicit when-to-use scenarios. The guidance is clear but not fully comprehensive.

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/JSungMin/vs-token-safer'

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