Skip to main content
Glama

list_sessions

Read-onlyIdempotent

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
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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),
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds valuable return-value context beyond annotations: specifically enumerates returned fields (workspace path, session ID, turn count, model). Also clarifies scope ('managed by the bridge') complementing openWorldHint=false. Does not contradict safety annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero waste. First sentence establishes operation, second previews return payload. Information density is optimal with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Fully adequate for a zero-parameter listing tool. Preview of output fields (despite existence of output schema) provides helpful context without being redundant. Annotations cover behavioral safety profile.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters present, meeting the baseline score of 4. The description correctly avoids parameter discussion since none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Excellent specificity: 'List' (verb) + 'active ACP sessions' (resource) + 'managed by the bridge' (scope). Implicitly distinguishes from sibling 'reset_session' (list vs modify) and 'list_models' (sessions vs models).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States what it does clearly, providing implied usage context, but lacks explicit when-to-use guidance or contrasts with 'reset_session' (e.g., 'use this before resetting to verify session ID').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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