Skip to main content
Glama

grok_agent

Answers prompts by combining web and X search, code execution, file and image analysis, and image generation. Enable only the tools each task needs and attach files, images, or URLs.

Instructions

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

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.6`).
    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.
    use_image_generation: Enable the server-side image generation tool, letting the agent
        create and edit images mid-conversation. Images are saved under `images/`.
    image_generation_action: Which image capabilities to expose: `"auto"` (default, generate
        and edit), `"generate"` (text-to-image only), or `"edit"` (editing only).
    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`.
    service_tier: `"default"` or `"priority"`. Priority is processed faster at a higher token price.
    show_usage: Append a token usage and cost footer to the answer (default False).

Returns:
    Markdown with the answer body, then a `**Generated Images:**` list of saved file paths
    when the agent produced images, then a `**Sources:**` list when citations exist.

Input Schema

NameRequiredDescriptionDefault
modelNogrok-4.6
promptYes
sessionNo
to_dateNo
file_idsNo
from_dateNo
max_turnsNo
image_urlsNo
show_usageNo
agent_countNo
image_pathsNo
service_tierNo
use_x_searchNo
system_promptNo
use_web_searchNo
allowed_domainsNo
excluded_domainsNo
allowed_x_handlesNo
excluded_x_handlesNo
use_code_executionNo
enable_image_searchNo
use_image_generationNo
image_generation_actionNo
include_inline_citationsNo
enable_image_understandingNo
enable_video_understandingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.4
  2. Removed
  3. Changed1 schema field changedv1.0.1
    • addedInput schema / properties / show_usage
      Added value: +{
      +  "default": false,
      +  "title": "Show Usage",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / enable_image_search
      Added value: +{
      +  "default": false,
      +  "title": "Enable Image Search",
      +  "type": "boolean"
      +}
  5. Added
  6. Removed
  7. Added
  8. Removed
  9. Changed1 schema field changed
    • addedInput schema / properties / agent_count
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Agent Count"
      +}
  10. Added
  11. Removed
  12. Changed1 schema field changed
    • changedInput schema / properties / model / default
      Previous value: -"grok-4-1-fast"New value: +"grok-4-1-fast-reasoning"
  13. Changed1 schema field changed
    • addedInput schema / properties / session
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Session"
      +}
  14. Added

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and discharges much of it: it discloses session persistence to chats/{session}.json, image output saved under images/, mutual-exclusivity and max-count constraints on domain/handle lists, the agent_count validity restriction, and that priority tier costs more. Auth requirements, rate limits, and cost magnitude remain unstated, so it falls short of a 5.

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?

Front-loaded one-line summary followed by a short behavioral note and a clearly structured Args/Returns block. It is long, but the 26-parameter surface justifies the length and the sectioning makes it scannable; only the middle paragraph is slightly loose.

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?

For a 26-parameter, no-annotation, no-output-schema tool this is thorough: it explains the tool's scope, how to configure each capability toggle, parameter constraints and formats, and explicitly describes the return payload (answer body, Generated Images list, Sources list). An agent has everything needed to call it correctly.

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 description coverage is 0%, so the description must carry all 26 parameters — and it does, documenting every one. It adds meaning the schema cannot: DD-MM-YYYY date formats, 'max 5' / 'max 10' limits, mutually-exclusive pairs, the three image_generation_action modes, service_tier values, and the 4-or-16 constraint on agent_count.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line states a specific verb+resource combination: an all-in-one agent that bundles files, vision, web/X search, code execution and image generation. The 'all-in-one' framing implicitly separates it from single-capability siblings (web_search, x_search, chat_with_vision, generate_image), but it never names them or states the routing rule explicitly.

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?

'Enable any subset of tools and attach any mix of uploaded files and images. The agent decides which tools to use per turn' tells the agent how to configure the call but not when to choose this tool over the specialized siblings. No exclusions or alternative-naming is present, so usage is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.