Skip to main content
Glama

grok_agent

Answer questions by combining files, vision, web and X search, and code execution. The agent autonomously selects tools per turn.

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`.
    show_usage: Append a token usage and cost footer to the answer (default False).

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

Input Schema

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

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

No annotations exist, so the description carries the full burden. It details agent decision-making, session persistence, multi-agent support, and constraints like allowed_domains max 5. However, it omits operational details like cost, rate limits, or latency implications.

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 structured with a summary, Args list, and Returns section. While clear, the Args list is lengthy (23 parameters) and could be more concise with grouping or bullet points. Still front-loaded with the core purpose.

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?

With 23 parameters, 0% schema coverage, no annotations, and no output schema, the description provides exhaustive detail on each parameter, constraints, session management, multi-agent, and return format. Covers all necessary context for an agent.

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 has 0% description coverage, so the description must compensate. It provides a detailed Args section explaining each parameter's purpose, including mutex relationships (e.g., allowed_domains vs excluded_domains) and defaults.

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?

Starts with 'All-in-one Grok agent combining files, vision, web/X search, and code execution.' Clearly identifies the tool as a comprehensive multi-tool agent, distinguishing it from siblings like chat, web_search, and x_search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage as a combined agent but does not explicitly state when to choose grok_agent over individual tools (e.g., web_search, x_search). No when-not-to-use or alternative comparisons provided.

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