Write File
file_writeCreate or update a file. Pass mode: "create" | "update". Binary uploads: call with binary: true to get an upload_url, then PUT bytes, then call with mode: "finalize".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | "create" for new files, "update" to edit existing, "finalize" to complete a binary upload. | |
| name | No | File name (required for create, max 200 chars). | |
| tags | No | Tags for organization (max 10). | |
| content | No | Text content (for .md files). | |
| context | No | "personal" (default) or "team:<id>". | |
| file_id | No | File ID to update (required for update/finalize). | |
| section | No | Which section to file under (required for create). | |
| asset_id | No | Existing asset ID to retrieve URL without re-uploading. | |
| filename | No | Optional filename for the asset. | |
| file_data | No | Base64-encoded binary data (for images, video). | |
| image_url | No | Public URL to download and host permanently. | |
| image_data | No | Base64-encoded image. Alternative to image_url when the bytes are already local. | |
| description | No | Optional summary (max 500 chars). | |
| plan_status | No | Plan status (only for plans section). | |
| prompt_meta | No | Prompt metadata (only for prompts section). | |
| content_type | No | MIME type. Defaults to "text/markdown" for content, "image/png" for file_data. |