Skip to main content
Glama

Edit file

edit_file
Destructive

Apply ordered exact-text edits to one file of an artifact you own or can edit (edit role) and fail atomically on ambiguous matches.

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": {
      "id": "<id>",
      "path": "<path>",
      "edits": "<edits>"
    },
    "name": "edit_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
pathYes
editsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), the description adds important behavior: edits are ordered, matches must be exact, ambiguous matches cause an atomic failure, and an edit role is required. It does not explain what happens to the rest of the file or how conflicts beyond ambiguity are handled, so it is strong but not complete.

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 entire definition is one dense, front-loaded sentence with no filler. The permission precondition and atomic-failure behavior are both stated efficiently.

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?

The annotations cover the destructive safety profile, and the description adds useful behavioral context about ordering, exact matching, and atomic failure. However, with zero schema description coverage, the description is incomplete on parameter semantics — id, path, and the all flag are completely undocumented anywhere — which is a meaningful gap for an agent trying to invoke it correctly.

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 parameter burden. It implies the edits array contains ordered find/replace operations, but never explains the required id or path parameters, the exact semantics of find/replace, or the optional all flag. This is a significant gap for a mutation tool with three required parameters.

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 states a specific verb and resource — applying ordered exact-text edits to one file — and scopes it to an artifact the caller owns or can edit with the edit role. This distinguishes it from sibling tools like write_files and read_file at a glance.

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?

It clearly specifies the precondition (ownership or edit role) and limits the operation to a single file, which helps an agent choose it over broader write tools. It does not explicitly name alternatives or state when not to use it, so it falls short of a 5.

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