Skip to main content
Glama

web_data_google_play_store

Extract structured Google Play Store app data using a URL to analyze app details, reviews, and metadata for market research or monitoring.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • The execute handler for the web_data_google_play_store tool (shared with other web_data_* tools). Triggers a BrightData dataset snapshot using the provided inputs (e.g., app URL), polls until ready, and returns the structured 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 defining the inputs (url) and dataset_id for google_play_store, used to generate the Zod input schema z.object({url: z.string().url()}) and description for the web_data_google_play_store tool.
        id: 'google_play_store',
        dataset_id: 'gd_lsk382l8xei8vzm4u',
        description: [
            'Quickly read structured Google play store data.',
            'Requires a valid Google play store app URL.',
            'This can be a cache lookup, so it can be more reliable than scraping',
        ].join('\n'),
        inputs: ['url'],
    }, {
  • server.js:674-747 (registration)
    Registration loop that dynamically creates and registers the web_data_google_play_store tool using the google_play_store dataset config, assigning name 'web_data_google_play_store', Zod schema from inputs, and shared handler.
    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`);
            }),
        });
    }
    
    for (let tool of browser_tools)
  • Wrapper function used for all tools, including web_data_google_play_store, that adds rate limiting, stats tracking, logging, and error handling around the core execute function.
    function tool_fn(name, fn){
        return async(data, ctx)=>{
            check_rate_limit();
            debug_stats.tool_calls[name] = debug_stats.tool_calls[name]||0;
            debug_stats.tool_calls[name]++;
            debug_stats.session_calls++;
            let ts = Date.now();
            console.error(`[%s] executing %s`, name, JSON.stringify(data));
            try { return await fn(data, ctx); }
            catch(e){
                if (e.response)
                {
                    console.error(`[%s] error %s %s: %s`, name, e.response.status,
                        e.response.statusText, e.response.data);
                    let message = e.response.data;
                    if (message?.length)
                        throw new Error(`HTTP ${e.response.status}: ${message}`);
                }
                else
                    console.error(`[%s] error %s`, name, e.stack);
                throw e;
            } finally {
                let dur = Date.now()-ts;
                console.error(`[%s] tool finished in %sms`, name, dur);
            }
        };
    }
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: it's a read operation ('read'), uses caching ('cache lookup'), and offers reliability benefits over scraping. However, it doesn't cover potential limitations like rate limits, authentication needs, error handling, or what 'structured data' entails in the output. The description adds value but leaves gaps in behavioral context.

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 appropriately sized with three concise sentences. It's front-loaded with the core purpose, followed by requirements and behavioral context. There's minimal waste, though the second sentence could be integrated more smoothly. Overall, it's efficient and well-structured for its length.

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 complexity (data extraction from a specific platform), no annotations, no output schema, and low parameter schema coverage, the description is moderately complete. It covers purpose, input requirements, and a key behavioral advantage. However, it lacks details on output format, error cases, caching specifics, and comparison to siblings, leaving room for improvement in contextual coverage.

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 with 0% description coverage, so the description must compensate. It specifies that the 'url' parameter must be 'a valid Google play store app URL,' adding crucial semantic context beyond the schema's URI format. However, it doesn't detail URL format examples or validation rules. Given the low schema coverage, this provides basic but incomplete parameter guidance.

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 play store data.' It specifies the verb ('read') and resource ('Google play store data'), and distinguishes it from generic scraping tools by mentioning structured data. However, it doesn't explicitly differentiate from sibling tools like 'web_data_apple_app_store' beyond the platform specificity.

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 play store app URL' and 'This can be a cache lookup, so it can be more reliable than scraping.' This implies when to use it (for Google Play Store data with URLs) and hints at advantages over scraping. However, it lacks explicit guidance on when to choose this tool versus alternatives like 'scrape_as_html' or other web_data_* siblings, beyond the reliability claim.

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