Skip to main content
Glama

Edit site file

edit_site_file
Destructive

Change a site file by exact text: oldText once (or replaceAll) becomes newText, or newText goes insertAfter / insertBefore an anchor. Smallest span; keep data-edit-*. Linted on save; errors give the line, a missing oldText gets the closest match. The reply shows how stored text differs from what you sent. Stages in the draft.

Input Schema

NameRequiredDescriptionDefault
idNoSite id.
pathYes
editsYes
baseVersionNoVersion from read_site_file; refuses if the file changed since.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / edits / items / properties / insertAfter
      Added value: +{
      +  "description": "Instead of oldText: anchor text (once in the file); newText goes right after it.",
      +  "maxLength": 200000,
      +  "type": "string"
      +}
    • addedInput schema / properties / edits / items / properties / insertBefore
      Added value: +{
      +  "description": "Instead of oldText: newText goes right before this anchor.",
      +  "maxLength": 200000,
      +  "type": "string"
      +}
    • changedInput schema / properties / edits / items / required
      Previous value: -[
      -  "oldText",
      -  "newText"
      -]New value: +[
      +  "newText"
      +]
  2. Added

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the annotations, the description discloses useful behavior: exact text matching, replaceAll, insertAfter/insertBefore anchors, linting on save, line-numbered errors, closest-match feedback when oldText is missing, a diff-like reply, and draft staging. The remaining gap is minor given the annotation set already covers destructive and non-idempotent behavior.

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?

The description is compact and front-loads the core editing model. Most sentences earn their place, though the fragment 'Smallest span; keep data-edit-*' is cryptic and slightly reduces clarity.

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 file-editing tool with no output schema, the description covers the important mechanics: matching, insertion, lint errors, near-miss feedback, reply behavior, and draft staging. It is complete enough to call correctly, though sibling routing guidance is missing.

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 only 50%, so the description meaningfully compensates by explaining how oldText, replaceAll, newText, insertAfter, and insertBefore interact. It does not explain path or id semantics, but baseVersion is already documented in the schema.

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 clearly states a specific verb and resource: changing a site file by exact text. It distinguishes the exact-text editing mechanism and mentions replaceAll and insert anchor modes. It does not explicitly differentiate itself from sibling tools such as write_site_file or edit_site_files.

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

Usage Guidelines2/5

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

The description explains edit modes but gives no explicit guidance on when to choose this tool over alternatives like write_site_file or edit_site_files. There are no when-not-to-use conditions or sibling routing instructions.

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