Skip to main content
Glama

Replace a document, keeping every link

replace_document
Destructive

Replaces the contents of a document already on HTMLRadar, which is how a page that has been sent is updated. Every existing link stays exactly as it is (same address, same settings, same reading history) and serves the new contents from the next time it is opened, so nobody is sent a second link; a link that is switched off or past its end date stays closed. The new HTML is screened for phishing signals as every upload is, and readers of a page the screen holds see that it is not available yet. The previous version stays listed in the document's version history on the website. There is no restore, from Claude or on the website; going back means replacing the contents again with the earlier page. On a free account each document includes three new versions, so one replacement should carry every change the user asked for; a replacement answered with version_limit replaced nothing. Recipients may already have read the old contents. The call needs expected_version, the version get_document or list_documents shows, so a newer version is never overwritten. The tool accepts either the whole new page in html, up to 5 MB with its images as references, or edits: pieces of text to find in the page get_document returned, each with its replacement and each appearing exactly once. Past 5 MB, only edits work, because only the changes travel. A change to a page already on HTMLRadar is made by reading it with get_document and sending back the edited short form, or only the edits: that works for pages up to 30 MB, the same limit as the website, and keeps every image; a whole new file is needed only to replace the page itself. A page with more than 20 MB of text and code besides its images cannot be read or changed here, and a change that would take a page past that is refused, so nothing is stored. Images that need a login, expiring image addresses and local file paths do not load for readers of the link; an image embedded in the HTML as a data URI travels inside the page. The tool does not check that images load. On an update, embedded PNG, JPEG, GIF and WebP images appear as short htmlradar-image references in the document contents. Unchanged references restore the original images, so only new images count towards the 5 MB limit. Other embedded images, such as SVG, stay in the markup and count towards it.

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": {
      "document_id": "<document_id>",
      "expected_version": "<expected_version>"
    },
    "name": "replace_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlNoThe new HTML markup, in full. It may keep the htmlradar-image references get_document returned. Mutually exclusive with `edits`.
noteNoOptional note for an announced update, at most 140 characters.
editsNoChanges to the page get_document returned, applied in order. Each `find` must appear exactly once in the page at that point. Between 1 and 200. Mutually exclusive with `html`.
announceNoWhether readers see what changed and subscribers receive an alert. Omitted means an announcement only when every live link is company-only; otherwise the replacement is quiet.
request_idNoOptional on a first attempt. When a previous call may have been applied, the request_id named by its error makes a retry return the first result instead of doing it twice.
document_idYesThe document whose contents are being replaced. Every link to it keeps working.
expected_versionYesThe document's current version as you last saw it: get_document and list_documents show it, and each replace_document result gives the new one. When the document has been replaced since, nothing is replaced and the call says so, so newer work is never overwritten.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare the destructive/non-idempotent/open-world profile; the description adds substantial behavior beyond that: links keep working including disabled or expired ones staying closed, version history is retained but there is no restore path anywhere, free accounts allow three new versions per document, phishing screening gates visibility, conflicting expected_version replaces nothing, and recipients may already have consumed the old content.

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

Conciseness3/5

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

The core purpose and the versioning/link consequences are front-loaded, which is good, but the rest is a single ~400-word block mixing operational constraints, image handling, and error recovery with no separation. Some content (data URI behavior, which embedded formats survive as htmlradar-image references) is valuable but buried where an agent may not scan it.

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 7-parameter, destructive, non-idempotent mutation with no output schema, the description covers the things an agent would otherwise guess wrong: new version is returned, concurrency guard via expected_version, retry semantics via request_id, size ceilings, and what a refused or version-limited call leaves behind (nothing). Little 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.

Parameters4/5

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

Schema coverage is 100%, so the schema supplies most parameter meaning; the description still adds value by tying size thresholds to the html/edits choice (5 MB for full page with referenced images, 30 MB for edit-based changes, 20 MB text ceiling), and by explaining that request_id's retry returns the first result rather than duplicating work. It does not add much about `note` or `announce` beyond what the schema fields already say.

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?

"Replaces the contents of a document already on HTMLRadar" gives a specific verb and resource, and the following clause ("every existing link stays exactly as it is... nobody is sent a second link") distinguishes it from share_html, which creates new links. An agent can tell replacement-in-place apart from share creation without opening any schema.

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?

It explicitly splits work between `html` (whole new page) and `edits` (changes to a page returned by get_document), states that a change to an existing page should be done via get_document plus edits, and reserves a whole new file for replacing the page itself. It also names the escalation path when the page exceeds limits and says what to do on a version_limit response.

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.