Skip to main content
Glama

chat

Send a text prompt to a Grok model and return its reply, optionally preserving session history and system instructions.

Instructions

Send a text prompt to a Grok model and return its reply.

Replays prior turns from `chats/{session}.json` when a session is given,
then appends the new user message and saves the round trip.

Args:
    prompt: User message to send to the model.
    session: Optional session name. Loads and appends history to `chats/{session}.json`.
    model: Grok model id (default `grok-4.6`).
    system_prompt: Optional system instruction prepended to the conversation.
    agent_count: 4 or 16. Only valid with `grok-4.20-multi-agent` for multi-agent research.
    service_tier: `"default"` or `"priority"`. Priority is processed faster at a higher token price.
    guidelines: Moderation settings like `{"violence": "decline"}`. Categories are `nsfw`,
        `violence` and `profanity`. Doesn't work with multi-agent models.
    show_usage: Append a token usage and cost footer to the reply (default False).

Returns:
    The assistant's reply text, plus a token usage and cost footer when `show_usage` is true.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "chat"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNogrok-4.6
promptYes
sessionNo
guidelinesNo
show_usageNo
agent_countNo
service_tierNo
system_promptNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / guidelines
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Guidelines"
      +}
  2. Changed2 schema fields changedv1.0.4
    • changedInput schema / properties / model / default
      Previous value: -"grok-4.3"New value: +"grok-4.6"
    • addedInput schema / properties / service_tier
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Service Tier"
      +}
  3. Changed1 schema field changedv1.0.1
    • addedInput schema / properties / show_usage
      Added value: +{
      +  "default": false,
      +  "title": "Show Usage",
      +  "type": "boolean"
      +}
  4. Added
  5. Removed
  6. Added
  7. Removed
  8. Changed1 schema field changed
    • addedInput schema / properties / agent_count
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Agent Count"
      +}
  9. Added
  10. Removed
  11. Changed1 schema field changed
    • changedInput schema / properties / model / default
      Previous value: -"grok-4"New value: +"grok-4-1-fast-reasoning"
  12. Changed2 schema fields changed
    • addedInput schema / properties / session
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Session"
      +}
    • removedInput schema / properties / store_messages
      Removed value: -{
      -  "default": false,
      -  "title": "Store Messages",
      -  "type": "boolean"
      -}
  13. Changed11 schema fields changed
    • removedInput schema / properties / frequency_penalty
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Frequency Penalty"
      -}
    • removedInput schema / properties / max_tokens
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Max Tokens"
      -}
    • changedInput schema / properties / model / default
      Previous value: -"grok-4-1-fast-non-reasoning"New value: +"grok-4"
    • removedInput schema / properties / presence_penalty
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Presence Penalty"
      -}
    • removedInput schema / properties / reasoning_effort
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Reasoning Effort"
      -}
    • removedInput schema / properties / stop
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Stop"
      -}
    • addedInput schema / properties / store_messages
      Added value: +{
      +  "default": false,
      +  "title": "Store Messages",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / temperature
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Temperature"
      -}
    • removedInput schema / properties / top_p
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "number"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Top P"
      -}
    • removedInput schema / properties / use_conversation_history
      Removed value: -{
      -  "default": false,
      -  "title": "Use Conversation History",
      -  "type": "boolean"
      -}
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "chatOutput",
      -  "type": "object"
      -}New value: +null
  14. Changed2 schema fields changedv1.0.0
    • changedInput schema / properties / model / default
      Previous value: -"grok-4-fast"New value: +"grok-4-1-fast-non-reasoning"
    • addedInput schema / title
      Added value: +"chatArguments"
  15. First observed

TDQS

A3.9/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 does well: it discloses the side effect (appends the new user message and saves the round trip to `chats/{session}.json`), the pricing consequence of service_tier=priority, and two hard compatibility constraints (agent_count only valid with grok-4.20-multi-agent; guidelines doesn't work with multi-agent models). What it omits is auth requirements, rate limits, and what happens if a named session file does not exist.

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 opening sentence front-loads purpose, the second paragraph covers session side effects before any parameter list, and each Args line states a distinct fact without restating the schema. There is no filler or repetition.

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 an 8-parameter, no-annotation, no-output-schema tool the description covers purpose, side effects, return value (reply text plus an optional usage/cost footer), and parameter constraints. The remaining holes are operational rather than structural: no error behavior for missing sessions and no model-selection guidance.

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

Parameters4/5

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

Schema description coverage is 0% across 8 parameters, so the description must compensate and largely does: every parameter gets meaning, including allowed agent_count values (4 or 16), service_tier values with a cost tradeoff, moderation categories (nsfw, violence, profanity), and the effect of show_usage on output. Gaps remain on the model parameter (only the default is given, no guidance to consult list_models) and on the exact shape of the guidelines mapping.

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?

"Send a text prompt to a Grok model and return its reply" names a concrete verb and resource, and the word "text" implicitly separates it from chat_with_vision and chat_with_files. It stops short of naming any sibling explicitly, so an agent must infer the boundary rather than read it.

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 explains the mechanics of session replay but never states when to pick this tool over chat_with_files, chat_with_vision, stateful_chat, or grok_agent. Usage is implied by capability (text-only prompting with optional history), not by an explicit selection rule or exclusion.

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