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',
        },
      },
    },
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 ('get page content') but lacks critical details: whether it requires an active page session, what happens if no page is loaded, if it returns the entire page or a portion, or any rate limits. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise—a single phrase with no wasted words. It front-loads the core purpose ('Get page content') and specifies the format options efficiently. Every word earns its place, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity (a retrieval tool in a browser automation context), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the return value looks like (e.g., a string of HTML/text), error conditions, or dependencies on other tools like 'navigate'. For a tool with no structured support, more context is needed to guide the agent effectively.

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

Parameters3/5

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

The input schema has 100% description coverage, with the parameter 'type' fully documented in the schema (enum: 'html' or 'text', default: 'text'). The description adds no additional meaning beyond stating 'HTML or text', which merely repeats the schema. According to the rules, with high schema coverage (>80%), the baseline is 3 even with no param info in the description.

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 verb 'get' and the resource 'page content', specifying the format options 'HTML or text'. It distinguishes from siblings like 'get_console_logs' or 'get_network_errors' by focusing on page content rather than logs or errors. However, it doesn't explicitly differentiate from tools like 'evaluate' or 'select' that might also retrieve content, keeping it at 4 rather than 5.

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 a page loaded via 'navigate'), exclusions, or comparisons to siblings like 'get_selected_element' for specific content. Without such context, the agent must infer usage from the tool name 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/nfodor/claude-arm64-browser'

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