Upload an image
upload_media_fileUpload one image into a media source, as base64. Best for something you generated — an SVG you wrote, a small chart. The bytes travel through your own context, so keep it under about 256 KB; for files already on a disk — a folder of photographs — use create_media_upload_link instead if you can run a shell command. For files the user attached to the conversation, do not re-encode them here: give the user the library's uploadInAppUrl (from list_workspace_sources or create_media_source) and let them drop the files in. Hard limit 4.0 MB. Any image type except GIF, which has no meaning in a print layout.
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": {
"mediaSourceId": "<mediaSourceId>",
"filename": "<filename>",
"contentBase64": "<contentBase64>",
"llm_model": "<llm_model>"
},
"name": "upload_media_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Folder path inside the library, e.g. "/products/". Created if missing. Defaults to the root. | |
| filename | Yes | The file name including extension — the extension decides the type. | |
| llm_model | Yes | The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess. | |
| contentBase64 | Yes | The image's bytes, base64-encoded, with no data: prefix. | |
| mediaSourceId | Yes | The library to upload into, from list_workspace_sources. | |
| conversation_id | No | Pass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request. |