Skip to main content
Glama

x_search

Search X posts, profiles, and threads to get cited answers on current discussions, reactions, and account context. Filter by date or handles and set search depth to keep queries precise.

Instructions

Search X posts, profiles, and threads with xAI's server-side X Search (Grok reads the posts and answers with citations). Handles Chinese queries well. Use for current X discussion, reactions, and account or thread context. Billing is per post fetched, so precise queries give better results for the same cost. If a call times out or returns no citations: do not resend the same query. Narrow it (date range, specific accounts, fewer topics per query), split it into sub-questions, then cross-check with another source (Exa, web search, or the X website in a logged-in browser). If the error says credits ran out, stop calling this tool and use those other sources.

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>"
    },
    "name": "x_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNostandard: grok-4.7, one agent, for looking up facts and normal research. deep: grok-4.20-multi-agent with 4 agents searching and cross-checking in parallel. Start every important decision here (money, career, strategy). deep_max: 16 agents. Choose it by the shape of the question, not by its importance: escalate when the question splits into 4 or more independent sub-questions, when a deep run returns conflicting claims or too few citations to support a conclusion, or when the user asks for maximum depth. More agents add little to a narrow question. Cost grows with agents because every agent fetches posts.standard
queryYesWhat to look up on X.
to_dateNoOptional end date, YYYY-MM-DD, exclusive.
from_dateNoOptional start date, YYYY-MM-DD.
reasoning_effortNoOnly for depth=standard. low for a quick fact, high (default) for normal research, xhigh for hard synthesis.high
allowed_x_handlesNoOnly search posts from these accounts, without @ (max 20). Cannot be combined with excluded_x_handles.
excluded_x_handlesNoIgnore posts from these accounts, without @ (max 20).
enable_image_understandingNoWhether xAI should analyze images attached to matching X posts.
enable_video_understandingNoWhether xAI should analyze videos attached to matching X posts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so: per-post billing, cost scaling with agent count, citation-producing behavior, Chinese query handling, and a precise failure-mode protocol for timeouts, empty citations, and exhausted credits. This is exactly the operational context an agent needs before calling a paid, non-deterministic search tool.

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?

Purpose and use cases are front-loaded, followed by cost and failure handling in a logical order; nearly every sentence carries distinct information. It is on the long side and the error-handling sentences are dense, but nothing is filler.

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, and the description compensates by explaining that results come back as cited answers and what an empty-citation result implies. For a 9-parameter, paid, multi-agent search tool with no annotations, the definition covers cost, escalation, and recovery paths completely.

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 description coverage is 100% and the depth and reasoning_effort enums are already thoroughly documented in the schema, so the description does not need to restate them. It adds only an indirect signal — that precise queries improve results at the same cost — without explaining individual parameters. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource — search X posts, profiles, and threads — and explains the mechanism (Grok reads the posts and answers with citations), which is well beyond a restatement of the name. It does not explicitly distinguish itself from the sibling x_search_status, so it falls just short of a 5.

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?

It names the use cases directly (current X discussion, reactions, account or thread context) and gives explicit when-not guidance: do not resend an identical query after a timeout or empty citations, and stop calling entirely if credits run out. It names concrete alternatives (Exa, web search, logged-in X website) with the conditions that select them.

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

Deploy Server

Other Tools