update_file
Update an existing file by either replacing specific text or overwriting its entire content.
Instructions
Update part or all of an existing file.
Use EITHER (find, replace) for a literal text substitution, OR new_content for a full rewrite -- do not pass both.
Args:
path: Path relative to the workspace root. Must already exist.
find: Literal text to search for (mutually exclusive with new_content).
replace: Replacement text for every match of find (default: "").
new_content: Full replacement content for the file.
count: Max number of find occurrences to replace (-1 = all).
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>"
},
"name": "update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| find | No | ||
| path | Yes | ||
| count | No | ||
| replace | No | ||
| new_content | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||