X media
x_mediaUpload images, GIFs, videos, or subtitles to X, poll video/GIF processing, and retrieve post media as viewable images or extracted frames for vision-capable models.
Instructions
Upload media, check video/GIF processing, and view attached media — photos are returned as images, videos are sampled into frames when ffmpeg is installed.
Actions (pass "action" plus that action's parameters):
upload: Upload an image, GIF, video or subtitle file and get a media_id to attach to x_posts action "create" or x_dms action "send".
status: Poll the processing state of an uploaded video or GIF. [requires: media_id]
view: Downloads media attached to a post and returns it as MCP image content, so vision-capable models can actually see pictures instead of only reading URLs.
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": {
"action": "<action>"
},
"name": "x_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| path | No | Path to a local media file inside X_MCP_MEDIA_ROOTS (default: current directory). | |
| action | Yes | Action to perform. One of: upload, status, view. | |
| base64 | No | Base64-encoded file contents (no data: prefix, max 25 MB decoded). | |
| frames | No | How many video frames to extract when ffmpeg is available. | |
| alt_text | No | Accessibility description (max 1000 chars). | |
| category | No | X media category. Inferred from the MIME type when omitted. | |
| filename | No | Filename used to infer the MIME type for base64 uploads. | |
| media_id | No | Media id returned by an upload. | |
| tweet_id | No | Post whose media should be viewed. | |
| media_type | No | MIME type, e.g. image/png or video/mp4. Inferred when omitted. | |
| media_index | No | Which attachment to view for multi-image posts (0-3). | |
| wait_for_processing | No | Poll until video processing finishes. |