Skip to main content
Beyond live search, Grok’s Responses API offers two more server-side tools: code execution (code_interpreter, a server-side Python sandbox) and Remote MCP (xAI’s servers connect directly to an MCP server you specify). Both are verified working on APIYI (July 13, 2026, UTC+8) with a default-group key.

Code Execution

The model writes Python and actually runs it in xAI’s server-side sandbox — ideal for exact computation and data processing. In testing we asked for 2 to the power of 100: the model executed print(2 ** 100) and returned the exact value (big-integer math that pure language models routinely get wrong; code execution is exact):
Measured latency for a single code-execution task: ~6 s. usage.server_side_tool_usage_details.code_interpreter_calls records the execution count.

Remote MCP Tools

Declare an external MCP server in the request and xAI’s servers automatically connect, list its tools, and call them as needed — no local MCP client required. Verified connecting to a public MCP server and completing a tool call (~16 s):
  • The MCP server must be publicly reachable: connections originate from xAI’s servers; intranet / localhost addresses won’t work.
  • Mind data security: your conversation content is sent through xAI’s servers to that MCP server — only connect services you trust.
  • External server availability is outside APIYI’s control; on failures, check the server’s status first.

Collections Search (RAG) — Not Available

xAI also offers a collections_search (knowledge-base retrieval / file_search) tool. It is not usable on APIYI: it requires files uploaded and collections built in the xAI console beforehand, and APIYI runs in key-pool mode with no upstream console access. In testing the request passes through but retrieval inevitably fails (file_search_call returns failed). For RAG, build retrieval on your side (vector store + inject recalled content into the prompt), leveraging Grok’s 1M context and automatic caching.

FAQ

Yes. The tools array can include web_search / x_search / code_interpreter / mcp together; the model decides which to call per task. usage.server_side_tool_usage_details counts each separately.
The sandbox targets computation (Python math / data processing) and cannot access your local files. For external data, combine it with web_search or MCP tools.
Model-side reasoning tokens are billed normally. Tool call fees follow APIYI tool pricing and your actual billing statement — validate with small volumes before scaling up.

Web & X Search

The live-search tools on the same Responses API

Grok Overview

Model lineup, pricing, and the full capability-boundary table