Skip to main content
Glama

Search Twitter Posts

search_twitter
Read-only

Search Twitter/X posts by keyword; X search operators work in query. Returns tweet text, author username, URL, date and engagement metrics (likes, retweets, replies, views). Filter by time window (posted_ago) or date range. Use twitter_user_tweets for one account's timeline. Billed $0.006 per page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesNoNumber of pages to fetch, 1-20 (default: 1)
queryYesSearch keyword (max 500 characters). Supports X search operators
sort_byNoSort order: "most_recent" or "relevance"most_recent
end_dateNoOnly posts up to and including this date (YYYY-MM-DD, UTC). Not with posted_ago
posted_agoNoOnly posts from this period: "1h", "24h", "7d", "30d", or "12m" (default: all time). Works with both sort orders
start_dateNoOnly posts from this date onward (YYYY-MM-DD, UTC). Not with posted_ago
get_sentimentNoAdd AI sentiment analysis (Plutchik emotions, dominant_emotion, intensity, and positive/negative/neutral polarity) to each result. Adds a small surcharge per page, or per request on single-request endpoints.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / end_date
      Added value: +{
      +  "description": "Only posts up to and including this date (YYYY-MM-DD, UTC). Not with posted_ago",
      +  "type": "string"
      +}
    • addedInput schema / properties / posted_ago
      Added value: +{
      +  "description": "Only posts from this period: \"1h\", \"24h\", \"7d\", \"30d\", or \"12m\" (default: all time). Works with both sort orders",
      +  "enum": [
      +    "1h",
      +    "24h",
      +    "7d",
      +    "30d",
      +    "12m"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / query / description
      Previous value: -"Search keyword (max 500 characters)"New value: +"Search keyword (max 500 characters). Supports X search operators"
    • addedInput schema / properties / start_date
      Added value: +{
      +  "description": "Only posts from this date onward (YYYY-MM-DD, UTC). Not with posted_ago",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / get_sentiment / description
      Previous value: -"Add AI sentiment analysis (Plutchik emotions, dominant_emotion, intensity, and positive/negative/neutral polarity) to each result. Adds a small per-page surcharge."New value: +"Add AI sentiment analysis (Plutchik emotions, dominant_emotion, intensity, and positive/negative/neutral polarity) to each result. Adds a small surcharge per page, or per request on single-request endpoints."
  3. Changed1 schema field changed
    • changedInput schema / properties / pages / description
      Previous value: -"Number of pages to fetch, 1-10 (default: 1)"New value: +"Number of pages to fetch, 1-20 (default: 1)"
  4. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/non-destructive, so safety is covered. The description adds genuinely new behavioral context: the returned fields (text, author, URL, date, engagement metrics), the operator support, and the per-page cost of $0.006, which the agent needs for cost budgeting. Pagination limits live in the schema rather than the prose.

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?

Five tight clauses, front-loaded with purpose, then returns, then filtering, then the alternative, then price. No filler; each sentence carries distinct decision-relevant information.

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 steps in to enumerate the return fields and the sentiment add-on implicitly via the schema, plus pricing. For a 7-param read-only search tool, an agent has everything needed to call it and anticipate cost.

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 coverage is 100%, so every parameter is already documented with format, enums and defaults. The description reinforces the query-operator support and time-window/date filtering but adds no syntax or constraint detail beyond the schema, which is the expected 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?

The description opens with a specific verb+resource ('Search Twitter/X posts by keyword') and immediately clarifies the query dialect ('X search operators work in query'). It explicitly names the sibling it is not (twitter_user_tweets for a single timeline), so an agent can route correctly without inspecting schemas.

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?

It gives a clear selection rule: use this for keyword search, use twitter_user_tweets for one account's timeline. That routes the main ambiguity. It stops short of stating exclusions (e.g., that this is not for user discovery, unlike search_twitter_users), so it stays just under full marks.

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