Write File
writeCreate or replace workspace text files atomically, preserving metadata and returning a unified diff. Provide a SHA-256 from read to update shared files safely without conflicting with other sessions.
Instructions
Create or overwrite a meaningful text file inside the workspace. New files use an atomic rename; existing files retain their inode and metadata. Returns a unified diff; pass the SHA from read when overwriting shared files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path relative to workspace root. | |
| content | Yes | Complete file contents to write. | |
| overwrite | No | Allow overwriting existing files. Default: true. | |
| create_dirs | No | Create parent directories if missing. Default: true. | |
| workspace_id | No | Workspace id from open_workspace. Omit to use the workspace selected for this MCP session. | |
| expected_sha256 | No | Optional SHA-256 from read. Fails instead of overwriting if another session changed the file. |