Skip to main content
Glama

get_sessions

Retrieve active browser sessions for monitoring or managing automation tasks on the Browserless MCP Server platform.

Instructions

Get active sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server handler for the 'get_sessions' tool. Calls the client's getSessions method and formats the response as MCP content blocks.
    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'); } }
  • Core implementation of getSessions in BrowserlessClient class. Performs an HTTP GET request to the Browserless '/sessions' endpoint to retrieve active sessions.
    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); } }
  • src/index.ts:252-258 (registration)
    Tool registration in the listTools handler, defining name, description, and empty input schema for 'get_sessions'.
    name: 'get_sessions', description: 'Get active sessions', inputSchema: { type: 'object', properties: {}, }, },

Other Tools

Related 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