Skip to main content
Glama
MiguelAlvRed

Store Scraper MCP

by MiguelAlvRed

gp_similar

Find Google Play apps similar to a specified app by analyzing app details and categories to discover related applications.

Instructions

[Google Play] Get apps similar to the specified app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesGoogle Play app ID
langNoLanguage code (default: en)en
countryNoTwo-letter country code (default: us)us

Implementation Reference

  • Main handler function that executes the gp_similar tool: validates args, builds URL, fetches HTML, parses similar apps, and returns JSON response.
    async function handleGPSimilar(args) {
      try {
        const { appId, lang = 'en', country = 'us' } = args;
    
        if (!appId) {
          throw new Error('appId is required');
        }
    
        const url = buildGPSimilarUrl({ appId, lang, country });
        const html = await fetchText(url);
        const similarApps = parseGPSimilar(html);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                similarApps,
                count: similarApps.length,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ error: error.message }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition and tool registration in the list of tools returned by ListToolsRequest.
    {
      name: 'gp_similar',
      description: '[Google Play] Get apps similar to the specified app',
      inputSchema: {
        type: 'object',
        properties: {
          appId: {
            type: 'string',
            description: 'Google Play app ID',
          },
          lang: {
            type: 'string',
            description: 'Language code (default: en)',
            default: 'en',
          },
          country: {
            type: 'string',
            description: 'Two-letter country code (default: us)',
            default: 'us',
          },
        },
        required: ['appId'],
      },
    },
  • Dispatch registration in the CallToolRequest switch statement that routes to the handler.
    case 'gp_similar':
      return await handleGPSimilar(args);
  • Parser function that extracts similar apps data from the Google Play app page HTML using regex on sections and scripts.
    export function parseSimilar(html) {
      if (!html || typeof html !== 'string') {
        return [];
      }
    
      const similarApps = [];
    
      try {
        // Google Play similar apps are in a "You might also like" section
        // Look for similar apps section
        const similarSection = html.match(/<div[^>]*class=["'][^"']*similar["'][^>]*>([\s\S]*?)<\/div>/i) ||
                               html.match(/<section[^>]*class=["'][^"']*you-might-also-like["'][^>]*>([\s\S]*?)<\/section>/i);
    
        if (similarSection) {
          const sectionHtml = similarSection[1];
          
          // Extract app links
          const appLinkMatches = sectionHtml.matchAll(/<a[^>]*href=["']\/store\/apps\/details\?id=([^&"']+)["'][^>]*>/gi);
          
          for (const match of appLinkMatches) {
            const appId = match[1];
            
            // Try to extract title and other info from surrounding HTML
            const linkStart = sectionHtml.indexOf(match[0]);
            const contextHtml = sectionHtml.substring(Math.max(0, linkStart - 500), linkStart + 500);
            
            const titleMatch = contextHtml.match(/<span[^>]*title=["']([^"']+)["']/i) ||
                              contextHtml.match(/<div[^>]*class=["'][^"']*title["'][^>]*>([^<]+)<\/div>/i);
            const title = titleMatch ? titleMatch[1].trim() : null;
    
            const iconMatch = contextHtml.match(/<img[^>]*src=["']([^"']+)["'][^>]*>/i);
            const icon = iconMatch ? iconMatch[1] : null;
    
            const scoreMatch = contextHtml.match(/(\d+\.?\d*)\s*stars?/i);
            const score = scoreMatch ? parseFloat(scoreMatch[1]) : null;
    
            if (appId && !similarApps.find(a => a.appId === appId)) {
              similarApps.push({
                appId: appId,
                url: `https://play.google.com/store/apps/details?id=${appId}`,
                title: title,
                icon: icon,
                score: score,
                scoreText: score ? score.toFixed(1) : null,
                priceText: null,
                free: null,
                summary: null,
                developer: null,
                developerId: null,
              });
            }
          }
        }
    
        // Also try extracting from script tags
        const scriptMatches = html.matchAll(/<script[^>]*>([\s\S]*?)<\/script>/gi);
        
        for (const match of scriptMatches) {
          const scriptContent = match[1];
          
          if (scriptContent.includes('similar') || scriptContent.includes('recommended')) {
            try {
              // Try to find similar apps in JSON structures
              const similarMatch = scriptContent.match(/similarApps["']?\s*:\s*\[([\s\S]*?)\]/i);
              if (similarMatch) {
                const similarData = similarMatch[1];
                const appIdMatches = similarData.matchAll(/id["']?\s*:\s*["']([^"']+)["']/gi);
                
                for (const idMatch of appIdMatches) {
                  const appId = idMatch[1];
                  if (appId && !similarApps.find(a => a.appId === appId)) {
                    similarApps.push({
                      appId: appId,
                      url: `https://play.google.com/store/apps/details?id=${appId}`,
                    });
                  }
                }
              }
            } catch (e) {
              // Continue
            }
          }
        }
    
        return similarApps;
      } catch (error) {
        console.error('Error parsing Google Play similar apps:', error);
        return [];
      }
    }
  • URL builder for the Google Play app details page (where similar apps are listed).
    export function buildSimilarUrl(params) {
      const { appId, lang = 'en', country = 'us' } = params;
      
      if (!appId) {
        throw new Error('appId is required');
      }
    
      return `${GOOGLE_PLAY_BASE}/store/apps/details?id=${appId}&gl=${country}&hl=${lang}`;
    }
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 mentions it's a read operation ('Get'), but doesn't cover aspects like rate limits, authentication needs, error conditions, or what the output looks like (e.g., list of app IDs, app details). This leaves significant gaps for an agent to use it effectively.

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 front-loads the key information ('Get apps similar to the specified app') with necessary context ('Google Play'). There's no wasted words or redundancy.

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 explain the return format (e.g., what 'similar apps' includes), potential limitations, or error handling. For a tool with 3 parameters and no structured output, more context is needed to guide an agent effectively.

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?

Schema description coverage is 100%, so the schema already documents all parameters (appId, lang, country) with their types and defaults. The description doesn't add any additional meaning beyond what's in the schema, such as examples of app IDs or how lang/country affect results. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('apps similar to the specified app'), and specifies the context ('Google Play'). However, it doesn't explicitly differentiate from sibling tools like 'similar' or 'gp_search', which might offer overlapping functionality.

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?

No guidance is provided on when to use this tool versus alternatives like 'gp_search', 'similar', or 'gp_suggest'. The description only states what it does, not when it's appropriate or what distinguishes it from other tools in the server.

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