file.replace
Replace the full content of a vault file, using a content hash to ensure safe updates and avoid conflicts.
Instructions
HEAVY: replace the entire content of a file. Prefer str_replace / apply_patch / heading.replace_body / block.replace / frontmatter.set / lines.replace for surgical edits. Requires expected_content_hash unless create_if_missing is true and the file does not exist.
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": {
"file": "<file>",
"content": "<content>"
},
"name": "file.replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| vault | No | ||
| content | Yes | ||
| dry_run | No | ||
| create_if_missing | No | ||
| expected_content_hash | No |