Skip to main content
Glama

scraping_browser_get_html

Extract HTML content from web pages for data collection and analysis using the Bright Data Web MCP server's browser automation capabilities.

Instructions

Get the HTML content of the current page. Avoid using the full_page option unless it is important to see things like script tags since this can be large

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
full_pageNoWhether to get the full page HTML including head and script tags Avoid this if you only need the extra HTML, since it can be quite large

Implementation Reference

  • The execute function that implements the core logic of the scraping_browser_get_html tool, fetching HTML content from the browser page either partially (body only) or fully.
    execute: async({full_page = false})=>{
        const page = await (await require_browser()).get_page();
        try {
            if (!full_page)
                return await page.$eval('body', body=>body.innerHTML);
            const html = await page.content();
            if (!full_page && html)
                return html.split('<body>')[1].split('</body>')[0];
            return html;
        } catch(e){
            throw new UserError(`Error getting HTML content: ${e}`);
        }
    },
  • Zod schema defining the input parameters for the scraping_browser_get_html tool.
    parameters: z.object({
        full_page: z.boolean().optional().describe([
            'Whether to get the full page HTML including head and script tags',
            'Avoid this if you only need the extra HTML, since it can be '
            +'quite large',
        ].join('\n')),
    }),
  • Registration of the scraping_browser_get_html tool in the exported tools array, conditional on the presence of API_TOKEN environment variable.
    export const tools = process.env.API_TOKEN ? [
        scraping_browser_navigate,
        scraping_browser_go_back,
        scraping_browser_go_forward,
        scraping_browser_links,
        scraping_browser_click,
        scraping_browser_type,
        scraping_browser_wait_for,
        scraping_browser_screenshot,
        scraping_browser_get_text,
        scraping_browser_get_html,
        scraping_browser_scroll,
        scraping_browser_scroll_to,
    ] : [scraping_browser_activation_instructions];
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that 'full_page' can be large, which is useful context about performance implications. However, it lacks details on error handling, response format, or prerequisites (e.g., requires a page to be loaded). This leaves gaps in understanding the tool's behavior beyond basic usage.

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 front-loaded with the core purpose in the first sentence, followed by a concise usage guideline. Every sentence earns its place without redundancy, making it efficient and easy to parse. It's appropriately sized for a simple tool with one parameter.

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 low complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It explains the purpose and parameter usage well, but without annotations or output schema, it misses details like return format or error conditions. This makes it adequate but not fully comprehensive for agent use.

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?

Schema description coverage is 100%, so the input schema already documents the 'full_page' parameter thoroughly. The description adds minimal value by reiterating the advice to avoid it unless necessary due to size, but doesn't provide additional semantics beyond what's in the schema. This meets the baseline for high schema coverage.

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: 'Get the HTML content of the current page.' It specifies the verb ('Get') and resource ('HTML content of the current page'), making the action clear. However, it doesn't explicitly differentiate from sibling tools like 'scrape_as_html' or 'scraping_browser_get_text', which likely serve similar purposes, preventing a perfect score.

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

Usage Guidelines4/5

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

The description provides clear usage guidance: 'Avoid using the full_page option unless it is important to see things like script tags since this can be large.' This advises when to use or avoid the parameter, offering practical context. However, it doesn't mention when to use this tool versus alternatives like 'scrape_as_html' or 'scraping_browser_get_text', which could help differentiate among siblings.

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/dsouza-anush/brightdata-mcp-heroku'

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