Skip to main content
Glama

stateful_chat

Continue conversations with Grok AI by sending only new prompts, using stored response IDs to maintain context across multiple interactions.

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-1-fast-reasoning`).
    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-1-fast-reasoning
response_idNo
system_promptNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well. It discloses key behavioral traits: server-side storage of conversation history, the need to pass previous_response_id for continuation, that system_prompt is 'Applied only on the first turn,' and the return format includes a new Response ID. It doesn't mention rate limits, authentication needs, or error conditions, but covers the core stateful behavior adequately.

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 well-structured and appropriately sized. It starts with the core purpose, explains the stateful mechanism, provides parameter semantics in a clear Args section, and concludes with return value information. Every sentence earns its place with no redundancy or fluff.

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 moderate complexity (stateful chat with 4 parameters), no annotations, and no output schema, the description does an excellent job. It explains the stateful mechanism, parameter usage, and return format. The main gap is lack of explicit error handling or limitations discussion, but for a chat tool, this is reasonably complete.

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 compensate fully. It provides clear semantic explanations for all 4 parameters: prompt as 'User message to append,' model with default value, response_id as 'ID of the previous response to continue from,' and system_prompt as 'Optional system instruction. Applied only on the first turn.' This adds significant value beyond the bare 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's purpose: 'Continue a server-side stored conversation using xAI's deferred/stateful chat.' It specifies the verb ('continue'), resource ('server-side stored conversation'), and distinguishes it from simpler chat tools by emphasizing stateful/deferred nature. The mention of 'omit response_id to start a new thread' further clarifies its dual functionality.

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 guidance on when to use this tool: 'Omit response_id to start a new thread' and 'The xAI API stores every turn so the client only needs to send the latest prompt plus previous_response_id.' It distinguishes from sibling tools by focusing on stateful conversations rather than stateless chats, though it doesn't explicitly name alternatives like 'chat'.

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