Skip to main content
Glama
achatainga

mcp-code-context

by achatainga

write_file_surgical

Replace a code symbol in a file. Preview changes in a dry-run phase, then apply with a confirmation token.

Instructions

Replace a symbol with new code. Phase 1 (dry-run): returns diff + token. Phase 2: confirm with token to apply.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to file
projectRootYesProject root (REQUIRED)
symbolNameYesSymbol to replace
newContentNoNew code (Phase 1 only ΓÇö omit in Phase 2, server uses stored content)
classNameNoClass name (optional, for scoping)
confirmNoSet true to apply a pending operation (Phase 2)
confirmationTokenNoToken from Phase 1 dry-run (Phase 2 only)
diffFormatNoDiff verbosity in Phase 1 output (default: unified). Use none to skip diff and save tokens.
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses the two-phase behavior, token requirement, and that newContent should be omitted in Phase 2. However, it does not mention side effects, error handling, or reversibility of modifications.

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 sentences with no wasted words. The first sentence gives the core purpose, and the second explains the phases. Front-loaded and efficient.

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 the complexity (8 parameters, two-phase workflow, no output schema), the description explains the essential workflow but does not detail return values, error states, or prerequisites like file existence. Still, it is largely complete for the intended use.

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%, but the description adds significant value by explaining how parameters relate to phases (e.g., newContent only used in Phase 1, confirm+confirmationToken for Phase 2). This contextualizes the parameters beyond their schema descriptions.

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 symbol with new code, and the two-phase process (dry-run then confirm) distinguishes it from sibling tools like insert_symbol, remove_symbol, and rename_symbol.

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 describes the two phases with instructions for each: Phase 1 returns diff+token, Phase 2 requires confirmation and token. While it doesn't name alternatives, the phase logic provides clear guidance.

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/achatainga/mcp-code-context'

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