a11y_edit_file
Edit a project file by replacing exact text or creating a new one. Ensures JSON/Python validity, keeps a backup, and requires approval.
Instructions
Edit a file of the person's project by replacing an EXACT piece of text (old_string must appear once, or use replace_all), or create a new file (old_string empty). Read the file first with a11y_read_file and copy the piece exactly. A JSON or Python file that was valid cannot become invalid. A backup is kept before every write (undo with a11y_undo_edit). With approval ON (default, A11Y_MCP_EDIT_APPROVAL) the edit is HELD and shown as a diff until the person answers: show them the diff and then call a11y_approve_edit with THEIR answer, never on your own. With approval OFF the edit is applied at once.
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_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "a11y_edit_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| new_string | Yes | ||
| old_string | Yes | ||
| replace_all | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |