get_pages
Retrieve a list of all active browser pages for Playwright automation tasks, enabling efficient browser management and control in MCP workflows.
Instructions
List all available browser pages
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/playwright_mcp/server.py:317-322 (handler)The handler logic for the 'get_pages' tool within the main call_tool dispatcher. It lists all available browser pages by iterating over the global 'pages' dictionary and formatting their IDs and URLs into a text response.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 server's list_tools() response. Defines the tool name, description, and input schema (empty object, no parameters required).types.Tool( name="get_pages", description="List all available browser pages", inputSchema={ "type": "object", "properties": {}, }, ),
- src/playwright_mcp/server.py:180-183 (schema)Input schema definition for the 'get_pages' tool, specifying an empty object (no required parameters).inputSchema={ "type": "object", "properties": {}, },