Skip to main content
Glama

Edit file

edit_file
Destructive

Replace one exact piece of text in a file (it must appear exactly once).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>",
      "path": "<path>",
      "old_text": "<old_text>",
      "new_text": "<new_text>"
    },
    "name": "edit_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesA path inside the project, such as index.html or js/game.js.
new_textYes
old_textYesText to replace, copied exactly, unique in the file.
project_idYesThe project's id, from list_projects or create_project.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare a non-read-only, destructive operation, so the safety profile is covered. The description adds one genuinely useful precondition - the target text must appear exactly once - but does not say what happens when there are zero or multiple matches, whether the file is left untouched on failure, or whether the change is reversible.

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 with the action first and the hard constraint in parentheses - no filler, no repetition of the title or annotations.

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?

For a destructive four-parameter file mutation with no output schema, the definition covers the action and the uniqueness precondition but leaves the failure mode, atomicity, and the distinction from write_file unexplained. It is minimally sufficient to call correctly but thin for the risk involved.

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 75%, with path, old_text, and project_id documented in the schema. The description reinforces the exactness/uniqueness requirement for old_text but adds nothing about new_text or the relationship between old_text and new_text beyond the word 'Replace'. Baseline 3 applies when the schema carries most of the load.

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?

States a specific verb ('Replace') and resource ('one exact piece of text in a file'), which implicitly separates it from full-file overwrites like write_file. It never names a sibling or contrasts with rewriting the whole file, so differentiation is inferred rather than stated.

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?

Usage is only implied: the 'one exact piece of text' phrasing suggests a targeted edit rather than a full rewrite, but there is no explicit when-to-use, when-not-to-use, or pointer to an alternative for non-unique or large-scale edits.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources