Skip to main content
Glama
fatwang2

x-api-mcp

by fatwang2

upload_media

Upload images, GIFs, or videos to X and get a media_id for creating posts. Small images upload directly; larger files and videos use chunked processing, with optional alt text.

Instructions

Upload an image, GIF or video and return its media_id for create_post. Images <= 5 MB go in one request; GIFs, videos and larger files use chunked upload and wait for processing. Optional alt text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base64NoBase64 data (or data: URL) instead of file_path
accountNoX username of an authorized account (see list_accounts). Omit to use the default account.
alt_textNo
file_pathNoAbsolute path to a local file (jpg/png/webp/gif/mp4/mov)
mime_typeNoRequired for base64 without a data: prefix
media_categoryNoInferred from the file type for posts; use dm_* for direct messages

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only provide openWorldHint, so the description carries the behavioral burden and does so well: single-request vs chunked upload thresholds, that GIFs/videos wait for processing, and that alt text is optional. It omits auth/account prerequisites and any failure or retry behavior, keeping it out of 5 territory.

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?

Three dense sentences with the purpose, return value, and operational constraints front-loaded; every clause earns its place and nothing is padded.

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

Completeness4/5

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

Covers input types, size thresholds, async processing, output identifier, and the follow-up tool, which is substantial for a 6-param tool with no output schema. Missing pieces are account/authorization context and what to do while processing, so it is strong but not exhaustive.

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

Parameters3/5

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

Schema description coverage is 83%, so the schema already documents base64, account, file_path, mime_type, and media_category. The description adds only that alt_text is optional and restates the output id; it contributes little parameter-level meaning beyond structured fields, matching the baseline.

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?

Names a specific verb+resource (upload media), states the accepted file types, and declares the return value (media_id) plus its downstream consumer (create_post). This distinguishes it cleanly from siblings like get_media_status or create_post.

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

Usage Guidelines4/5

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

Clear context: use this to obtain a media_id for create_post, with size/type conditions that dictate the upload path. It does not name an explicit alternative or when-not-to-use case (e.g., checking status via get_media_status), so it stops short of a top score.

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