Skip to main content
Glama

Edit local text file

edit_file
Destructive

Replace exact text in a local file for focused edits that preserve the rest of the file.

Instructions

Replace exact text in a UTF-8 local file. Use for focused edits that preserve the rest of the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
newTextYes
oldTextYes
replaceAllNo
Behavior3/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, so the safety profile is clear. The description adds that edits are exact-text replacements (not regex) and UTF-8 encoded, which is useful. However, it fails to disclose what happens if oldText is not found, whether replaceAll is available, or any error/rollback behavior. For a destructive tool, more transparency would be warranted.

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?

The description is two sentences long, front-loaded with the primary action ('Replace exact text'), and contains no superfluous information. Every sentence earns its place.

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 tool has 4 parameters (3 required), a destructive annotation, and no output schema, the description is minimal. It omits key details such as replaceAll behavior, handling of path (absolute vs relative), character encoding beyond the initial mention, error cases, and required permissions. This leaves an agent with incomplete information to use the tool reliably.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the burden of explaining parameters. It implies that oldText is the exact string to find and newText is the replacement, but it does not describe the path parameter or the replaceAll boolean. The description adds only minimal semantic value over the schema, leaving three out of four parameters without explanation.

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 'Replace exact text in a UTF-8 local file', specifying the verb (replace), resource (text in a local file), and encoding. It further distinguishes from siblings like write_file by noting 'focused edits that preserve the rest of the file', making the purpose unambiguous.

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 advises 'Use for focused edits that preserve the rest of the file', giving clear context for when this tool is appropriate. However, it does not mention when not to use it (e.g., for larger rewrites prefer write_file) or name alternative siblings, which would strengthen guidance further.

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/yungsuk53-pixel/unlimited-agent'

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