get_page_content
Extract the full HTML content of the current webpage using Chrome Debug MCP Server, enabling automated retrieval and analysis of web data during browser automation tasks.
Instructions
获取当前页面的HTML内容
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/browserSession.ts:554-574 (handler)The handler function that implements the 'get_page_content' tool by retrieving the full HTML content of the current page using Puppeteer.async getPageContent(): Promise<BrowserActionResult> { if (!this.page) { return { success: false, error: "浏览器未启动或页面不存在" }; } try { const content = await this.page.content(); return { success: true, logs: content }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
- src/index.ts:154-162 (schema)Tool schema definition including name, description, and empty input schema for 'get_page_content' in the listTools response.{ name: "get_page_content", description: "获取当前页面的HTML内容", inputSchema: { type: "object", properties: {}, }, }, ] as Tool[],
- src/index.ts:225-227 (registration)Registration/dispatch handler in the CallToolRequest switch statement that calls the browserSession.getPageContent() method.case "get_page_content": result = await this.browserSession.getPageContent(); break;
- src/index.ts:321-322 (helper)Helper function providing success message for the 'get_page_content' tool.case "get_page_content": return "✅ 页面内容获取完成";