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
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | No | Workspace path to reset. Empty string resets all sessions. |
Implementation Reference
- src/geminimcp/server.py:1007-1032 (handler)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}