Skip to main content
Glama

list_sessions

View active NotebookLM sessions with stats to identify and resume relevant conversations instead of starting over.

Instructions

List all active sessions with stats (age, message count, last activity). Use to continue the most relevant session instead of starting from scratch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that implements list_sessions tool logic by fetching session stats and details from SessionManager and returning formatted results.
    async handleListSessions(): Promise<
      ToolResult<{
        active_sessions: number;
        max_sessions: number;
        session_timeout: number;
        oldest_session_seconds: number;
        total_messages: number;
        sessions: Array<{
          id: string;
          created_at: number;
          last_activity: number;
          age_seconds: number;
          inactive_seconds: number;
          message_count: number;
          notebook_url: string;
        }>;
      }> 
    > {
      log.info(`🔧 [TOOL] list_sessions called`);
    
      try {
        const stats = this.sessionManager.getStats();
        const sessions = this.sessionManager.getAllSessionsInfo();
    
        const result = {
          active_sessions: stats.active_sessions,
          max_sessions: stats.max_sessions,
          session_timeout: stats.session_timeout,
          oldest_session_seconds: stats.oldest_session_seconds,
          total_messages: stats.total_messages,
          sessions: sessions.map((info) => ({
            id: info.id,
            created_at: info.created_at,
            last_activity: info.last_activity,
            age_seconds: info.age_seconds,
            inactive_seconds: info.inactive_seconds,
            message_count: info.message_count,
            notebook_url: info.notebook_url,
          })),
        };
    
        log.success(
          `✅ [TOOL] list_sessions completed (${result.active_sessions} sessions)`
        );
        return {
          success: true,
          data: result,
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error ? error.message : String(error);
        log.error(`❌ [TOOL] list_sessions failed: ${errorMessage}`);
        return {
          success: false,
          error: errorMessage,
        };
      }
    }
  • Tool schema defining the list_sessions tool with description and empty input schema (no parameters required).
    {
      name: "list_sessions",
      description:
        "List all active sessions with stats (age, message count, last activity). " +
        "Use to continue the most relevant session instead of starting from scratch.",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Registration of sessionManagementTools (containing list_sessions schema) into the complete list of tool definitions via buildToolDefinitions.
    return [
      dynamicAskQuestionTool,
      ...notebookManagementTools,
      ...sessionManagementTools,
      ...systemTools,
    ];
  • src/index.ts:232-234 (registration)
    Dispatch registration in the MCP server CallToolRequestSchema handler that routes list_sessions calls to the handler method.
    case "list_sessions":
      result = await this.toolHandlers.handleListSessions();
      break;
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the tool's behavior as listing active sessions with specific stats, which is helpful. However, it doesn't disclose other behavioral traits like whether this is a read-only operation, if it requires authentication, rate limits, or pagination. The description adds some value but leaves gaps in behavioral context.

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?

The description is two concise sentences with zero waste. The first sentence states the purpose and output, and the second provides usage guidance. It's front-loaded with essential information and efficiently structured.

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

Completeness3/5

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

Given no annotations, no output schema, and 0 parameters, the description is moderately complete. It explains what the tool does and when to use it, but lacks details on behavioral aspects like response format, error handling, or dependencies. For a simple list tool, this is adequate but has clear gaps in context.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't mention any parameters, which is appropriate. Baseline is 4 for 0 parameters, as the description doesn't need to compensate for missing schema info.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'List all active sessions with stats (age, message count, last activity).' It specifies the verb ('List'), resource ('active sessions'), and what information is returned. However, it doesn't explicitly differentiate from sibling tools like 'close_session' or 'reset_session' beyond the 'list' vs. 'modify' distinction.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Use to continue the most relevant session instead of starting from scratch.' This tells the agent when to use this tool (to find existing sessions for continuation) versus alternatives like starting new sessions implicitly. It directly addresses the 'why' for tool selection.

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/inventra/notebooklm-mcp'

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