Upload a photo or video
media_uploadUpload one picture or video to attach to drafts: PNG, JPEG, WebP or MP4, up to 10 MB. Answers its media id. A file that no draft uses is removed 24 hours after upload. Only for small files you already hold as base64: for a picture or video you made yourself, use media_upload_link, which is far quicker than writing the file out. Make a picture a JPEG: every network that takes pictures accepts JPEG, while Instagram refuses PNG and WebP (capabilities lists each network’s mediaTypes).
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": {
"name": "<name>",
"mimeType": "<mimeType>",
"base64": "<base64>"
},
"name": "media_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | What the picture shows, for people who cannot see it. Kept with the file. | |
| name | Yes | The file name, for the user’s own list. | |
| base64 | Yes | The file’s bytes in standard base64, with no data: prefix. Up to 10 MB of file. | |
| brandId | No | The brand this is for, by its id from brands_list. Needed when the login has more than one brand; with one brand it can be left out. | |
| mimeType | Yes | The file’s real format. A file whose bytes do not match is refused. |