Edit file
edit_fileExact string replace in a file (fails if old_string is not unique)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| new_string | Yes | ||
| old_string | Yes | ||
| project_id | No | Project id (or use session from use_project) |
edit_fileExact string replace in a file (fails if old_string is not unique)
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| new_string | Yes | ||
| old_string | Yes | ||
| project_id | No | Project id (or use session from use_project) |
Changes observed during successful MCP inspections.
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true and readOnlyHint=false, so the agent knows this mutates data. The description adds real value by disclosing the uniqueness precondition and failure mode, which is not in the annotations or schema. It stops short of saying the file must already exist, whether the write is atomic, or what happens with an empty new_string.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One sentence, front-loaded with the core behavior, and the failure condition parenthesized rather than buried. Nothing is wasted, though the extreme brevity leaves little room for the operational context an agent needs.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive mutation with 4 parameters, 25% schema coverage and no output schema, the description should do more. It omits whether the file must exist, whether an empty new_string deletes text, whether multiple occurrences could be handled another way, and what the call returns on success.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 25%, with just project_id documented, so the description needs to compensate. It does explain the critical constraint on old_string (must be unique or the call fails), but says nothing about path semantics or what an empty new_string means.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — 'exact string replace in a file' — which tells an agent precisely what the operation does. It does not explicitly contrast with write_file or bash, but the 'exact string replace' framing is distinctive enough that differentiation is largely implicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to prefer this over write_file, bash, or rename_file. The only implied rule is the uniqueness failure condition, which is a constraint rather than a routing guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Add one secure layer between your agents and this server.