edit_file
Replace a file's entire content with new text, automatically creating a timestamped backup before any change. Use for full rewrites; choose patch_file for precise edits.
Instructions
Write new content to a file, replacing it entirely. A timestamped backup is automatically created in .mcp-backups/ before any change. Use patch_file instead when making a small targeted change.
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": {
"filepath": "<filepath>",
"content": "<content>"
},
"name": "edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The complete new content to write to the file | |
| filepath | Yes | Path to the file, relative to project root or absolute | |
| create_if_missing | No | Create the file if it does not exist yet |