Edit part of a file
edit_fileReplaces exact text in a server file and saves the change, requiring a unique match unless replace_all is set; read the file first.
Instructions
Replaces exact text in a text file and saves it. old_text must match the file exactly, including indentation, and must occur once unless replace_all is set; otherwise nothing is written. Read the file first.
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": {
"path": "<path>",
"old_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path, relative to the server's root directory, such as "server.properties" or "plugins/LuckPerms/config.yml". | |
| server | No | Server identifier or UUID. Omit to use the configured server (PEBBLEHOST_SERVER_ID); other servers are refused unless PEBBLEHOST_ALLOW_ALL_SERVERS is set. | |
| new_text | Yes | Replacement text. | |
| old_text | Yes | Exact text to replace, with enough surrounding lines to be unique. | |
| replace_all | No | Replace every occurrence instead of requiring a single one. |