Skip to main content
Glama
JSungMin

vs-token-safer

replace_symbol_body

Replace a function, class, or method body by specifying its name. Uses language server index to avoid reading the whole file. Preview by default; set apply=true to write changes in one call.

Instructions

Change a whole function/class/method by NAMING it — USE INSTEAD OF Read-the-file + Edit (the outline gives the span, so you skip the whole-file Read and exact-match line-counting). PREVIEW by default; apply=true writes in ONE call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesNew full text (signature + body).
lineNo0-based line; disambiguate same-named (optional).
pathNoFile holding the symbol (else resolved via the index).
applyNoWrite to disk (default false = preview).
symbolYesDeclaration name to replace.
backendNo
maxResultsNo
projectPathNo
Behavior4/5

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

With no annotations, the description discloses key behaviors: preview by default, apply=true writes in one call. Lacks details on error handling or side effects but covers the main behavioral traits.

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?

Two efficient sentences that front-load purpose and usage, with no wasted words.

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?

For a complex replace operation, description covers main behavior but lacks return value info and error handling. Undocumented params not addressed.

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%; description adds meaning for key params (symbol, body, apply) but doesn't explain projectPath, backend, maxResults. Adequate for required params but incomplete overall.

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 it changes functions/classes/methods by naming them, and distinguishes itself from sibling tools like read_symbol and insert_symbol by positioning as a replacement for read-file + edit.

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

Usage Guidelines5/5

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

Explicitly says 'USE INSTEAD OF Read-the-file + Edit' and explains preview vs apply behavior, giving clear context on when and how to use it.

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