Write a file to the local filesystem.
WriteCreates or replaces local files at an absolute path, storing provided content while preserving existing encoding and line-ending conventions.
Instructions
Writes a file to the local filesystem.
Usage:
This tool will overwrite the existing file if there is one at the provided path.
If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.
Prefer the Edit tool for modifying existing files — it only sends the diff. Only use this tool to create new files or for complete rewrites.
NEVER create documentation files (*.md) or README files unless explicitly requested by the User.
Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.
Line endings and encoding are handled for you: content may use LF or CRLF and the existing file's style is kept. Never inspect or rewrite a file just to fix line endings.
The success message states the encoding and line endings that were preserved. That is authoritative; no follow-up read or shell check is needed.
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": {
"file_path": "<file_path>",
"content": "<content>"
},
"name": "Write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The content to write to the file | |
| file_path | Yes | The absolute path to the file to write (must be absolute, not relative) |