Skip to main content
X Search lets a Grok-powered agent search posts and content on X, formerly Twitter, while it responds.

What it does

This tool uses xAI’s native x_search capability. It can help an agent find recent posts, discussions, and threads on X without connecting a separate MCP server.

Requirements

X Search is only available when your agent is configured to use an xAI (Grok) model. When your agent uses a different model provider, use GPT Search, Google Search, or xAI Web Search where appropriate.

Adding the tool to an agent

  1. Open an agent in the editor.
  2. Make sure the agent’s model is set to an xAI Grok model.
  3. Click the button with the tooltip Add MCP Tool or Sub Agent.
  4. In MCP Tools, click X Search.

Configuration

X Search settings are configured in the MCP tool settings sheet:
ParameterDescription
allowed_x_handlesOnly consider posts from specific X handles (max 20). The default is blank.
excluded_x_handlesExclude posts from specific X handles (max 20). The default is blank.
included_domainsPrefer or limit linked content to specific domains (max 20). The default is blank.
excluded_domainsExclude linked content from specific domains (max 20). The default is blank.
from_dateStart date for search range (YYYY-MM-DD). The default is blank.
to_dateEnd date for search range (YYYY-MM-DD). The default is blank.
enable_image_understandingEnable analysis of images in posts. The default is disabled.
enable_video_understandingEnable analysis of videos in posts. The default is disabled.
Notes:
  • Allowed X Handles and Excluded X Handles are mutually exclusive.
  • Dates must be valid ISO date strings (YYYY-MM-DD).

Use cases

  • Monitor what people are saying about a company, product, topic, or event on X.
  • Find recent posts and threads before answering a time-sensitive question.
  • Gather social context and public reactions from X content.

Billing

X Search is billed at $0.005 per completed request/tool call.

Notes

  • X Search searches X/Twitter posts and content. For public web results from Grok, use xAI Web Search.
  • This tool is powered by xAI’s native x_search capability, not an external MCP server.
  • Use Chat in the editor to see when the agent calls X Search during a test run. See Testing with Chat.