Skip to main content
Glama

scrape_as_html

Extract HTML content from webpages by bypassing bot detection and CAPTCHA protections for data collection and analysis.

Instructions

Scrape a single webpage URL with advanced options for content extraction and get back the results in HTML. This tool can unlock any webpage even if it uses bot detection or CAPTCHA.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • The handler function wrapped by tool_fn that performs an axios POST request to the Bright Data API (/request endpoint) using the unlocker zone to scrape the provided URL and return the raw HTML response.
    execute: tool_fn('scrape_as_html', async({url})=>{
        let response = await axios({
            url: 'https://api.brightdata.com/request',
            method: 'POST',
            data: {
                url,
                zone: unlocker_zone,
                format: 'raw',
            },
            headers: api_headers(),
            responseType: 'text',
        });
        return response.data;
    }),
  • Zod schema for the tool input, requiring a single 'url' parameter validated as a URL string.
    parameters: z.object({url: z.string().url()}),
  • server.js:184-205 (registration)
    Registration of the 'scrape_as_html' tool using server.addTool (via addTool helper), defining name, description, input schema, and execute handler.
    addTool({
        name: 'scrape_as_html',
        description: 'Scrape a single webpage URL with advanced options for '
        +'content extraction and get back the results in HTML. '
        +'This tool can unlock any webpage even if it uses bot detection or '
        +'CAPTCHA.',
        parameters: z.object({url: z.string().url()}),
        execute: tool_fn('scrape_as_html', async({url})=>{
            let response = await axios({
                url: 'https://api.brightdata.com/request',
                method: 'POST',
                data: {
                    url,
                    zone: unlocker_zone,
                    format: 'raw',
                },
                headers: api_headers(),
                responseType: 'text',
            });
            return response.data;
        }),
    });
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 advanced content extraction and the ability to bypass bot detection or CAPTCHA, which adds some context about capabilities. However, it fails to address critical behavioral aspects such as rate limits, error handling, authentication needs, or whether the operation is read-only or has side effects. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the core functionality in the first sentence. The second sentence adds useful context about bypassing protections. There's no wasted text, and both sentences contribute meaningfully, though it could be slightly more structured by explicitly separating purpose from capabilities.

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 (involving web scraping with advanced features), no annotations, no output schema, and low parameter coverage, the description is incomplete. It lacks details on output format beyond 'HTML,' error cases, performance considerations, and how it differs from sibling tools. For a tool with such potential variability and no structured support, the description should provide more comprehensive guidance to ensure proper usage.

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 1 parameter ('url') with 0% description coverage, meaning the schema provides no semantic details. The description adds minimal value by implying the URL is for a webpage to scrape, but it doesn't elaborate on format constraints, validation, or what 'advanced options' entail beyond the single parameter. With low schema coverage, the description compensates inadequately, resulting in a baseline score due to the lack of detailed parameter information.

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: 'Scrape a single webpage URL with advanced options for content extraction and get back the results in HTML.' It specifies the verb (scrape), resource (webpage URL), and output format (HTML). However, it doesn't explicitly differentiate from siblings like 'scrape_as_markdown' or 'scraping_browser_get_html', which offer similar functionality with different output formats or methods.

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 minimal guidance on when to use this tool. It mentions 'advanced options for content extraction' and the ability to 'unlock any webpage even if it uses bot detection or CAPTCHA,' which hints at use cases involving complex or protected sites. However, it lacks explicit comparisons to alternatives (e.g., when to choose this over 'scrape_as_markdown' or browser-based tools) or clear exclusions, leaving the agent with limited decision-making context.

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