Skip to main content
Glama

Attach a picture, video or PDF

upload_media

Attach an image, video or PDF and get a media_id for create_post. Sources: file (an attachment from this conversation, as the host provides it), a public https url, base64 data with mime_type. Instagram, TikTok, YouTube and Pinterest need media; a PDF becomes a LinkedIn document post. When an attached file cannot be provided from here, create the post with media_pending: true instead and the person adds it in the approval card. Formats and caps: https://xpost.to/docs/api#media.

Input Schema

NameRequiredDescriptionDefault
urlNoPublic https URL
dataNoThe bytes of a small image, video or PDF generated here, base64-encoded, with `mime_type`. A file the user attached travels as `file`, or through the post's `upload_url`, not here.
fileNoA file the user attached to this conversation, as the host hands it over. Absent when the host has no such object.
alt_textNoImages: accessibility alt text (max 1000 chars). Applied natively on X and Bluesky
mime_typeNoMIME type for `data`, e.g. image/png, video/mp4
thumbnail_timestamp_msNoVideos: cover-frame time in ms into the video

Output Schema

NameRequiredDescriptionDefault
idNoPass in create_post's media_ids.
okNoPresent and false only on a refusal.
kindNo
errorNoWhat was refused, in a sentence, when `ok` is false.
retriableNoFalse when asking again cannot change the answer.
error_codeNoMachine reason for a refusal.
people_tagsNo
replaced_byNoThe id the post has now, when you asked with one an edit retired. An edit gives a post a new id: get_delivery_receipt and get_post_metrics answer for this current version (and `asked_for` is the id you sent); update_post and delete_post refuse with error_code `replaced`. Use this id from here on.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / replaced_by / description
      Previous value: -"With error_code `replaced`: the id the post has now. An edit gives a post a new id; use this one."New value: +"The id the post has now, when you asked with one an edit retired. An edit gives a post a new id: get_delivery_receipt and get_post_metrics answer for this current version (and `asked_for` is the id you sent); update_post and delete_post refuse with error_code `replaced`. Use this id from here on."
  2. Changed1 schema field changed
    • addedOutput schema / properties / replaced_by
      Added value: +{
      +  "description": "With error_code `replaced`: the id the post has now. An edit gives a post a new id; use this one.",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare the mutation/safety profile (readOnly=false, destructive=false, idempotent=false, openWorld=true), so the description needn't restate that; it adds real context instead — the media_id return, per-platform media requirements, and the graceful degradation path. Only gap is that format/size caps are offloaded to an external URL rather than summarized.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and return value are front-loaded in the first sentence, with source details, platform rules and the fallback ordered by decision relevance. Every clause carries information; nothing is restated from the title or schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite six parameters, a nested file object and an output schema, the description covers what an agent needs: which source to pick, what platforms require media, what comes back, and what to do when the file is unreachable. Return-value detail is correctly delegated to the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3; the description goes further by explaining source selection semantics — that host attachments travel as `file` (or the post's upload_url), and that base64 `data` requires a matching `mime_type`. It doesn't explain alt_text or thumbnail_timestamp_ms, but those are self-documenting in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Attach an image, video or PDF') and names the payoff ('get a media_id for create_post'), which also anchors it to the sibling it feeds. An agent can distinguish this from create_post or bulk_post without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly enumerates the three input sources (`file`, https `url`, base64 `data` + `mime_type`), states platform conditions (Instagram/TikTok/YouTube/Pinterest need media; PDF becomes a LinkedIn document), and gives the fallback alternative (`media_pending: true` on the post) when a file cannot travel from here.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.