get_pages
List all available browser pages for automation tasks using Playwright MCP server to manage web interactions.
Instructions
List all available browser pages
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/playwright_mcp/server.py:317-322 (handler)The handler logic for the 'get_pages' tool. It iterates over the global 'pages' dictionary, collects page IDs and URLs, and returns a text content listing all available pages.elif name == "get_pages": page_info = [] for page_id, page in pages.items(): page_info.append(f"{page_id}: {page.url}") return [types.TextContent(type="text", text="Available pages:\n" + "\n".join(page_info))]
- src/playwright_mcp/server.py:177-184 (registration)Registration of the 'get_pages' tool in the list_tools() function, including its name, description, and empty input schema (no parameters required).types.Tool( name="get_pages", description="List all available browser pages", inputSchema={ "type": "object", "properties": {}, }, ),
- src/playwright_mcp/server.py:19-19 (helper)Global dictionary that stores all open browser pages by ID, directly used in the get_pages handler.pages: Dict[str, Page] = {}