Skip to main content
Glama

reset_session

Clear the current session for a workspace to start fresh with Gemini AI, removing previous context and interactions.

Instructions

Reset (clear) the ACP session for a workspace. The next gemini call for this workspace will create a fresh session. Pass workspace path, or omit to reset all sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceNoWorkspace path to reset. Empty string resets all sessions.

Implementation Reference

  • The `reset_session` tool handler function, which clears MCP sessions for a specific workspace or all workspaces.
    async def reset_session(
        workspace: Annotated[
            str,
            Field(description="Workspace path to reset. Empty string resets all sessions."),
        ] = "",
    ) -> Dict[str, Any]:
        """Reset session for a workspace or all sessions."""
        if workspace:
            removed = _bridge._sessions.pop(workspace, None)
            if not removed:
                # Try matching by suffix (user might pass partial path)
                matched = [k for k in _bridge._sessions if k.endswith(workspace)]
                if matched:
                    for k in matched:
                        _bridge._sessions.pop(k)
                    return {"reset": matched, "count": len(matched)}
                return {
                    "reset": [],
                    "count": 0,
                    "message": "No session found for workspace",
                }
            return {"reset": [workspace], "count": 1}
        else:
            count = len(_bridge._sessions)
            _bridge._sessions.clear()
            return {"reset": "all", "count": count}
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/shenyunhuan/gemini_mcp'

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