Skip to main content
Glama

list-browsers

Retrieve active browser instances with detailed tab and title information to monitor and manage browser automation tasks on MCP Fetch.

Instructions

List all active browser instances with their details including tabs and titles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function listBrowsers() that lists active Puppeteer browser instances with details on tabs, URLs, titles, and connection status.
    export async function listBrowsers() { const browsers = getBrowsers() const browserIds = Object.keys(browsers) if (browserIds.length === 0) { return JSON.stringify({ success: true, browsers: [], message: "No active browser instances", }, null, 2) } const browserList = await Promise.all( browserIds.map(async (id) => { const browserInstance = browsers[id] const { browser, createdAt } = browserInstance try { // Get all pages (tabs) from the browser const pages = await browser.pages() // Get tab information const tabs = await Promise.all( pages.map(async (page, index) => { const url = page.url() const title = await page.title().catch(() => "Untitled") return { index, url, title, } }) ) return { id, createdAt: createdAt.toISOString(), tabCount: tabs.length, tabs, isConnected: browser.connected, } } catch (error) { // If we can't get browser info, it might be disconnected return { id, createdAt: createdAt.toISOString(), error: "Failed to get browser information", isConnected: false, } } }) ) return JSON.stringify({ success: true, browserCount: browserList.length, browsers: browserList, }, null, 2) }
  • Zod schema defining the input parameters for the list-browsers action (no parameters required).
    z.object({ type: z.literal("list-browsers"), }),
  • Dispatch/registration of the list-browsers action within the puppeteer tool handler switch statement.
    case "list-browsers": return await listBrowsers()

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/matiasngf/mcp-fetch'

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