Skip to main content
Glama

delete_stateful_response

Permanently remove stateful conversation responses from xAI servers for privacy protection and data cleanup. Once deleted, responses cannot be retrieved.

Instructions

Permanently deletes a stateful conversation response from xAI's servers. Use this when you want to remove a conversation for privacy or cleanup purposes. Once deleted, you won't be able to retrieve it or continue from it. This is permanent, so make sure you really want to delete it! Args: response_id: The ID of the response you want to delete Returns a dict confirming the deletion with 'response_id', 'deleted' (True/False), and a confirmation message.

Input Schema

NameRequiredDescriptionDefault
response_idYes

Input Schema (JSON Schema)

{ "properties": { "response_id": { "title": "Response Id", "type": "string" } }, "required": [ "response_id" ], "type": "object" }

Implementation Reference

  • The core handler function for the 'delete_stateful_response' tool. It is registered via the @mcp.tool() decorator. The function sends a DELETE request to the xAI API endpoint `/v1/responses/{response_id}` to delete the specified stateful response and returns a confirmation dictionary with the response ID, deletion status, and message.
    @mcp.tool() async def delete_stateful_response(response_id: str): """ Permanently deletes a stateful conversation response from xAI's servers. Use this when you want to remove a conversation for privacy or cleanup purposes. Once deleted, you won't be able to retrieve it or continue from it. This is permanent, so make sure you really want to delete it! Args: response_id: The ID of the response you want to delete Returns a dict confirming the deletion with 'response_id', 'deleted' (True/False), and a confirmation message. """ client = create_client(use_state=True) response = await client.delete(f"/v1/responses/{response_id}") response.raise_for_status() data = response.json() await client.aclose() return { "response_id": data.get("id"), "deleted": data.get("deleted", False), "message": f"Response {response_id} deleted from xAI servers" }

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