Skip to main content
Glama

grok_agent

Process tasks using an AI agent that combines file analysis, vision capabilities, web and X search, and code execution to generate comprehensive answers.

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-1-fast-reasoning`).
    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-1-fast-reasoning
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 provided, the description carries the full burden of behavioral disclosure. It describes the agent's decision-making process ('The agent decides which tools to use per turn'), mentions session persistence, and outlines multi-agent capabilities. However, it doesn't cover important behavioral aspects like rate limits, authentication requirements, error handling, or performance characteristics that would help an agent use it effectively.

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 clear overview sentence, followed by usage context, and then detailed parameter documentation. While comprehensive for a complex tool, some sentences could be more concise (e.g., the first sentence is somewhat redundant). The information is front-loaded with the most important concepts first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 21-parameter tool with no annotations and no output schema, the description does an excellent job explaining parameters and basic behavior. However, it lacks information about the return format beyond mentioning markdown with citations, doesn't explain error conditions, and omits performance/limitation details that would be helpful for an AI 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?

With 0% schema description coverage and 21 parameters, the description provides extensive parameter documentation in the 'Args' section that adds crucial meaning beyond the bare schema. Each parameter is explained with purpose, constraints (like 'max 5', 'mutually exclusive'), default values, and format requirements (e.g., 'DD-MM-YYYY'). This fully compensates for the schema's lack of descriptions.

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 this is an 'all-in-one Grok agent' that combines multiple capabilities (files, vision, web/X search, code execution). It specifies the agent decides which tools to use per turn, distinguishing it from simpler chat tools in the sibling list like 'chat' or 'chat_with_files' which don't have this autonomous agentic behavior.

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 provides clear context about when to use this tool ('Enable any subset of tools and attach any mix of uploaded files and images'), but doesn't explicitly state when NOT to use it or name specific alternatives from the sibling list. It implies this is for complex multi-capability tasks but doesn't contrast with simpler tools like 'chat' or single-function tools like 'web_search'.

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