Skip to main content
Glama

get_sessions

Retrieve active browser automation sessions to monitor ongoing tasks and manage web scraping, content extraction, or performance audits.

Instructions

Get active sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_sessions': calls client.getSessions() and returns formatted response with session count and JSON details.
    case 'get_sessions': {
      const result = await this.client!.getSessions();
      if (result.success && result.data) {
        return {
          content: [
            {
              type: 'text',
              text: `Found ${result.data.length} active sessions.`,
            },
            {
              type: 'text',
              text: JSON.stringify(result.data, null, 2),
            },
          ],
        };
      } else {
        throw new Error(result.error || 'Failed to get sessions');
      }
    }
  • Tool schema definition: empty input schema, description 'Get active sessions'.
      name: 'get_sessions',
      description: 'Get active sessions',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Core implementation: HTTP GET request to Browserless /sessions endpoint, wraps response in BrowserlessResponse.
    async getSessions(): Promise<BrowserlessResponse<Session[]>> {
      try {
        const response: AxiosResponse<Session[]> = await this.httpClient.get('/sessions');
    
        return {
          success: true,
          data: response.data,
        };
      } catch (error) {
        return this.handleError(error);
      }
    }
  • Type definition for Session objects returned by get_sessions.
    export interface Session {
      id: string;
      browserWSEndpoint: string;
      createdAt: Date;
      lastActivity: Date;
      status: 'active' | 'idle' | 'closed';
    }
Behavior2/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 states 'Get active sessions', implying a read-only operation, but does not disclose behavioral traits such as permissions needed, rate limits, whether it returns all sessions or a subset, or any side effects. This leaves significant gaps in understanding how the tool behaves.

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 extremely concise at three words, front-loaded with the core action and resource. There is no wasted language, and it efficiently communicates the basic purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the tool has no annotations, no output schema, and a simple purpose, the description is incomplete. It lacks details on what 'active sessions' entails, the return format, or any behavioral context. For a tool with zero structured data, this minimal description does not provide enough information for effective use.

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, meaning no parameters are documented in the schema. The description does not mention any parameters, which is appropriate here since there are none. It adds no semantic details beyond the schema, but with zero parameters, a baseline of 4 is justified as no compensation is needed.

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

Purpose3/5

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

The description 'Get active sessions' clearly states the verb ('Get') and resource ('active sessions'), making the purpose understandable. However, it lacks specificity about what 'sessions' refers to (e.g., user sessions, web sessions) and does not distinguish from siblings like 'get_config' or 'get_content', leaving room for ambiguity.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It does not mention prerequisites, context (e.g., after initialization), or exclusions, and with siblings like 'get_config' or 'get_health', there is no indication of how this tool differs in usage scenarios.

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/Lizzard-Solutions/browserless-mcp'

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