select_page
Set a specific browser page as the active context for subsequent Chrome DevTools automation commands, enabling targeted debugging and inspection tasks.
Instructions
Select a page as a context for future tool calls.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageIdx | Yes | The index of the page to select. Call list_pages to list pages. |
Implementation Reference
- src/tools/pages.ts:41-46 (handler)Handler function that retrieves the page by index using context.getPageByIdx, brings it to the front, sets it as the selected page, and instructs the response to include pages.handler: async (request, response, context) => { const page = context.getPageByIdx(request.params.pageIdx); await page.bringToFront(); context.setSelectedPageIdx(request.params.pageIdx); response.setIncludePages(true); },
- src/tools/pages.ts:34-40 (schema)Input schema defining pageIdx as a number, with description instructing to use list_pages first.schema: { pageIdx: z .number() .describe( 'The index of the page to select. Call list_pages to list pages.', ), },
- src/tools/pages.ts:27-47 (registration)Full tool definition and export using defineTool, including name 'select_page', description, annotations, schema, and handler. This registers the tool.export const selectPage = defineTool({ name: 'select_page', description: `Select a page as a context for future tool calls.`, annotations: { category: ToolCategories.NAVIGATION_AUTOMATION, readOnlyHint: true, }, schema: { pageIdx: z .number() .describe( 'The index of the page to select. Call list_pages to list pages.', ), }, handler: async (request, response, context) => { const page = context.getPageByIdx(request.params.pageIdx); await page.bringToFront(); context.setSelectedPageIdx(request.params.pageIdx); response.setIncludePages(true); }, });