Skip to main content
Glama

edit_file

Replace an exact string in a file within a granted root, saving the updated file to disk.

Instructions

Edit a file inside a granted root by replacing an exact string with a new string, then saving it to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the file to edit, inside a granted root.
new_strYesThe new text to insert in place of old_str.
old_strYesThe exact text to find and replace. Must match exactly, including whitespace.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries full burden. It discloses replacement and save behavior but omits failure modes (e.g., file not found, old_str not found), permissions, or idempotency. Adequate for basic understanding but incomplete for robust agent decision-making.

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?

Single sentence, front-loaded with action ('Edit a file'), no redundant words. Every word contributes meaning. Highly concise.

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?

Given the presence of an output schema and 100% schema coverage, the description is minimally complete. It covers the core operation but lacks context on prerequisites (file existence, root grant) and error handling, which would enhance completeness for a mutation tool.

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 100% with each parameter described. The description adds no extra meaning beyond the schema (e.g., 'inside a granted root' is repeated from path's schema description). Baseline 3 is appropriate as schema does the heavy lifting.

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 edits a file via exact string replacement and mentions the 'granted root' constraint. It is distinct from sibling tools like read_file (read-only) and search (content search), showing specific verb and resource.

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

Usage Guidelines3/5

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

The description does not explicitly state when to use this tool versus alternatives like read_file or search. It implies usage for file modification but lacks 'when not to use' or comparative context, though the sibling list provides some indirect differentiation.

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/Shahrukh19S/folio-mcp'

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