Skip to main content
Glama

stateful_chat

Continue a saved conversation by appending new messages with optional system instructions. Uses xAI's stateful chat to maintain context across requests.

Instructions

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

Args: prompt: User message to append. model: Grok model id (default grok-4.3). response_id: ID of the previous response to continue from. system_prompt: Optional system instruction.

Returns: ChatResult containing execution metadata and responses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNogrok-4.3
promptYes
response_idNo
system_promptNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoHuman-formatted output (includes footers, citations, cost summary).
modelYesActual executing model ID (e.g. 'grok-4.5').
planeNoAPI
routeYesHigh-level route (fast/agentic/research/etc.).
tokensNoTotal tokens consumed.
profileNoInternal routing profile.
sessionNoPersistent session name.
cost_usdNoExact USD cost from xAI billing metadata.
responseYesRaw model output or primary content.
citationsNoNative xAI/X citations with URL + snippet.
latency_secNo
response_idNoServer-side stateful ID for continuation.
finish_reasonNounknown
reasoning_effortNoGrok 4.5+ native reasoning level.
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the stateful, server-side stored nature and that a response_id is needed to continue. It also states the return type (ChatResult). While it doesn't detail all side effects or auth needs, it provides essential behavioral context beyond the input schema.

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 and well-structured, with a clear opening sentence defining the tool's purpose, followed by an Args/Returns section. Every sentence serves a purpose, and there is no redundancy or unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description covers the basic purpose and parameters, it lacks guidance on prerequisites (e.g., obtaining a response_id from a previous call) and does not explain behavior when response_id is null. Given that an output schema exists, the return type is mentioned but not detailed. The completeness is adequate but not fully robust for a stateful tool.

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%, so the description compensates by explaining each parameter in the Args block: 'prompt: User message to append,' 'model: Grok model id (default grok-4.3),' 'response_id: ID of the previous response to continue from,' and 'system_prompt: Optional system instruction.' These add meaningful context beyond the schema's type definitions.

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 'Continue a server-side stored conversation using xAI's stateful chat,' which is a specific verb+resource combination. This distinguishes it from sibling tools like 'chat' (which likely starts a new conversation) and 'chat_with_files' by emphasizing the stateful and server-side stored nature.

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?

The description implicitly guides when to use this tool by specifying 'continue a server-side stored conversation,' indicating it is for ongoing conversations requiring a response_id. However, it does not explicitly mention alternatives for starting new conversations or when not to use this tool, which would be beneficial.

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/djtelicloud/grok-mcp-server'

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