Skip to main content
Glama
MiguelAlvRed

Store Scraper MCP

by MiguelAlvRed

gp_suggest

Retrieves Google Play Store search suggestions and autocomplete results for specified terms, countries, and languages.

Instructions

[Google Play] Get search suggestions/autocomplete

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesSearch term to get suggestions for
countryNoTwo-letter country code (default: us)us
langNoLanguage code (default: en)en

Implementation Reference

  • The main handler function that implements the gp_suggest tool. It validates input, builds the Google Play suggest API URL, fetches and parses the response, then formats and returns the suggestions.
    async function handleGPSuggest(args) {
      try {
        const { term, country = 'us', lang = 'en' } = args;
    
        if (!term) {
          throw new Error('term is required');
        }
    
        const url = buildGPSuggestUrl({ term, country, lang });
        const data = await fetchJSON(url);
        const suggestions = parseGPSuggest(data);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                term,
                suggestions,
                count: suggestions.length,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ error: error.message }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool registration in the ListTools handler, defining name, description, and input schema for gp_suggest.
    {
      name: 'gp_suggest',
      description: '[Google Play] Get search suggestions/autocomplete',
      inputSchema: {
        type: 'object',
        properties: {
          term: {
            type: 'string',
            description: 'Search term to get suggestions for',
          },
          country: {
            type: 'string',
            description: 'Two-letter country code (default: us)',
            default: 'us',
          },
          lang: {
            type: 'string',
            description: 'Language code (default: en)',
            default: 'en',
          },
        },
        required: ['term'],
      },
    },
  • Input schema definition for the gp_suggest tool, specifying parameters and validation rules.
    inputSchema: {
      type: 'object',
      properties: {
        term: {
          type: 'string',
          description: 'Search term to get suggestions for',
        },
        country: {
          type: 'string',
          description: 'Two-letter country code (default: us)',
          default: 'us',
        },
        lang: {
          type: 'string',
          description: 'Language code (default: en)',
          default: 'en',
        },
      },
      required: ['term'],
    },
  • Helper function to parse the JSON response from Google Play suggest API into an array of suggestion objects with term and priority.
    export function parseSuggest(data) {
      if (!data) {
        return [];
      }
    
      const suggestions = [];
    
      try {
        let jsonData;
        
        if (typeof data === 'string') {
          jsonData = JSON.parse(data);
        } else {
          jsonData = data;
        }
    
        // Google Play suggest API returns suggestions in various formats
        if (Array.isArray(jsonData)) {
          jsonData.forEach(item => {
            if (typeof item === 'string') {
              suggestions.push({ term: item });
            } else if (item.suggestion || item.term || item.q) {
              suggestions.push({
                term: item.suggestion || item.term || item.q,
                priority: item.priority || 0,
              });
            }
          });
        } else if (jsonData.suggestions || jsonData.data) {
          const suggestList = jsonData.suggestions || jsonData.data || [];
          suggestList.forEach(item => {
            suggestions.push({
              term: item.suggestion || item.term || item.q || item,
              priority: item.priority || 0,
            });
          });
        } else if (jsonData.q) {
          // Single suggestion
          suggestions.push({
            term: jsonData.q,
            priority: jsonData.priority || 0,
          });
        }
    
        return suggestions.sort((a, b) => (b.priority || 0) - (a.priority || 0));
      } catch (error) {
        console.error('Error parsing Google Play suggestions:', error);
        return [];
      }
    }
  • Helper function that constructs the Google Play suggest API URL based on term, country, and lang parameters.
    export function buildSuggestUrl(params) {
      const { term, country = 'us', lang = 'en' } = params;
      
      if (!term) {
        throw new Error('term is required');
      }
    
      // Google Play uses a different endpoint for suggestions
      return `https://market.android.com/suggest/SuggRequest?json=1&c=3&query=${encodeURIComponent(term)}&gl=${country}&hl=${lang}`;
    }
Behavior2/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 'Get search suggestions/autocomplete' but doesn't specify if this is a read-only operation, requires authentication, has rate limits, or what the output format might be. This leaves significant gaps in understanding the tool's behavior beyond its basic function.

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 extremely concise and front-loaded, consisting of a single, efficient sentence that directly states the tool's purpose. Every word earns its place, with no wasted text or unnecessary elaboration.

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 lack of annotations and output schema, the description is incomplete for a tool with three parameters. It doesn't address behavioral aspects like safety, permissions, or response format, which are crucial for an agent to use it correctly in a broader context.

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 schema description coverage is 100%, with clear documentation for all three parameters (term, country, lang), including defaults for optional ones. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score without compensating further.

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 action ('Get search suggestions/autocomplete') and resource ('Google Play'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'gp_search' or 'suggest', which could provide similar functionality, so it doesn't reach the highest score.

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 no guidance on when to use this tool versus alternatives like 'gp_search' or 'suggest' from the sibling list. It lacks context about specific use cases, prerequisites, or exclusions, leaving the agent to infer usage based on the name alone.

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/MiguelAlvRed/mobile-store-scraper-mcp'

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