docs

MCP tool

upload_media

Attach a picture, video or PDF

Creates or changes something · and, like everything an agent creates, it waits for a human in the approval queue.

What it does

Attach an image, video or PDF for a post. Ways to supply it: a public https url, a ticket from get_upload_ticket (the right one for a file the USER ATTACHED to this conversation — see that tool), or base64 data with mime_type for something small you generated yourself. Local file paths are not available over the hosted connector. Returns a media_id for create_post. Required for Instagram, TikTok, YouTube, Pinterest (no text-only posts). A PDF becomes a LinkedIn document post — one PDF, on its own, LinkedIn only, and the account must be one that supports documents (create_post says so if not). Accepted formats, size caps and the ticket flow: https://xpost.to/docs/api#media.

Arguments

NameTypeRequiredWhat it is
pathstringNoNot supported on the hosted connector — use get_upload_ticket, url, or data
urlstringNoPublic https URL
datastringNoBase64-encoded file bytes (use with mime_type)
ticketstringNoA ticket from get_upload_ticket, once the file has been posted to the upload slot. Redeem it here to get the media_id.
mime_typestringNoMIME type for data, e.g. image/png, video/mp4
thumbnail_timestamp_msnumberNoVideos: cover-frame time in ms into the video
alt_textstringNoImages: accessibility alt text (max 1000 chars). Applied natively on X and Bluesky

Calling it

Any MCP client calls this by name once the connector is added. The address is the same for every tool:

https://xpost.to/api/mcp

A client that has signed in sends the tool name and its arguments:

{
  "name": "upload_media",
  "arguments": {
    "path": "…",
    "url": "…"
  }
}

The other tools

Back to the MCP connector · What the MCP server is · Connect your assistant