replace_in_html_file
Replaces the first occurrence of a specific string with replacement text in an HTML tool file, enabling targeted edits within a workspace document.
Instructions
Replace a specific string in an HTML tool file in a workspace. Finds the first occurrence of searchText and replaces it with replaceText.
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") | |
| searchText | Yes | Text to search for (must be unique enough to identify the exact location) | |
| replaceText | Yes | Text to replace it with | |
| workspacePath | Yes | Absolute path to the workspace directory |