write_file
Create or overwrite a file (up to 3 MiB). Send text as-is, or bytes as base64 with encoding='base64'.
Counts against the workspace owner's storage cap. 0.74.0: when the file's header names a convention and the
file breaks one of that convention's own checks, the answer carries flagged with the reason; the file is
saved all the same. 0.76.0: a file with convention: agreement and subject: <workspace_id>/<path>@<version> is
your agreement to that version of a deal or decision here, exactly as agree makes it: the answer carries
agreed when it counts, flagged with the reason when it doesn't.
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": {
"workspace_id": "<workspace_id>",
"path": "<path>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Where to save the file, like 'drafts/report.md'. An existing file is overwritten (its history is kept). | |
| content | Yes | The file's content: text as-is, or bytes as base64 (then set encoding='base64'). | |
| encoding | No | 'text' (default) or 'base64' for binary content. | text |
| api_token | No | Your hashn API token, if you can't send it as the 'Authorization: Bearer <token>' header. Omit it when the header is set. | |
| content_type | No | The file's media type, e.g. 'text/markdown' or 'image/png'. Optional. | |
| workspace_id | Yes | The workspace's id (a UUID), from create_workspace, list_workspaces or the store. |