get_content
Extract HTML or text content from web pages using the Chromium ARM64 Browser. Ideal for browser automation, web testing, and data extraction on ARM64 devices.
Instructions
Get page content (HTML or text)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Type of content to get | text |
Implementation Reference
- index-browser-only.js:328-348 (handler)Core handler implementation for the 'get_content' MCP tool. Uses Chrome DevTools Protocol (CDP) commands to fetch either full HTML (DOM.getDocument + DOM.getOuterHTML) or page text content (Runtime.evaluate 'document.body.innerText').async getContent(type = 'text') { await this.ensureChromium(); if (type === 'html') { const result = await this.sendCDPCommand('DOM.getDocument'); const html = await this.sendCDPCommand('DOM.getOuterHTML', { nodeId: result.root.nodeId, }); return { content: [{ type: 'text', text: html.outerHTML }], }; } else { const result = await this.sendCDPCommand('Runtime.evaluate', { expression: 'document.body.innerText', returnByValue: true, }); return { content: [{ type: 'text', text: result.result.value || '' }], }; } }
- index-browser-only.js:114-128 (registration)Tool registration in ListToolsRequestSchema response, defining name, description, and input schema for 'get_content' (optional 'type' param).{ name: 'get_content', description: 'Get page content (HTML or text)', inputSchema: { type: 'object', properties: { type: { type: 'string', enum: ['html', 'text'], description: 'Type of content to get', default: 'text', }, }, }, },
- index.js:701-720 (handler)Core handler implementation for the 'get_content' MCP tool in the full server. Similar to browser-only version, fetches HTML or text content via CDP.async getContent(type) { await this.ensureChromium(); let content; if (type === 'html') { const doc = await this.sendCDPCommand('DOM.getDocument'); const html = await this.sendCDPCommand('DOM.getOuterHTML', { nodeId: doc.root.nodeId }); content = html.outerHTML; } else { const result = await this.sendCDPCommand('Runtime.evaluate', { expression: 'document.body.innerText', returnByValue: true }); content = result.result?.value || ''; } return { content: [{ type: 'text', text: content }], }; }
- index.js:184-198 (registration)Tool registration in ListToolsRequestSchema response for the full-featured server, defining 'get_content' tool with input schema.{ name: 'get_content', description: 'Get page content (HTML or text)', inputSchema: { type: 'object', properties: { type: { type: 'string', enum: ['html', 'text'], description: 'Type of content to get', default: 'text', }, }, }, },