list_sessions
View all active Gemini ACP sessions to monitor workspace paths, session IDs, turn counts, and models in use.
Instructions
List all active ACP sessions managed by the bridge. Shows workspace path, session ID, turn count, and model for each session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/geminimcp/server.py:963-990 (handler)The list_sessions tool implementation in server.py, which registers the tool and defines the handler function to list active sessions from the bridge.
@mcp.tool( name="list_sessions", annotations=ToolAnnotations( title="List Active Sessions", readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False, ), description="List all active ACP sessions managed by the bridge. " "Shows workspace path, session ID, turn count, and model for each session.", ) async def list_sessions() -> Dict[str, Any]: """List active sessions.""" sessions = [] for workspace, info in _bridge._sessions.items(): sessions.append( { "workspace": workspace, "session_id": info["session_id"], "turn_count": info["turn_count"], "max_turns": _MAX_TURNS_PER_SESSION, "model": info.get("actual_model", ""), } ) return { "sessions": sessions, "count": len(sessions),