Skip to main content
Glama
TwitterAPIs

twitterapis

by TwitterAPIs

twitter_advanced_search

Read-only

Search recent tweets using advanced operators like from:, to:, since:, min_faves:, and more. Filter by date, engagement, language, or exclude replies.

Instructions

Search recent tweets using X's advanced-search operators. Supports from:, to:, since:YYYY-MM-DD, until:YYYY-MM-DD, min_faves:N, min_retweets:N, filter:links, -filter:replies, lang:en, and free-text. Returns tweet text, author info, engagement metrics, and a pagination cursor. Use product='Latest' for chronological results; 'Top' (default) for engagement-ranked. Example queries: 'AI agents min_faves:100', 'from:openai filter:links since:2024-01-01', '#buildinpublic -filter:replies lang:en'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoMax items to return for this page. Typical range 1 to 200; endpoint default (20) applies if omitted. To page through results, pass the cursor from the previous response.
queryYesFull advanced-search query string. Supports X operators: from:handle, to:handle, since:YYYY-MM-DD, until:YYYY-MM-DD, min_faves:N, min_retweets:N, filter:links, filter:images, filter:videos, -filter:replies, lang:en, #hashtag, "exact phrase". Example: 'from:openai min_faves:500 since:2024-01-01'.
cursorNoOpaque pagination cursor from a previous response's next_cursor field. Omit on the first call; pass on subsequent calls to fetch the next page.
productNoResult ranking mode. 'Latest' = reverse-chronological (best for monitoring). 'Top' = engagement-ranked (best for finding popular tweets, default when omitted). 'Media' = tweets with images/video. 'People' = matching user accounts.
Behavior4/5

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

The description discloses what the tool returns (tweet text, author info, engagement metrics, pagination cursor) and explains pagination via cursor. Annotations already declare readOnlyHint and destructiveHint, so the behavioral burden is partially met. The description adds value without contradicting annotations.

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?

The description is a single paragraph of four sentences, each serving a purpose: stating the use case, listing operators, describing output, and giving examples. No wasted words, front-loaded with the main purpose.

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?

For a tool with 4 parameters and no output schema, the description covers the return values, pagination, and parameter usage well. It could mention authentication or rate limits, but annotations already signal read-only safety. Overall, it is reasonably complete.

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 100% with parameter descriptions, but the tool description adds significant context: it explains the operators supported (from:, since:, min_faves:), provides example queries, clarifies default for count, and describes product values beyond the enum names.

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 clearly states the tool searches recent tweets using X's advanced-search operators. It specifies the verb 'search' and the resource 'recent tweets', and distinguishes itself from siblings like twitter_home_timeline and twitter_user_tweets by focusing on advanced operators.

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?

The description provides clear context on when to use product values ('Latest' for chronological, 'Top' for engagement-ranked) and includes example queries. However, it does not explicitly exclude alternatives like twitter_user_search or state when not to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TwitterAPIs/twitterapis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server