Skip to main content
Glama

Edit files

edit_files
Destructive

Change several draft files in one go: exact find-and-replace edits, full rewrites (content), or deletes. All changes are saved together or none is (e.g. HTML, CSS and JS for one feature). Each find must match exactly once (or set all: true). Pass expected_revision (from read_page or list_pages) to refuse the change if someone edited the file meanwhile. Images and other binary files: use upload_asset.

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": {
      "site": "<site>",
      "changes": "<changes>"
    },
    "name": "edit_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteYesSite slug (e.g. "kopitiam-muar") or id
changesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses the key behavioral traits an agent cannot guess: the batch is atomic ('all changes are saved together or none is'), each find must match exactly once unless all is set, and expected_revision causes an optimistic-concurrency refusal if the file changed. That is exactly the kind of operational risk information a destructive write tool needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences, front-loaded with the modes, then the atomicity rule, then the concurrency guard, then the binary redirect. Nearly every clause earns its place; a slightly less compressed phrasing could improve scannability, but 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?

For a destructive multi-file mutation with no output schema, the description covers atomicity, revision conflict behavior, match semantics, and the binary-file carve-out. It does not mention limits (50 changes, 50 edits, 5MB content cap), though those are visible in the schema.

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

Parameters4/5

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

Schema coverage is 50%, and the description compensates by explaining the semantics the schema states thinly: expected_revision's purpose and source (read_page/list_pages), the exactly-once matching rule and its all:true escape hatch, and that content is a full create-or-replace. It adds real meaning beyond the field names.

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 opens with a specific verb and resource ('Change several draft files in one go') and enumerates the three modes it supports: exact find-and-replace, full rewrite via content, and delete. It distinguishes itself from write_file/write_page only implicitly, through 'several ... in one go', so it falls short of the explicit sibling routing seen in top-tier definitions.

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 gives clear when-to-use context (multiple related files for one feature, e.g. HTML/CSS/JS) and names one exclusion explicitly: binary files should go to upload_asset. The single-file case versus write_file is left for the agent to infer rather than stated.

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