Skip to main content
Glama

Edit a website file

edit_website_file
Destructive

Changes part of one saved page, stylesheet or script in place: each edit replaces its find text with its replace text, so a fix sends only the text it changes instead of the whole file. Copy find exactly from the file (read_website_file shows it); it must appear once, or set all to change every one. Edits apply in order, and if any fails nothing is saved. Every page is then checked against the rules, and it returns the same report as save_website_files with edited. Fails with not_in_file when a find text is not there, found_more_than_once when it is there several times, and not_text for a picture or font. To add a file or replace a whole one, use save_website_files.

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

Input Schema

NameRequiredDescriptionDefault
pathYesThe file's path from the website's root, exactly as it was saved, such as index.html, about.html or images/shop.jpg. list_website_files shows every path.
editsYes1 to 20 changes to the file, applied in order.
editKeyNoThe editKey start_website returned, which proves the website is the caller's. Leave it out for a website in the connected account.
websiteIdYesThe websiteId start_website returned, or one list_sites shows.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false; the description adds substantial context beyond them: edits apply in order, the operation is atomic ('if any fails nothing is saved'), every page is re-validated and a report is returned, and three specific failure modes (not_in_file, found_more_than_once, not_text) are named. This is exactly the kind of pre-call risk information an agent needs for a destructive mutation.

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?

Front-loaded with the core behavior, then prerequisites, ordering/atomicity, return value, error codes, and the alternative tool in a logical progression. It is dense but nearly every clause carries actionable information; the error-code enumeration is slightly list-heavy for prose but still earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, non-idempotent four-parameter edit tool with no output schema, the definition covers prerequisites (read_website_file, editKey), atomicity, ordering, post-validation reporting, and failure modes. Nothing an agent needs in order to call it safely is missing.

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

Parameters5/5

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

Schema coverage is 100%, so the baseline would be 3, but the description goes further: it explains that find must be copied exactly and be unique, that 'all' changes every occurrence, that empty replace deletes text, and that edits are ordered with 1-20 entries. These are semantic constraints tied to real failure modes, not restatements of the schema.

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?

States a specific verb and resource ('Changes part of one saved page, stylesheet or script in place') and immediately scopes the behavior to partial, targeted edits rather than whole-file writes. It then names the sibling that handles the other case (save_website_files), so an agent can distinguish the two without inspecting schemas.

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

Usage Guidelines5/5

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

Explicitly routes the agent: use read_website_file to obtain the find text, use save_website_files 'To add a file or replace a whole one'. It also gives the selection rule for the 'all' flag (find must appear once, otherwise set all), which is a when-to-use decision embedded in the definition.

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.