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 link to hand back. Files are private to the user unless they ask you to publish one: visibility="public" (on create, or operation="set_visibility" with artifact_id for a file already saved) lets anyone on the internet open and download it and any website embed it, until it expires. Set it only when the user asks to publish, embed or share a file with everyone. The result then carries embed.html (code to paste into a page) and media_url (a direct link that plays in most forums); set_visibility with visibility="private" stops it. Publishing needs the "Make your Tunc Art files public" permission on this connection; without it the file is saved private and the result says visibility_refused. Password sharing stays with the user, on the file's 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, visibility). | |
| 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. set_visibility: make a saved file public or private again (artifact_id, visibility). | |
| 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. | |
| visibility | No | create (inline, or complete for a large file; not begin) and set_visibility: public lets anyone open and download the file and any site embed it, until it expires; set it only when the user asks. private (the default) keeps it the user's. | |
| artifact_id | No | set_visibility only: the file's id or six-character code (from art_write or art_read). | |
| content_base64 | No | inline only: the file's bytes, base64 (at most 8 MiB decoded). Exactly one of content_base64 or text. |