Skip to main content
Glama

Weir: Reddit and X (Twitter) data

Search X posts

search_x
Read-onlyIdempotent

Search public X (Twitter) posts. Combine query or phrase with filters such as fromUsers, mentions, hashtags, language, minLikes, since/until and onlyOriginal; at least one of query, phrase, hashtags, fromUsers, toUsers or mentions is required. Returns X's own fields: text, author (an object), likeCount, retweetCount, replyCount, viewCount (counts can be null), createdAt, url. X only: search Reddit separately with search_reddit. Costs 1 credit + 1 credit per post returned. When meta.nextCursor is set, call again with cursor set to it for the next page.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_x"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNolatest (default) or top.latest
limitNoMost posts to return, 1-50. Default 10. X serves about 20 a page whatever is asked, so for more, call again with the cursor.
queryNoKeywords, using X search syntax if useful.
sinceNoOnly posts at or after this ISO 8601 time.
untilNoOnly posts before this ISO 8601 time.
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.
listIdNoOnly posts by members of this public List.
phraseNoAn exact phrase that must appear.
sinceIdNoOnly posts newer than this post id, exclusive. The way to resume a feed: pass the newest id already seen.
toUsersNoReplying to any of these usernames.
untilIdNoOnly posts older than this post id, exclusive.
anyWordsNoAt least one of these words must appear.
hashtagsNoPosts carrying any of these hashtags, with or without the `#` (a full-width `#` works too). X also matches posts that only have the words, so those are left out: a page can come back with fewer posts than `limit`, and `meta.nextCursor` still leads on.
languageNoLanguage X detected, as a BCP-47 tag such as `en`. Indonesian (`id`) and Hebrew (`he`) are searched by the codes X still uses, `in` and `iw`, which is also what posts carry in `lang`. A region is dropped: `pt-BR` searches Portuguese.
mentionsNoMentioning any of these usernames.
minLikesNo
onlyTextNoExclude posts with links, media or a quoted post. X applies this loosely, so posts it lets through are left out: a page can hold fewer posts than `limit` while `meta.nextCursor` still leads on.
fromUsersNoPosted by any of these usernames.
onlyLinksNoOnly posts containing a link.
minRepliesNo
minRepostsNo
onlyRepliesNoOnly replies.
excludeWordsNoNone of these words may appear.
onlyOriginalNoExclude replies.
quotedPostIdNoOnly posts quoting this post. `getXQuotes` is the dedicated endpoint for this.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / onlyText / description
      Previous value: -"Exclude posts with links."New value: +"Exclude posts with links, media or a quoted post. X applies this loosely, so posts it lets through are left out: a page can hold fewer posts than `limit` while `meta.nextCursor` still leads on."
  2. Changed1 schema field changed
    • changedInput schema / properties / hashtags / description
      Previous value: -"Any of these hashtags, with or without the `#`."New value: +"Posts carrying any of these hashtags, with or without the `#` (a full-width `#` works too). X also matches posts that only have the words, so those are left out: a page can come back with fewer posts than `limit`, and `meta.nextCursor` still leads on."
  3. Changed1 schema field changed
    • changedInput schema / properties / limit / description
      Previous value: -"Results to return, 1-50. Default 10; widen only after the first page proved useful."New value: +"Most posts to return, 1-50. Default 10. X serves about 20 a page whatever is asked, so for more, call again with the cursor."
  4. Changed1 schema field changed
    • changedInput schema / properties / language / description
      Previous value: -"Language X detected, as a BCP-47 tag such as `en`."New value: +"Language X detected, as a BCP-47 tag such as `en`. Indonesian (`id`) and Hebrew (`he`) are searched by the codes X still uses, `in` and `iw`, which is also what posts carry in `lang`. A region is dropped: `pt-BR` searches Portuguese."
  5. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description adds context they cannot: a cost model ('1 credit + 1 credit per post returned'), the nullability of engagement counts, and the pagination contract. These are exactly the operational facts an agent needs before deciding to call repeatedly.

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?

Four front-loaded sentences: purpose, filters plus precondition, return fields, cost, pagination — each carrying distinct information with no filler. The enumeration of filter names partly restates the schema, which keeps it just short of a 5.

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 25 parameters and no output schema, the description fills the gap by naming the returned fields (text, author object, counts, createdAt, url) and warning about null counts. Combined with the cost and cursor guidance, an agent has everything needed to call and iterate correctly.

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

Parameters5/5

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

Schema coverage is 88%, so the baseline would be 3, but the description contributes a constraint absent from the schema: zero parameters are required in the schema, yet the at-least-one-filter rule is stated only in the description. It also groups the filters conceptually (query/phrase vs. user vs. engagement thresholds), which aids selection across 25 parameters.

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?

Opens with a specific verb and resource ('Search public X (Twitter) posts') and immediately scopes it against the sibling: 'X only: search Reddit separately with search_reddit.' An agent can route between the two search tools without opening either 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?

States a hard precondition ('at least one of query, phrase, hashtags, fromUsers, toUsers or mentions is required'), names the alternative for the non-X case, and explains the continuation condition ('When meta.nextCursor is set, call again with cursor set to it'). When-to-use, when-not-to-use, and the loop pattern are all explicit.

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