Skip to main content
Glama

get_content

Extract HTML or text content from web pages for browser automation and testing on ARM64 devices.

Instructions

Get page content (HTML or text)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoType of content to gettext

Implementation Reference

  • Main handler function for the get_content tool. Retrieves HTML via DOM commands or text via JS evaluation using Chrome DevTools Protocol (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 }], }; }
  • Input schema definition for get_content tool in the ListToolsRequestSchema response. Specifies optional 'type' parameter.
    { 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:361-362 (registration)
    Tool handler registration/dispatch in the CallToolRequestSchema switch statement.
    case 'get_content': return await this.getContent(args.type || 'text');
  • Alternative handler for browser-only MCP server. Similar CDP-based content retrieval.
    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 || '' }], }; } }
  • Input schema for get_content in browser-only server.
    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', }, }, },

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/nfodor/claude-arm64-browser'

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