33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
{
|
|
"description": "Replace text in a file. Has fuzzy matching (whitespace/indent flexible).",
|
|
"outputFormat": "diff",
|
|
"prompt": "## file_edit\n\nReplace text in a file. Has fuzzy matching (whitespace/indent flexible).\n\n**Args**: `path`, `old_string`, `new_string` (required); `replace_all` (optional boolean)\n\n```\nfile_edit(path=\"<ABSOLUTE_PATH_FROM_PWD>\", old_string=\"old text\", new_string=\"new text\")\nfile_edit(path=\"<ABSOLUTE_PATH_FROM_PWD>\", old_string=\"old text\", new_string=\"new text\", replace_all=true)\n```\n\n**Constraints**: Absolute paths only. Errors if `old_string` matches multiple locations \u2014 add surrounding context to disambiguate, or use `replace_all=true`.",
|
|
"args": {
|
|
"type": "object",
|
|
"required": [
|
|
"path",
|
|
"old_string",
|
|
"new_string"
|
|
],
|
|
"properties": {
|
|
"path": {
|
|
"type": "string",
|
|
"description": "Absolute path to the file to edit"
|
|
},
|
|
"old_string": {
|
|
"type": "string",
|
|
"description": "Text to find (fuzzy whitespace matching)"
|
|
},
|
|
"new_string": {
|
|
"type": "string",
|
|
"description": "Replacement text"
|
|
},
|
|
"replace_all": {
|
|
"type": "boolean",
|
|
"description": "Replace all occurrences (default: false)"
|
|
}
|
|
}
|
|
},
|
|
"scope": "write"
|
|
}
|