Mew. Work. Docs

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, unless the model sets replace_all, which replaces every occurrence. 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

  • edit ignores Windows line endings (CRLF) and a byte-order mark when matching. If the passage is still not found, it treats straight and curly quotes as the same. The file keeps its own line endings and quote style.
  • With the conversation's file write guards on, the default, the model must have read or written the file in this conversation; reads from before Mewrk restarted still count. If the file has changed on disk since, even while Mewrk was closed, the edit still applies when its passage is still found, and the model is told the file holds changes it has not seen. If the passage is gone, the model must read the file again.
  • 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

ParameterTypeDetails
find required
Find text
string—
path required
Path
string—
replace required
Replacement
string—
replace_all
Replace all
boolean—