Skip to main content
Glama

stateful_chat

Continue a stored conversation by sending the latest prompt and previous response ID. Start a new thread by omitting the response ID.

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.
    show_usage: Append a token usage and cost footer to the reply (default False).

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

Input Schema

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

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

Discloses server-side storage, continuation via response_id, system prompt scoping, and show_usage behavior. No annotations exist, so the description carries the full burden. Lacks mention of error conditions or rate limits.

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?

Efficiently structured with a purpose sentence followed by a labeled bullet list for parameters and returns. No redundant or missing information.

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?

Covers the core functionality and return format, but does not address error handling or boundary conditions (e.g., invalid response_id). Given no output schema, the return description is adequate but could be more detailed.

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?

All 5 parameters are described with behavioral context beyond the schema (which has 0% coverage). Each parameter's role, default, and usage are explained clearly.

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?

Clearly states it continues a server-side stored conversation using stateful chat, differentiating it from stateless chats. However, it does not explicitly contrast with sibling tools like 'chat' or 'chat_with_files'.

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?

Provides guidance on omitting response_id to start a new thread and that system_prompt is only for the first turn. However, it lacks explicit 'when to use this vs alternatives' or exclusions for single-turn queries.

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