Skip to main content
Glama

clear_chat_history

Clear chat history to manage conversation context and reset session data for improved AI interactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionNodefault

Implementation Reference

  • 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}`."

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