Skip to main content
Glama
MiguelAlvRed

Store Scraper MCP

by MiguelAlvRed

ratings

Retrieve app ratings distribution data from app stores to analyze user feedback patterns and performance metrics.

Instructions

Get app ratings distribution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoiTunes trackId of the app
appIdNoBundle ID of the app
countryNoTwo-letter country code (default: us)us

Implementation Reference

  • The handler function that executes the 'ratings' tool logic: fetches app data via App Store API, parses it, extracts ratings using parseRatings helper, and returns JSON response.
    /**
     * Ratings tool - Get app ratings distribution
     */
    async function handleRatings(args) {
      try {
        const { id, appId, country = 'us' } = args;
    
        if (!id && !appId) {
          throw new Error('Either id or appId must be provided');
        }
    
        const url = buildRatingsUrl({ id, appId, country });
        const data = await fetchJSON(url);
        const app = parseApp(data);
    
        if (!app) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({ error: 'App not found' }, null, 2),
              },
            ],
          };
        }
    
        const ratings = parseRatings(app);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(ratings, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ error: error.message }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the 'ratings' tool, defining parameters: id (number), appId (string), country (string, default 'us'). Provided in ListTools response.
      name: 'ratings',
      description: 'Get app ratings distribution',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'number',
            description: 'iTunes trackId of the app',
          },
          appId: {
            type: 'string',
            description: 'Bundle ID of the app',
          },
          country: {
            type: 'string',
            description: 'Two-letter country code (default: us)',
            default: 'us',
          },
        },
      },
    },
  • Registration of the 'ratings' tool handler in the CallToolRequestSchema switch statement, mapping tool name to handleRatings function.
    case 'ratings':
      return await handleRatings(args);
  • Helper function to parse ratings data from app object, extracting count and average (histogram unavailable from API, defaults to zeros).
    export function parseRatings(appData) {
      if (!appData || !appData.rating) {
        return {
          ratings: 0,
          histogram: {
            '1': 0,
            '2': 0,
            '3': 0,
            '4': 0,
            '5': 0,
          },
        };
      }
    
      // iTunes API doesn't provide histogram directly
      // We can only return the average and count
      // For histogram, we'd need to scrape the web page, which is more complex
      // For now, return what we have
      return {
        ratings: appData.rating.count || 0,
        average: appData.rating.average || null,
        histogram: {
          '1': 0, // Not available from API
          '2': 0,
          '3': 0,
          '4': 0,
          '5': 0,
        },
      };
    }
  • Helper function to build the API URL for ratings data (reuses the app detail endpoint).
    export function buildRatingsUrl(params) {
      return buildAppUrl(params);
    }
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 states the action ('Get') but doesn't describe what 'ratings distribution' entails (e.g., numerical breakdowns, charts, or aggregated data), response format, rate limits, or authentication needs. This leaves significant gaps for a tool with potential data retrieval implications.

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 with no wasted words. It's front-loaded with the core purpose, making it easy to parse quickly. Every word earns its place in conveying the essential function.

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. It doesn't clarify what 'ratings distribution' means in terms of output (e.g., statistical data, visualizations, or raw ratings), which is critical for an agent to understand the tool's utility. The high schema coverage doesn't compensate for this missing behavioral 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%, so the input schema fully documents the parameters (id, appId, country). The description doesn't add any meaning beyond this, such as explaining how parameters interact or which to prioritize. This meets the baseline for high schema coverage.

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 verb ('Get') and resource ('app ratings distribution'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling tools like 'reviews' or 'gp_reviews', which might also provide rating-related information, 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 'reviews', 'gp_reviews', or other sibling tools. It lacks context about what makes this tool distinct, leaving the agent to guess 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