replace_in_file
Replace one exact occurrence of text in a ShareLaTeX/Overleaf document, with optional SHA-256 stale-content guard; use an empty replacement to delete that occurrence.
Instructions
Replace one exact occurrence of text in a ShareLaTeX document.
This changes the remote project. The MCP client controls user confirmation.
expected_sha256 optionally guards against stale content (UTF-8 SHA-256). project is a project name or id. The file must be
an editable text document, not an uploaded binary. old_text must occur
exactly once. new_text may be empty to delete that occurrence.
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": {
"project": "<project>",
"file_path": "<file_path>",
"old_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "replace_in_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| new_text | Yes | ||
| old_text | Yes | ||
| file_path | Yes | ||
| expected_sha256 | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |