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
| Name | Required | Description | Default |
|---|---|---|---|
| response_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"response_id": {
"title": "Response Id",
"type": "string"
}
},
"required": [
"response_id"
],
"type": "object"
}
Implementation Reference
- src/server.py:646-674 (handler)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" }