Skip to main content
Glama

scrape_as_markdown

Extract webpage content into Markdown format, bypassing bot detection and CAPTCHA protections for reliable data collection.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • server.js:161-183 (registration)
    Registration of the 'scrape_as_markdown' tool using server.addTool(), including name, description, schema, and execute handler.
    addTool({
        name: 'scrape_as_markdown',
        description: 'Scrape a single webpage URL with advanced options for '
        +'content extraction and get back the results in MarkDown language. '
        +'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_markdown', async({url})=>{
            let response = await axios({
                url: 'https://api.brightdata.com/request',
                method: 'POST',
                data: {
                    url,
                    zone: unlocker_zone,
                    format: 'raw',
                    data_format: 'markdown',
                },
                headers: api_headers(),
                responseType: 'text',
            });
            return response.data;
        }),
    });
  • The core handler logic wrapped in tool_fn. Sends a POST request to BrightData API's /request endpoint with the URL, unlocker zone, raw format, and markdown data_format to scrape and return markdown content.
    execute: tool_fn('scrape_as_markdown', async({url})=>{
        let response = await axios({
            url: 'https://api.brightdata.com/request',
            method: 'POST',
            data: {
                url,
                zone: unlocker_zone,
                format: 'raw',
                data_format: 'markdown',
            },
            headers: api_headers(),
            responseType: 'text',
        });
        return response.data;
    }),
  • Zod schema defining the input parameter: a required URL string.
    parameters: z.object({url: z.string().url()}),
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. It discloses key behavioral traits: advanced content extraction, ability to handle bot detection/CAPTCHA, and Markdown output format. However, it lacks details on rate limits, error handling, authentication needs, or what 'advanced options' entail, which are important for a scraping tool.

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 two sentences that efficiently convey purpose and key capabilities without waste. It's front-loaded with the main function and follows with the unlocking feature. A minor improvement could be integrating the Markdown output more seamlessly, but overall it's well-structured.

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 no annotations, 1 parameter with 0% schema coverage, and no output schema, the description is moderately complete. It covers the core purpose and some behavioral aspects but lacks details on parameters, error cases, or output structure. For a tool with potential complexity (handling bot detection), more context would be helpful.

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

Parameters4/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, so the description must compensate. It clarifies that the url is for a 'single webpage' and implies it's for scraping, adding meaningful context beyond the schema's URI format. However, it doesn't detail URL constraints or what 'advanced options' might be, keeping it from a perfect score.

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 scrapes a single webpage URL with advanced content extraction and returns results in Markdown. It specifies the verb (scrape), resource (webpage), and output format (Markdown), which distinguishes it from HTML-based scraping siblings. However, it doesn't explicitly differentiate from all siblings like 'extract' or domain-specific tools.

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

Usage Guidelines3/5

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

The description implies usage for webpages with bot detection or CAPTCHA ('unlock any webpage'), suggesting when this tool might be preferred over simpler scraping tools. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the many sibling tools, leaving some ambiguity.

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