Skip to main content
Glama

grok_agent

Answers complex queries by combining file analysis, image understanding, web/X search, and code execution. Supports multi-agent collaboration and persistent history.

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.
    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
include_inline_citationsNo
system_promptNo
max_turnsNo
agent_countNo
Behavior3/5

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

With no annotations, the description carries the burden. It discloses that the agent decides tools, supports sessions, and has constraints on agent_count. However, it does not mention potential destructive actions (e.g., code execution can modify files or systems), rate limits, or required permissions, leaving gaps in transparency.

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-organized with a summary paragraph followed by structured parameter docs. It is slightly verbose (e.g., repeated mentions of capabilities), but the length is justified by the high parameter count. Removing redundant phrases would improve conciseness.

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 (21 parameters, no output schema, no annotations), the description is thorough: it covers parameter details, return format (Markdown with sources), and behavior. Missing edge cases but acceptable for a high-detail tool.

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 coverage is 0%, so the description must fully explain parameters. It provides a detailed Args section with types, defaults, and constraints (e.g., 'allowed_domains: Web search allow-list (max 5, mutually exclusive with excluded)'). This adds substantial meaning beyond the schema.

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 'All-in-one Grok agent combining files, vision, web/X search, and code execution,' which clearly states the tool's purpose and distinguishes it from siblings like chat, web_search, and code_executor. The agent's autonomous tool selection is emphasized.

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?

The description explicitly says 'Enable any subset of tools' and emphasizes the agent decides per turn, guiding when to use this tool over specialized siblings. It also notes that multi-agent mode requires a specific model, providing clear usage conditions.

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