Skip to main content
Glama

browser_get_page_info

Extract comprehensive page data including HTML content, statistics, and metadata from browser instances for analysis and automation tasks.

Instructions

Get detailed page information including full HTML content, page statistics, and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdYesInstance ID

Implementation Reference

  • The core handler function for 'browser_get_page_info' that retrieves comprehensive page information including full HTML content, title, URL, statistics, and metadata from the browser page.
    private async getPageInfo(instanceId: string): Promise<ToolResult> {
      const instance = this.browserManager.getInstance(instanceId);
      if (!instance) {
        return { success: false, error: `Instance ${instanceId} not found` };
      }
    
      try {
        const url = instance.page.url();
        const title = await instance.page.title();
        const content = await instance.page.content();
        
        // Get additional page information
        const viewport = instance.page.viewportSize();
        const loadState = await instance.page.evaluate(() => document.readyState);
        
        // Get basic page statistics
        const pageStats = await instance.page.evaluate(() => {
          const links = document.querySelectorAll('a[href]').length;
          const images = document.querySelectorAll('img').length;
          const forms = document.querySelectorAll('form').length;
          const scripts = document.querySelectorAll('script').length;
          const stylesheets = document.querySelectorAll('link[rel="stylesheet"]').length;
          
          return {
            linksCount: links,
            imagesCount: images,
            formsCount: forms,
            scriptsCount: scripts,
            stylesheetsCount: stylesheets
          };
        });
        
        return {
          success: true,
          data: { 
            url, 
            title, 
            content,  // Return complete HTML content
            contentLength: content.length,
            viewport,
            loadState,
            stats: pageStats,
            timestamp: new Date().toISOString()
          },
          instanceId
        };
      } catch (error) {
        return {
          success: false,
          error: `Get page info failed: ${error instanceof Error ? error.message : error}`,
          instanceId
        };
      }
    }
  • The input schema and metadata definition for the 'browser_get_page_info' tool, specifying the required instanceId parameter.
    {
      name: 'browser_get_page_info',
      description: 'Get detailed page information including full HTML content, page statistics, and metadata',
      inputSchema: {
        type: 'object',
        properties: {
          instanceId: {
            type: 'string',
            description: 'Instance ID'
          }
        },
        required: ['instanceId']
      }
    },
  • src/tools.ts:553-554 (registration)
    The switch case in executeTools method that registers and dispatches the 'browser_get_page_info' tool call to its handler.
    case 'browser_get_page_info':
      return await this.getPageInfo(args.instanceId);
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 mentions what information is retrieved but lacks details on performance (e.g., speed, potential delays), side effects (e.g., whether it triggers page loads or network requests), error handling, or output format. For a tool that retrieves 'detailed' data without annotations, 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 a single, efficient sentence that front-loads the core purpose ('Get detailed page information') and specifies key components (HTML content, statistics, metadata). There is no wasted verbiage, and every word contributes to understanding the tool's function.

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 tool's complexity (retrieving multiple types of page data), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like how the data is structured, potential limitations (e.g., size constraints), or dependencies on other tools (e.g., requiring a browser instance). For a tool with no structured support, more context is needed.

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 single parameter 'instanceId' documented as 'Instance ID'. The description adds no additional parameter semantics beyond what the schema provides, such as explaining what an instance ID represents or how to obtain it. Baseline score of 3 is appropriate since the schema does the heavy lifting.

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 tool's purpose with a specific verb ('Get') and resource ('detailed page information'), including what information is retrieved (HTML content, statistics, metadata). It distinguishes itself from siblings like browser_get_element_attribute or browser_get_markdown by focusing on comprehensive page-level data rather than specific elements or formats. However, it doesn't explicitly differentiate from all siblings in the browser tool family.

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 instance), exclusions, or comparisons to siblings like browser_get_markdown (which might provide formatted content) or browser_list_instances (which manages instances). Usage is implied but not explicitly stated.

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/sailaoda/concurrent-browser-mcp'

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