Save a Tunc Art file
art_writeSave a file for the user to keep, open or share: a report, export, image, spreadsheet or document, any type, up to 250 MiB. Use it when the user asks you to produce or store a file; the result gives you its private link to hand back. The link is private to the user; they can share the file with anyone by setting a password on its page. Set mime_type to the file's real media type so its link previews (images, video, audio, PDF, HTML, text, Markdown, JSON, CSV and code); other types download. Left out, the type is worked out from the file's bytes and name. Send small files inline (content_base64 or text, up to 8 MiB); for larger files use mode="begin" to get an upload URL, PUT the bytes there, then mode="complete" with the upload_id. The result's artifact carries the file's id (its artifact_id) and viewer_url, its private link. Files are kept for the account's retention period (each file shows its expires_at; longer with paid storage). When storage is full, the oldest files are removed first and the account lists what was removed. Keep the artifact_id to open the file later with art_read or remove it with art_delete.
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": {
"operation": "<operation>"
},
"name": "art_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | inline (default): send the file in this call. begin: get an upload URL for a larger file (name, byte_count; optional mime_type, sha256). complete: finish an upload after the PUT (upload_id, byte_count; optional sha256). | |
| name | No | File name shown to the user, such as q4-report.pdf (1-240 characters). Required for inline and begin. | |
| text | No | inline only: the file as UTF-8 text (at most 8 MiB). Exactly one of content_base64 or text. | |
| sha256 | No | Optional: the file's SHA-256 (64 hex characters), checked when the upload completes. | |
| mime_type | No | Media type, such as application/pdf or image/png. Set the real type so the file previews. Left out, it is worked out from the file's bytes and name (pictures, PDF, Office files, audio, video, archives and text are recognized); a file nothing identifies is application/octet-stream, which downloads. | |
| operation | Yes | create: save a new file. | |
| upload_id | No | complete only: the upload_id that mode=begin returned. | |
| byte_count | No | begin and complete: the file's exact size in bytes. | |
| content_base64 | No | inline only: the file's bytes, base64 (at most 8 MiB decoded). Exactly one of content_base64 or text. |