Skip to main content
Glama
Rainmen-xia

Chrome Debug MCP Server

by Rainmen-xia

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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) }; } }
  • 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;
  • Helper function providing success message for the 'get_page_content' tool.
    case "get_page_content": return "✅ 页面内容获取完成";

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Rainmen-xia/chrome-debug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server