get_page_info
Extracts details from the current webpage, enabling AI assistants to retrieve essential information through the MCP Browser Server for efficient web automation and data processing.
Instructions
Get information about the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:632-652 (handler)The handler for the 'get_page_info' tool. It checks if a page is available, then retrieves the page title, current URL, and viewport dimensions using Playwright's Page API, and returns a formatted text response with this information.case 'get_page_info': { if (!currentPage) { throw new Error('No browser page available. Launch a browser first.'); } const title = await currentPage.title(); const url = currentPage.url(); const viewport = currentPage.viewportSize(); return { content: [ { type: 'text', text: `Page Info: Title: ${title} URL: ${url} Viewport: ${viewport?.width}x${viewport?.height}` } ] }; }
- src/index.ts:315-321 (registration)Tool registration in the ListTools response, defining the name, description, and input schema (empty object) for 'get_page_info'.name: 'get_page_info', description: 'Get information about the current page', inputSchema: { type: 'object', properties: {} } },