Skip to main content
Glama

Weir: Reddit and X (Twitter) data

Get an X account's posts with media

get_x_user_media
Read-onlyIdempotent

Get an X account's posts with media. Returns the profile's Media tab: the account's own posts that carry photos, videos, or GIFs, newest first, with the file links in each post's media (photos at full size). X's tab also lists posts whose only media is a link preview, such as a YouTube link; those are left out, as are posts without the asked-for type, so a page can hold fewer posts than limit while meta.nextCursor still leads on. 404 when the account does not exist, is suspended (then details.reason is suspended), or is protected: a protected account's posts and connections are visible only to accounts it approved. Billed per post returned. The first page also bills one profile lookup, to resolve {user}; later pages carry the account in the cursor and do not. Costs 1 credit + 2 credits per profile returned + 1 credit per post returned. When meta.nextCursor is set, call again with cursor set to it for the next page.

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": {
      "user": "<user>"
    },
    "name": "get_x_user_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNoOnly posts with a file of this type, like the Photos and Videos tabs in X's apps. Leave it out for every post with media.
userYesX handle with or without @, a numeric user id, or an x.com profile URL.
limitNoMost posts to return. X may return fewer.
cursorNoOpaque cursor from the previous page's `meta.nextCursor`. Pass it back unchanged, with the same path and query parameters; a cursor from another request is rejected with 400.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / type
      Added value: +{
      +  "description": "Only posts with a file of this type, like the Photos and Videos tabs in X's apps. Leave it out for every post with media.",
      +  "enum": [
      +    "photo",
      +    "video",
      +    "animated_gif"
      +  ],
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / user / description
      Previous value: -"A username, with or without the `@`, or a numeric account id. An all-digit value is read as an id."New value: +"X handle with or without @, a numeric user id, or an x.com profile URL."
    • removedInput schema / properties / user / pattern
      Removed value: -"^@?[A-Za-z0-9_]{1,50}$"
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/openWorld/idempotent annotations, it discloses that link-preview-only posts are dropped so a page may return fewer than `limit` while `nextCursor` still advances — a genuinely non-obvious behavior. It also spells out suspension (`details.reason` = `suspended`), protected-account visibility rules, cursor request-binding, and the exact credit formula including the extra profile lookup on page one.

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

Conciseness4/5

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

Front-loaded with purpose and scope, then filtering caveat, then errors, then cost, then pagination — a sensible order with no filler. There is minor redundancy between "Billed per post returned" and the later explicit credit formula, and the aside about a protected account's "connections" is slightly off-topic for a media endpoint.

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?

With no output schema, the description still conveys the return shape (`media` on each post, full-size photos, `meta.nextCursor`), the error surface with a reason field, and the cost model. An agent has everything needed to call it, paginate it correctly, and interpret 404s without guessing.

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 earns an extra point by explaining why `limit` is not a guarantee (tab filtering of link-preview posts) and by tying `cursor` to first-page-only profile billing. The `type` and `cursor` semantics largely restate what the schema already documents.

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 ("Get an X account's posts with media") and pins the scope to "the profile's Media tab: the account's own posts that carry photos, videos, or GIFs, newest first." The emphasis on "own posts" plus the media restriction separates it from the account's full post history or replies tools without needing to name them.

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 conditions are given for invoking it: use the `type` filter for Photos/Videos-tab behavior, omit it for all media posts, and re-call with `cursor` from `meta.nextCursor` for the next page. It also states the 404 conditions (nonexistent, suspended, protected) that tell an agent when to stop retrying, but it never names a sibling alternative for the no-media or different-content case.

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.

Resources