Skip to main content
Glama

grok_chat_completions

Create chat completions using Grok models. Send messages to receive text, vision, and tool-calling responses through the AceDataCloud API.

Instructions

Create a Grok (xAI) chat completion via the AceDataCloud Grok API.

Sends messages to a Grok chat model and returns the generated response in the
OpenAI-compatible chat completion format.

Use this when:
- You want to chat/reason with a Grok model (grok-4 / grok-3 family)
- You need vision/image understanding
- You need tool/function calling with Grok

For generating videos, use grok_text_to_video / grok_image_to_video instead.

Returns:
    JSON response containing the chat completion result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoRandom seed for (best-effort) deterministic sampling.
stopNoStop sequences where the API will stop generating tokens.
userNoEnd-user identifier for abuse monitoring.
modelNoThe Grok chat model: grok-4.5 (default, latest flagship), grok-4 or grok-3.grok-4
toolsNoList of tools (functions) the model may call.
top_pNoNucleus sampling probability mass. Default 1.
streamNoWhether to stream partial message deltas. Default False.
messagesYesConversation messages. Each message is a dict with 'role' ('system'/'user'/'assistant'/'tool') and 'content' keys. Content may be a list of text/image_url parts for image input. Required.
max_tokensNoMaximum number of tokens to generate.
temperatureNoSampling temperature between 0 and 2. Higher = more random.
tool_choiceNoControls tool calling. 'none', 'auto', 'required', or a dict.
response_formatNoResponse format specification (e.g. {"type": "json_object"}).
presence_penaltyNoPresence penalty between -2.0 and 2.0. Positive increases topic variety.
reasoning_effortNoReasoning effort. Only applies to reasoning-capable models; ignored by non-reasoning models.
frequency_penaltyNoFrequency penalty between -2.0 and 2.0. Positive decreases repetition.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It states it sends messages and returns a JSON response in OpenAI-compatible format. However, it does not disclose error handling, rate limits, or authentication requirements. The behavior is adequately described but lacks depth for a production tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (~80 words) with a clear structure: purpose, usage conditions, alternatives, and return format. Every sentence contributes meaning, and it is front-loaded with the main action.

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?

With 15 parameters, 100% schema coverage, and an output schema present, the description provides sufficient context for a chat completion tool. It covers usage guidance and return format. It could mention error handling or pagination, but for the complexity it is adequately complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds minimal extra meaning beyond the schema: it notes the 'messages' role structure and content flexibility, and that 'reasoning_effort' only applies to reasoning models. This provides some added context but does not significantly enhance understanding 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 clearly states the tool creates a Grok chat completion with specific verb 'Create' and resource 'chat completion'. It distinguishes from sibling tools by explicitly mentioning alternatives for video generation (grok_text_to_video / grok_image_to_video).

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 provides explicit when-to-use scenarios: 'Use this when: you want to chat/reason with a Grok model, need vision/image understanding, need tool/function calling with Grok.' It also tells when not to use it by mentioning alternatives, offering clear guidance.

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/AceDataCloud/GrokMCP'

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