Replace a document, keeping every link
replace_documentReplaces 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
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | The new HTML markup, in full. It may keep the htmlradar-image references get_document returned. Mutually exclusive with `edits`. | |
| note | No | Optional note for an announced update, at most 140 characters. | |
| edits | No | Changes 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`. | |
| announce | No | Whether 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_id | No | Optional 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_id | Yes | The document whose contents are being replaced. Every link to it keeps working. | |
| expected_version | Yes | The 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. |