upload_media
Upload images or videos to X (Twitter) by providing base64-encoded data, returning a media ID for attaching to posts. Supports formats like PNG, JPEG, and MP4 with specified MIME types.
Instructions
Upload an image or video to X. Returns a media_id that can be attached to posts. Provide the file as base64-encoded data.
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": {
"media_data": "<media_data>",
"mime_type": "<mime_type>"
},
"name": "upload_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| media_data | Yes | Base64-encoded media file data | |
| mime_type | Yes | MIME type (e.g. 'image/png', 'image/jpeg', 'video/mp4') | |
| media_category | No | Category: 'tweet_image', 'tweet_gif', or 'tweet_video' (default: tweet_image) |