Skip to main content
Glama

x_search

Read-only

Search X (Twitter) posts, threads, and users, filter by handle or date range, and optionally analyze attached images or videos to answer queries.

Instructions

Answer a query using agentic search over X (Twitter).

Searches posts, threads, and users on X. Can filter by handle allow/deny
lists and a date range, and optionally analyze images/videos attached to posts.

Args:
    prompt: Search query or question about X content.
    model: Grok model driving the agent (default `grok-4.6`).
    allowed_x_handles: Restrict search to these handles (max 10, mutually exclusive with excluded).
    excluded_x_handles: Exclude these handles (max 10).
    from_date: Inclusive start date as `DD-MM-YYYY`.
    to_date: Inclusive end date as `DD-MM-YYYY`.
    enable_image_understanding: Let the agent analyze images in posts.
    enable_video_understanding: Let the agent analyze videos in posts (X Search only).
    include_inline_citations: Embed `[1]`-style citation markers into the answer.
    max_turns: Cap the agent's reasoning/tool turns.
    show_usage: Append a token usage and cost footer to the answer (default False).

Returns:
    Markdown with the answer body followed by a `**Sources:**` list of cited posts.

Input Schema

NameRequiredDescriptionDefault
modelNogrok-4.6
promptYes
to_dateNo
from_dateNo
max_turnsNo
show_usageNo
allowed_x_handlesNo
excluded_x_handlesNo
include_inline_citationsNo
enable_image_understandingNo
enable_video_understandingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.4
  2. Removed
  3. Changed1 schema field changedv1.0.1
    • addedInput schema / properties / show_usage
      Added value: +{
      +  "default": false,
      +  "title": "Show Usage",
      +  "type": "boolean"
      +}
  4. Added
  5. Removed
  6. Added
  7. Removed
  8. Added
  9. Removed
  10. Changed1 schema field changed
    • changedInput schema / properties / model / default
      Previous value: -"grok-4-1-fast"New value: +"grok-4-1-fast-reasoning"
  11. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations provide readOnlyHint=true, so the safety profile is covered. The description adds useful behavioral context beyond that: it returns Markdown with a sources list, supports image/video understanding, inline citations, and a usage/cost footer. It does not discuss rate limits or auth, but goes well beyond the annotation.

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?

Well-structured with a clear intro, Args list, and Returns section. The opening sentence is front-loaded and every entry earns its place. Slightly verbose compared to a terse alternative, but appropriate for eleven parameters.

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?

Complete for a complex 11-parameter tool with no output schema: it explains what the agent searches, all filter options with constraints, optional media analysis, citation behavior, and the return format (Markdown + sources). Nothing an agent needs to call it correctly is missing.

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 description coverage is 0%, so the description must carry the full burden. It documents every one of the 11 parameters with meaning, constraints (max 10 handles, mutual exclusivity, date format DD-MM-YYYY), and behavioral impact, fully compensating for the schema gap.

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: 'Answer a query using agentic search over X (Twitter).' It clearly distinguishes itself from sibling web_search by scoping to X posts, threads, and users, and names the exact resource and behavior (agentic search, image/video analysis).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains what can be searched and filtered, implying when to use it (X content queries, filtered by handles/dates), but does not explicitly state when to choose this over web_search or grok_agent. No when-not or alternative guidance is given.

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