replace_in_html_file
Find and replace exact text in HTML tool files under resources/html/; returns a validation summary and flags missing or ambiguous matches.
Instructions
Find and replace exact text in an HTML tool file (paths under resources/html/ only). Errors if searchText is missing or ambiguous (multiple matches) — expand searchText, or pass replaceAll/occurrenceIndex. The result includes a validation summary.
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": {
"workspacePath": "<workspacePath>",
"filePath": "<filePath>",
"searchText": "<searchText>",
"replaceText": "<replaceText>"
},
"name": "replace_in_html_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | File path relative to the workspace root (e.g. "resources/html/my-tool/index.html") | |
| replaceAll | No | Replace every occurrence of searchText (default false) | |
| searchText | Yes | Exact text to find, copied verbatim (must be unique in the file unless replaceAll or occurrenceIndex is passed) | |
| replaceText | Yes | Text to replace it with | |
| workspacePath | Yes | Absolute path to the workspace directory | |
| occurrenceIndex | No | Replace only the Nth occurrence (1-based). Alternative to expanding searchText when it appears multiple times. |