Built-in tools›Files and search
Edit file
edit- Group
- Files and search
- Turned on by
- Its own switch on the Tools page of Conversation settings.
- Approval
- Reviewed: writes and open-ended actions ask for approval unless the security level or an earlier “Always allow” covers them.
- Profile key
tool.edit.description
Replaces one exact passage in an existing file with new text and leaves the rest of the file untouched.
The passage must occur exactly once, or the call fails. edit never creates a file; that is write's job.
Limits
The file must be UTF-8 text of at most 2 MiB, before and after the edit.
Good to know
- If the passage does not match as written,
edittries again ignoring Windows line endings (CRLF) and a byte-order mark, and keeps the file's own line endings. - The model must have read or written the file in this conversation; reads from before Mework restarted still count. If the file has changed on disk since, even while Mework was closed, the edit still applies, and the model is told the file holds changes it has not seen.
- In Plan mode, files in a Git repository that Git does not ignore are refused. Paths outside the repository or ignored by Git can still be edited.
Parameters
| Parameter | Type | Details |
|---|---|---|
find requiredFind text | string | Exact text to replace; must match exactly once. |
path requiredPath | string | Existing file to modify, relative to the workspace. |
replace requiredReplacement | string | Replacement text; an empty string deletes the passage. |