clear_chat_history
Clear chat history to manage conversation context and reset session data for improved AI interactions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | No | default |
Implementation Reference
- src/server.py:79-85 (handler)Implementation of the clear_chat_history tool, which deletes the JSON file associated with a chat session.
@mcp.tool() async def clear_chat_history(session: str = "default"): path = Path("chats") / f"{session}.json" if not path.exists(): return f"No session `{session}` found." path.unlink() return f"Cleared history for session `{session}`."