write_file
Create new files with exact content, overwriting nothing. Parent directories are auto-made inside the approved project, avoiding Codex usage for small additions.
Instructions
Create a NEW file directly (free — no Codex usage). Parent directories are created inside the approved project as needed. Refuses to overwrite existing files (use edit_file for changes). Content is written exactly as given. Use this for small, well-defined additions ChatGPT can make itself; delegate large multi-file work to implement.
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 |
|---|---|---|---|
| path | Yes | Path to the NEW file, relative to the project or absolute inside it. | |
| content | Yes | Full file contents. | |
| project | No | Project path the user named in chat (armed via init). Pass it explicitly on every call. If no project has been named, ask the user; never guess. | |
| session_token | No | Session token returned by init (or create_project). Required for every project tool call in this chat. A new chat must be re-armed. |