Skip to main content
Glama

grok_agent

Executes tasks with a schema-enforced reflection loop that retries corrections against a strict cost budget, using Grok models.

Instructions

Unified @grok Entry Point: run the thinking route — the ReAct AgentLoop wrapped in a schema-enforced reflection loop — with explicit retry and budget caps.

Args: prompt: Task or question for the agent. session: Optional session name for persistent history in chats. model: Grok model id (default grok-4.3). system_prompt: Optional system instruction prepended to the conversation. max_iterations: Strict cap on reviewer-driven correction retries (default 5). cost_limit: Total budget in USD before hard abort (default 0.50).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNogrok-4.3
promptYes
sessionNo
cost_limitNo
system_promptNo
max_iterationsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
whyNoRouter decision trace (Grok-native).auto
textNoHuman-formatted output (includes footers, citations, cost summary).
modelYesActual executing model ID (e.g. 'grok-4.5').
planeNoAPI
routeYesHigh-level route (fast/agentic/research/etc.).
traceNoMulti-agent step trace (for grok_agent research mode).
tokensNoTotal tokens consumed.
profileNoInternal routing profile.
cost_usdNoExact USD cost from xAI billing metadata.
degradedNoTrue if fallback occurred.
responseYesRaw model output or primary content.
citationsNoNative xAI/X citations with URL + snippet.
latency_secNo
finish_reasonNounknown
reasoning_effortNoGrok 4.5+ native reasoning level.
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the iterative nature ('reviewer-driven correction retries'), budget caps ('cost_limit'), and retry caps ('max_iterations'). This gives good insight into behavior, though it does not mention permissions, side effects, or resource cleanup.

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 concise at one sentence plus parameter bullet points, and the key summary is front-loaded. It could be slightly trimmed, but it is well-structured and easy to read.

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?

Given the tool's complexity (6 parameters, no annotations) and the existence of an output schema, the description covers the tool's purpose, parameters, and the retry/budget mechanism. It is mostly complete, though it omits behavior when parameters are omitted or the response format.

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%, but the description compensates fully with detailed parameter explanations. Each parameter is described with its role and default, e.g., 'session: Optional session name for persistent history in chats' and 'max_iterations: Strict cap on reviewer-driven correction retries (default 5).' This adds significant meaning beyond the schema's type/default.

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 description clearly states 'Unified @grok Entry Point: run the thinking route — the ReAct AgentLoop wrapped in a schema-enforced reflection loop — with explicit retry and budget caps.' This provides a specific verb and resource, distinguishing it as the main agent entry point for grok. However, it does not explicitly differentiate from the sibling tool 'agent', which may be a simpler agent loop.

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

Usage Guidelines2/5

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

The description lacks any guidance on when to use this tool versus alternatives. There is no mention of when to use grok_agent over other tools like 'agent', 'chat', or 'stateful_chat'. No exclusions or prerequisites are 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/djtelicloud/grok-mcp-server'

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