Edit a website file
edit_website_fileChanges 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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The 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. | |
| edits | Yes | 1 to 20 changes to the file, applied in order. | |
| editKey | No | The editKey start_website returned, which proves the website is the caller's. Leave it out for a website in the connected account. | |
| websiteId | Yes | The websiteId start_website returned, or one list_sites shows. |