Skip to main content
Glama

grok_agent

Enable any combination of tools—web search, X search, code execution, file and image analysis—and let the agent choose the best approach for each task.

Instructions

All-in-one Grok agent combining files, vision, web/X search, and code execution.

Enable any subset of tools and attach any mix of uploaded files and images.
The agent decides which tools to use per turn. Supports optional local
session history and multi-agent research via `agent_count`.

Args:
    prompt: Task or question for the agent.
    session: Optional session name for persistent history in `chats/{session}.json`.
    model: Grok model driving the agent (default `grok-4.3`).
    file_ids: IDs of previously uploaded files to attach as context.
    image_urls: Public image URLs to attach.
    image_paths: Local image files to attach (sent as base64 data URIs).
    use_web_search: Enable the agentic web search tool.
    use_x_search: Enable the agentic X (Twitter) search tool.
    use_code_execution: Enable the Python code execution tool.
    allowed_domains: Web search allow-list (max 5, mutually exclusive with excluded).
    excluded_domains: Web search deny-list (max 5).
    allowed_x_handles: X search handle allow-list (max 10, mutually exclusive with excluded).
    excluded_x_handles: X search handle deny-list (max 10).
    from_date: X search inclusive start date as `DD-MM-YYYY`.
    to_date: X search inclusive end date as `DD-MM-YYYY`.
    enable_image_understanding: Let search tools analyze images they encounter.
    enable_video_understanding: Let X search analyze videos in posts.
    enable_image_search: Let web search find and return image results.
    include_inline_citations: Embed `[1]`-style citation markers into the answer.
    system_prompt: Optional system instruction prepended to the conversation.
    max_turns: Cap the agent's reasoning/tool turns.
    agent_count: 4 or 16. Only valid with `grok-4.20-multi-agent`.

Returns:
    Markdown with the answer body followed by a `**Sources:**` list when citations exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
sessionNo
modelNogrok-4.3
file_idsNo
image_urlsNo
image_pathsNo
use_web_searchNo
use_x_searchNo
use_code_executionNo
allowed_domainsNo
excluded_domainsNo
allowed_x_handlesNo
excluded_x_handlesNo
from_dateNo
to_dateNo
enable_image_understandingNo
enable_video_understandingNo
enable_image_searchNo
include_inline_citationsNo
system_promptNo
max_turnsNo
agent_countNo
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the agent chooses tools per turn, supports session history, and multi-agent via agent_count. It also describes the return format (Markdown with Sources). While it doesn't mention rate limits or authentication, the behavioral traits are adequately covered.

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?

The description is well-structured with a summary, Args list, and Returns section. Every sentence serves a purpose. It is slightly verbose but remains clear and front-loaded with key information.

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?

Given the tool's complexity (22 params, no output schema, no annotations), the description is remarkably complete. It covers all parameters, behavior, and return format, leaving no critical gaps for an AI agent to understand invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides meaningful explanations for all 22 parameters, including defaults and constraints (e.g., 'max 5' for allowed_domains). Since schema description coverage is 0%, this adds significant value beyond the schema titles, though some parameter constraints could be more precise.

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's purpose as an 'All-in-one Grok agent combining files, vision, web/X search, and code execution.' This specific verb+resource combination distinguishes it from sibling tools like chat, web_search, and code_executor, which are individual capabilities.

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 explains how to enable subsets of tools and attach files/images, and that the agent decides tool usage per turn. It also mentions optional session history and multi-agent research. However, it does not explicitly specify when to use this tool versus individual siblings, leaving some implicit inference.

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/merterbak/Grok-MCP'

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