Skip to main content
Glama

Edit File

edit
Destructive

Replace exact text in a workspace file with new content and return a unified diff. Verify replacement counts for precise edits.

Instructions

Apply a targeted exact text replacement inside a workspace text file. Returns a unified diff.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to workspace root.
new_textYesReplacement text.
old_textYesExact text to replace. Must match once unless replace_all=true.
replace_allNoReplace all occurrences. Default: false.
workspace_idNoWorkspace id from open_workspace. Omit to use default workspace.
expected_replacementsNoFail if actual replacement count differs.
Behavior4/5

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

Annotations already indicate a destructive, non-read-only operation, and the description is consistent with that. It adds useful behavioral detail by emphasizing exact replacement and by disclosing the unified-diff return value.

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?

A single, front-loaded sentence that states the core action, the target scope, and the return value. Every element earns its place and there is no filler.

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 fully documented schema, the annotations, and the description's disclosure of the diff return value, the tool is sufficiently specified for correct invocation. The main missing piece is routing guidance relative to apply_patch, already penalized under usage guidelines.

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 description coverage is 100%, so the parameters are already well documented. The description reinforces the exact-replacement nature of old_text/new_text but does not add meaning beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Apply a targeted exact text replacement inside a workspace text file') and also states the return format. It is clear, though it does not explicitly contrast itself with sibling tools like apply_patch or write.

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

Usage Guidelines2/5

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

The description gives no direct guidance on when to use this tool versus apply_patch or write, nor does it mention exclusions. The word 'targeted' implies surgical edits, but the agent must infer routing to this tool from 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/Nippori709/AgentDock'

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