Surgical find/replace in one file
update_file_contentApply literal find/replace edits to one file in one call, for small changes where uploading the whole file is wasteful. Each edit states how many matches it expects; any mismatch aborts the call with no writes. Served-file (dist) edits go live at once; source edits ship with build_and_deploy. Use apply_edits for several 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": {
"name": "<name>",
"path": "<path>",
"edits": "<edits>"
},
"name": "update_file_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Site name as shown by list_sites, e.g. my-portfolio. | |
| path | Yes | Path inside the chosen tree, e.g. index.html. | |
| edits | Yes | Ordered edits `{find, replace, count?}`, applied together; if any match count differs, nothing is written. | |
| target | No | 'dist' (default) edits the served file, live at once. 'source' edits the editable source tree; build_and_deploy ships it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| path | Yes | ||
| edits | Yes | ||
| siteId | Yes | ||
| target | Yes | ||
| warnings | No | Secret-scanner findings in the rewritten file that did not block the edit (AWS Access Key, Stripe Key, JWT Token, etc.). Malicious content blocks the edit with MALICIOUS_CONTENT instead. | |
| afterBytes | Yes | ||
| beforeBytes | Yes |