Skip to main content
Glama

stateful_chat

Send a new prompt with a previous response ID to continue a server-stored conversation. Omit the ID to start a fresh thread; the server returns a new ID for subsequent turns.

Instructions

Continue a server-side stored conversation using xAI's deferred/stateful chat.

The xAI API stores every turn so the client only needs to send the latest
prompt plus `previous_response_id`. Omit `response_id` to start a new thread.

Args:
    prompt: User message to append.
    model: Grok model id (default `grok-4.3`).
    response_id: ID of the previous response to continue from (omit to start fresh).
    system_prompt: Optional system instruction. Applied only on the first turn.

Returns:
    Assistant reply followed by the new `**Response ID:**` to pass back next turn.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
modelNogrok-4.3
response_idNo
system_promptNo
Behavior4/5

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

With no annotations, description bears full burden. It discloses server-side storage, the need for only latest prompt, and the behavior of system_prompt (first turn only). Also mentions return format (assistant reply + Response ID). Lacks details on auth or rate limits, but those are standard.

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?

Well-structured with introductory paragraph, bulleted Args, and Returns section. Concise yet thorough, no wasted words.

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 tool with 4 parameters, 1 required, no output schema, description covers all parameters, return format, and stateful behavior. Complete and self-contained.

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?

Despite 0% schema description coverage, the 'Args' section fully describes each parameter: prompt (user message), model (Grok model id with default), response_id (omit to start fresh), system_prompt (optional, first turn only). Adds significant meaning beyond 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?

Describes a specific verb (continue) and resource (server-side stored conversation using xAI's stateful chat). Clearly explains the mechanism (send latest prompt plus previous_response_id) and distinguishes from siblings like 'chat' (stateless) and 'chat_with_files' (multimodal).

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?

Explicitly states when to start a new thread (omit response_id) and that system_prompt applies only on first turn. Provides clear context for usage, though could be stronger by directly contrasting with stateless chat alternatives.

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