Skip to main content
Glama

web_data_google_maps_reviews

Extract structured Google Maps reviews data from URLs for analysis, using cached data to improve reliability over direct scraping.

Instructions

Quickly read structured Google maps reviews data. Requires a valid Google maps URL. This can be a cache lookup, so it can be more reliable than scraping

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
days_limitNo3

Implementation Reference

  • Handler function that triggers the BrightData Datasets API v3 to collect Google Maps reviews data using dataset_id 'gd_luzfs1dn2oa0teb81', polls the snapshot status up to 600 times, and returns the collected JSON data.
    execute: tool_fn(`web_data_${id}`, async(data, ctx)=>{
        let trigger_response = await axios({
            url: 'https://api.brightdata.com/datasets/v3/trigger',
            params: {dataset_id, include_errors: true},
            method: 'POST',
            data: [data],
            headers: api_headers(),
        });
        if (!trigger_response.data?.snapshot_id)
            throw new Error('No snapshot ID returned from request');
        let snapshot_id = trigger_response.data.snapshot_id;
        console.error(`[web_data_${id}] triggered collection with `
            +`snapshot ID: ${snapshot_id}`);
        let max_attempts = 600;
        let attempts = 0;
        while (attempts < max_attempts)
        {
            try {
                if (ctx && ctx.reportProgress)
                {
                    await ctx.reportProgress({
                        progress: attempts,
                        total: max_attempts,
                        message: `Polling for data (attempt `
                            +`${attempts + 1}/${max_attempts})`,
                    });
                }
                let snapshot_response = await axios({
                    url: `https://api.brightdata.com/datasets/v3`
                        +`/snapshot/${snapshot_id}`,
                    params: {format: 'json'},
                    method: 'GET',
                    headers: api_headers(),
                });
                if (['running', 'building'].includes(snapshot_response.data?.status))
                {
                    console.error(`[web_data_${id}] snapshot not ready, `
                        +`polling again (attempt `
                        +`${attempts + 1}/${max_attempts})`);
                    attempts++;
                    await new Promise(resolve=>setTimeout(resolve, 1000));
                    continue;
                }
                console.error(`[web_data_${id}] snapshot data received `
                    +`after ${attempts + 1} attempts`);
                let result_data = JSON.stringify(snapshot_response.data);
                return result_data;
            } catch(e){
                console.error(`[web_data_${id}] polling error: `
                    +`${e.message}`);
                attempts++;
                await new Promise(resolve=>setTimeout(resolve, 1000));
            }
        }
        throw new Error(`Timeout after ${max_attempts} seconds waiting `
            +`for data`);
    }),
  • Dataset configuration specifying the tool name prefix 'google_maps_reviews', dataset_id, description, input parameters (url: string url, days_limit: string default '3'), used to dynamically generate the schema for web_data_google_maps_reviews.
        id: 'google_maps_reviews',
        dataset_id: 'gd_luzfs1dn2oa0teb81',
        description: [
            'Quickly read structured Google maps reviews data.',
            'Requires a valid Google maps URL.',
            'This can be a cache lookup, so it can be more reliable than scraping',
        ].join('\n'),
        inputs: ['url', 'days_limit'],
        defaults: {days_limit: '3'},
    }, {
  • server.js:674-745 (registration)
    Dynamic registration loop that constructs and registers the web_data_google_maps_reviews tool (and others) by building name, schema from inputs/defaults, description, and handler from the datasets array entry.
    for (let {dataset_id, id, description, inputs, defaults = {}} of datasets)
    {
        let parameters = {};
        for (let input of inputs)
        {
            let param_schema = input=='url' ? z.string().url() : z.string();
            parameters[input] = defaults[input] !== undefined ?
                param_schema.default(defaults[input]) : param_schema;
        }
        addTool({
            name: `web_data_${id}`,
            description,
            parameters: z.object(parameters),
            execute: tool_fn(`web_data_${id}`, async(data, ctx)=>{
                let trigger_response = await axios({
                    url: 'https://api.brightdata.com/datasets/v3/trigger',
                    params: {dataset_id, include_errors: true},
                    method: 'POST',
                    data: [data],
                    headers: api_headers(),
                });
                if (!trigger_response.data?.snapshot_id)
                    throw new Error('No snapshot ID returned from request');
                let snapshot_id = trigger_response.data.snapshot_id;
                console.error(`[web_data_${id}] triggered collection with `
                    +`snapshot ID: ${snapshot_id}`);
                let max_attempts = 600;
                let attempts = 0;
                while (attempts < max_attempts)
                {
                    try {
                        if (ctx && ctx.reportProgress)
                        {
                            await ctx.reportProgress({
                                progress: attempts,
                                total: max_attempts,
                                message: `Polling for data (attempt `
                                    +`${attempts + 1}/${max_attempts})`,
                            });
                        }
                        let snapshot_response = await axios({
                            url: `https://api.brightdata.com/datasets/v3`
                                +`/snapshot/${snapshot_id}`,
                            params: {format: 'json'},
                            method: 'GET',
                            headers: api_headers(),
                        });
                        if (['running', 'building'].includes(snapshot_response.data?.status))
                        {
                            console.error(`[web_data_${id}] snapshot not ready, `
                                +`polling again (attempt `
                                +`${attempts + 1}/${max_attempts})`);
                            attempts++;
                            await new Promise(resolve=>setTimeout(resolve, 1000));
                            continue;
                        }
                        console.error(`[web_data_${id}] snapshot data received `
                            +`after ${attempts + 1} attempts`);
                        let result_data = JSON.stringify(snapshot_response.data);
                        return result_data;
                    } catch(e){
                        console.error(`[web_data_${id}] polling error: `
                            +`${e.message}`);
                        attempts++;
                        await new Promise(resolve=>setTimeout(resolve, 1000));
                    }
                }
                throw new Error(`Timeout after ${max_attempts} seconds waiting `
                    +`for data`);
            }),
        });
    }
Behavior3/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. It discloses that this is a read operation ('read'), involves cache lookup for reliability, and requires a URL. However, it lacks details on rate limits, authentication needs, error handling, or what 'structured' data entails. The mention of cache behavior adds some value, but more behavioral context would be helpful for a tool with no annotations.

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 with three sentences that are front-loaded: the first states the core purpose, the second specifies the key requirement, and the third adds behavioral context. There's no wasted text, but it could be slightly more structured (e.g., bullet points) for clarity.

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 no annotations, 0% schema coverage, no output schema, and 2 parameters, the description is incomplete. It covers the purpose and URL requirement but misses details on the 'days_limit' parameter, output format, error cases, and how it differs from sibling tools. For a data-fetching tool with undocumented parameters, this leaves too many gaps for effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions the 'url' parameter ('Requires a valid Google maps URL') but doesn't explain the 'days_limit' parameter at all. With 2 parameters and no schema descriptions, the description only covers one parameter partially, leaving significant gaps in understanding what inputs are needed and why.

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: 'Quickly read structured Google maps reviews data.' It specifies the verb ('read'), resource ('Google maps reviews data'), and key characteristics ('structured', 'quickly'). However, it doesn't explicitly differentiate from sibling tools like 'scrape_as_html' or 'web_data_facebook_company_reviews' that might also handle reviews from other platforms.

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 provides some usage context: 'Requires a valid Google maps URL' and mentions it 'can be more reliable than scraping,' which implies an alternative approach. However, it doesn't explicitly state when to use this tool versus siblings like 'scrape_as_html' or other web_data_* tools for reviews, nor does it mention any exclusions or prerequisites beyond the URL requirement.

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