Skip to main content
Glama
MiguelAlvRed

Store Scraper MCP

by MiguelAlvRed

suggest

Generate search suggestions and autocomplete results for app store queries to refine searches before retrieving detailed data.

Instructions

Get search suggestions/autocomplete for a search term

Input Schema

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

Implementation Reference

  • The main handler function for the 'suggest' tool. It validates input parameters (term required, country optional), constructs the App Store suggest API URL using buildSuggestUrl, fetches JSON data, parses suggestions with parseSuggest, and returns a formatted text content response with the suggestions list and count, or an error response.
    /**
     * Suggest tool - Get search suggestions
     */
    async function handleSuggest(args) {
      try {
        const { term, country = 'us' } = args;
    
        if (!term) {
          throw new Error('term is required');
        }
    
        const url = buildSuggestUrl({ term, country });
        const data = await fetchJSON(url);
        const suggestions = parseSuggest(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,
        };
      }
    }
  • The dispatch case in the CallToolRequestSchema handler that routes calls to the 'suggest' tool to the handleSuggest function.
    case 'suggest':
      return await handleSuggest(args);
  • The tool specification in the ListTools response, defining the name, description, and input schema (JSON Schema) for the 'suggest' tool.
    {
      name: 'suggest',
      description: 'Get search suggestions/autocomplete for a search term',
      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',
          },
        },
        required: ['term'],
      },
    },
  • The parseSuggest helper function exported from the parser module, used by the handler to extract, normalize, and sort suggestion terms by priority from the raw App Store API response.
    /**
     * Parser for search suggestions/autocomplete
     */
    
    /**
     * Normalizes suggestion data from iTunes Search Hints API
     * @param {Object} data - Raw suggestion API response
     * @returns {Array<Object>}
     */
    export function parseSuggest(data) {
      if (!data || !data.hints || !Array.isArray(data.hints)) {
        return [];
      }
    
      return data.hints.map(hint => ({
        term: hint.term || null,
        priority: hint.priority || 0,
      })).sort((a, b) => (b.priority || 0) - (a.priority || 0));
    }
  • The buildSuggestUrl helper function that constructs the App Store search suggestions API URL based on term and country parameters.
    export function buildSuggestUrl(params) {
      const { term, country = 'us' } = params;
      
      // App Store uses a different endpoint for suggestions
      return `https://search.itunes.apple.com/WebObjects/MZSearchHints.woa/wa/hints?term=${encodeURIComponent(term)}&country=${country}`;
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 states the tool 'Get[s] search suggestions/autocomplete', implying a read-only operation that returns autocomplete results, but it lacks details on rate limits, error handling, response format, or any side effects. For a tool with no annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core function, making it easy to parse and understand quickly, with no wasted information.

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 effective tool use. It fails to explain the return values, error conditions, or behavioral nuances, which are critical for an AI agent to invoke the tool correctly. The high schema coverage helps with inputs, but overall context is insufficient.

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 100% description coverage, with clear documentation for both parameters ('term' and 'country'), including defaults and requirements. The description adds no additional parameter semantics beyond what the schema provides, such as examples or constraints, so it meets the baseline score of 3 for high schema coverage without extra value.

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 function as 'Get search suggestions/autocomplete for a search term', which specifies the verb ('Get'), resource ('search suggestions/autocomplete'), and target ('search term'). However, it doesn't explicitly differentiate from sibling tools like 'search' or 'gp_suggest', which appear related to search functionality, leaving some ambiguity about when to choose this specific tool.

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. With sibling tools like 'search', 'gp_search', and 'gp_suggest' available, there is no indication of the specific context, prerequisites, or comparative use cases for 'suggest', leaving the agent without direction on tool selection.

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