Write a file
write_fileWrites a text file in create, atomic overwrite, or append mode and can create parent folders. Refuses protected system, config, and restricted-path files to keep edits within allowed areas.
Instructions
Write a text file: mode create (default; refuses an existing file), overwrite (atomic, keeps permissions) or append. Refuses the files the fence protects (shell rc files, LaunchAgents, .git hooks and config, editor tasks, MCP and Claude Code config, protected folders, anything outside the home folder and temp).
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>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | No | one line in plain words: what this does and why (logged). With outside_sandbox: what the user asked for that the sandbox blocked | |
| mode | No | create (default) refuses an existing file; overwrite replaces it; append adds to its end | |
| path | Yes | the file: absolute, ~/..., or relative to the home folder | |
| content | Yes | the text to write (up to 2 MB) | |
| make_dirs | No | create missing parent folders (default false) |