Skip to main content
Glama
Rainmen-xia

Chrome Debug MCP Server

by Rainmen-xia

get_page_content

Extract HTML content from the current webpage using Chrome debugging for browser automation and persistent sessions.

Instructions

获取当前页面的HTML内容

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the get_page_content tool logic. It retrieves the HTML content of the current page using Puppeteer's page.content() and returns it in the logs field of BrowserActionResult.
    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:225-227 (registration)
    Registration/dispatch point in the CallToolRequestSchema handler where the get_page_content tool call is routed to BrowserSession.getPageContent().
    case "get_page_content":
    	result = await this.browserSession.getPageContent();
    	break;
  • Tool schema definition including name, description, and empty input schema (no parameters required) registered in the ListToolsRequestSchema handler.
    	{
    		name: "get_page_content",
    		description: "获取当前页面的HTML内容",
    		inputSchema: {
    			type: "object",
    			properties: {},
    		},
    	},
    ] as Tool[],
  • Helper function to generate success message for the get_page_content tool.
    case "get_page_content":
    	return "✅ 页面内容获取完成";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe behavioral traits such as whether it returns raw HTML, handles dynamic content, requires page load completion, or has any side effects. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence in Chinese that directly states the tool's function without any unnecessary words. It's front-loaded and efficiently communicates the core purpose, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is adequate as a minimum viable explanation. However, it lacks details on output format (e.g., whether it returns a string or structured data) and behavioral context, which could be important for an agent to use it effectively in a browser automation scenario.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details beyond the schema, but since there are no parameters, a baseline score of 4 is appropriate as it doesn't need to compensate for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('获取' meaning 'get') and resource ('当前页面的HTML内容' meaning 'current page's HTML content'), making the purpose immediately understandable. However, it doesn't differentiate from potential sibling tools like 'get_page_text' or 'get_page_screenshot' that might exist in other contexts, though none are listed among the provided siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active browser session), exclusions, or comparisons to siblings like 'hover' or 'type_text'. The agent must infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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