preview_source_patch
Preview one literal exact-text source replacement against an expected SHA-256 without writing or approving, and return old/new hashes plus the complete diff for review.
Instructions
Build one literal source edit proposal; no file write or grant.
Use to preview one literal exact-text source replacement against the expected SHA-256. No write/approval. Source up to 65536 bytes; complete diff up to 16384 bytes. Returns old/new SHA-256 and the complete diff, never the whole proposed content. A generic tool failure is not an Owner rejection or a write; resolve stale or ambiguous source rather than guess.
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>",
"expected_sha256": "<expected_sha256>"
},
"name": "preview_source_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the target within the already-configured Owner read/edit roots; path alone grants no access. | |
| new_text | Yes | Literal replacement (at most 4096 UTF-8 bytes); may contain secrets. Submitted writes require local Owner review; never a shell command. | |
| old_text | Yes | Literal existing text (at most 4096 UTF-8 bytes); may contain secrets. Submitted writes require local Owner review; exactly one match. | |
| expected_sha256 | Yes | Expected 64-character lowercase SHA-256 of current file content; stale values must fail. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||