Skip to main content
Glama

twitterapi-io-mcp-server

Search Tweets

search_tweets
Read-onlyIdempotent

🎯 PRIMARY CHOICE for date-range / historical / keyword-based tweet queries. Use this (NOT get_user_last_tweets) whenever user asks about a SPECIFIC TIME RANGE or historical tweets: β€’ 'tweets from January 2026' β†’ query='from:elonmusk since:2026-01-01 until:2026-02-01' β€’ 'tweets between X and Y' β†’ 'from:USER since:X until:Y' β€’ 'tweets last week / last month' β†’ translate to since:/until: dates β€’ 'tweets containing keyword X by user Y' β†’ 'from:Y X' β€’ 'older tweets' / 'archive' / 'in 2025' β†’ use date range, not pagination

Date format: YYYY-MM-DD (UTC midnight). 'until:' is exclusive (until:2026-02-01 = up to Jan 31).

General: Search Twitter/X for tweets matching a query. Supports the full Twitter advanced search syntax (from:, to:, since:, until:, lang:, filter:, has:, -, OR, etc). Returns ~20 tweets per page in reverse chronological order ('Latest') or by engagement ('Top'). Use this for keyword research, monitoring mentions of a brand/topic, finding tweets in a date range, or any open-ended tweet discovery.

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": {
      "query": "<query>",
      "queryType": "<queryType>"
    },
    "name": "search_tweets"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesTwitter advanced search query string. Supports operators: from:USER, to:USER, since:YYYY-MM-DD, until:YYYY-MM-DD, lang:en, filter:replies, -filter:retweets, has:images, etc. Example: 'from:elonmusk since:2026-01-01 has:images'
cursorNoPagination cursor from a previous response's next_cursor field. Omit for first page. Each page returns ~20 tweets.
queryTypeYes'Latest' returns most recent tweets first; 'Top' returns highest-engagement tweets first. Default to 'Latest' for time-sensitive queries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true, idempotentHint=true and destructiveHint=false, so the safety profile is covered. The description adds real behavior beyond that: ~20 tweets per page, reverse-chronological 'Latest' vs engagement-ordered 'Top', and the crucial 'until:' exclusivity rule. It stops short of mentioning rate limits, auth requirements, or what a response envelope looks like.

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 the routing decision and a scannable bullet list of query translations before the general prose. The trailing 'General:' sentence largely restates what the bullets already established, and the emoji/target marker is decorative noise, but nothing is genuinely misleading or wasted to the point of harm.

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?

There is no output schema, yet the description still discloses page size, ordering modes, and the cursor-pagination source, so an agent knows what it will receive and how to continue. For a three-parameter, two-required read tool this covers everything needed to call it correctly.

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 100%, so the baseline is 3, and the description adds meaning the schema does not: date format is YYYY-MM-DD UTC midnight and 'until:' is exclusive (until:2026-02-01 = up to Jan 31). It also advises defaulting to 'Latest' for time-sensitive queries, which the enum description only partially covers.

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 ('Search Twitter/X for tweets matching a query') and immediately distinguishes itself from the sibling get_user_last_tweets by scope (date-range/keyword/historical vs. last tweets). The concrete query-string examples let an agent map a user request directly onto this tool 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?

Gives explicit when-to-use rules ('SPECIFIC TIME RANGE or historical tweets'), names the alternative it is not (get_user_last_tweets), and includes a 'not pagination' exclusion for archive queries. The five example mappings from natural-language asks to query strings are unusually actionable.

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.