browser_get_page_info
Extract comprehensive page details such as HTML content, metadata, and statistics from a browser instance using the Concurrent Browser MCP server.
Instructions
Get detailed page information including full HTML content, page statistics, and metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | Yes | Instance ID |
Implementation Reference
- src/tools.ts:791-844 (handler)Main handler function that executes the browser_get_page_info tool logic: retrieves URL, title, full HTML content, viewport size, document ready state, page element statistics (links, images, forms, scripts, stylesheets), and adds metadata like content length and timestamp.private async getPageInfo(instanceId: string): Promise<ToolResult> { const instance = this.browserManager.getInstance(instanceId); if (!instance) { return { success: false, error: `Instance ${instanceId} not found` }; } try { const url = instance.page.url(); const title = await instance.page.title(); const content = await instance.page.content(); // Get additional page information const viewport = instance.page.viewportSize(); const loadState = await instance.page.evaluate(() => document.readyState); // Get basic page statistics const pageStats = await instance.page.evaluate(() => { const links = document.querySelectorAll('a[href]').length; const images = document.querySelectorAll('img').length; const forms = document.querySelectorAll('form').length; const scripts = document.querySelectorAll('script').length; const stylesheets = document.querySelectorAll('link[rel="stylesheet"]').length; return { linksCount: links, imagesCount: images, formsCount: forms, scriptsCount: scripts, stylesheetsCount: stylesheets }; }); return { success: true, data: { url, title, content, // Return complete HTML content contentLength: content.length, viewport, loadState, stats: pageStats, timestamp: new Date().toISOString() }, instanceId }; } catch (error) { return { success: false, error: `Get page info failed: ${error instanceof Error ? error.message : error}`, instanceId }; } }
- src/tools.ts:553-554 (registration)Dispatch/registration in executeTools switch statement that routes calls to the getPageInfo handler.case 'browser_get_page_info': return await this.getPageInfo(args.instanceId);
- src/tools.ts:294-306 (schema)Tool schema and registration definition in getTools() array, specifying name, description, and input schema requiring instanceId.name: 'browser_get_page_info', description: 'Get detailed page information including full HTML content, page statistics, and metadata', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' } }, required: ['instanceId'] } },