Skip to main content
Glama
MiguelAlvRed

Store Scraper MCP

by MiguelAlvRed

gp_categories

Retrieve available app categories from Google Play Store to organize and filter app discovery.

Instructions

[Google Play] Get list of available categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for 'gp_categories' tool. Fetches the Google Play apps page using buildCategoriesUrl, parses categories with parseCategories, and returns JSON with categories list and count.
    async function handleGPCategories(args) {
      try {
        const url = buildCategoriesUrl();
        const html = await fetchText(url);
        const categories = parseCategories(html);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                categories,
                count: categories.length,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ error: error.message }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool schema definition in the list of tools, specifying name, description, and empty input schema (no parameters required).
      name: 'gp_categories',
      description: '[Google Play] Get list of available categories',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Dispatch registration in the CallToolRequestSchema switch statement that maps 'gp_categories' tool calls to the handleGPCategories handler.
    case 'gp_categories':
      return await handleGPCategories(args);
  • Helper function that parses HTML from Google Play to extract category IDs using regex on links and scripts, with fallback to a hardcoded list of common categories.
    export function parseCategories(html) {
      if (!html || typeof html !== 'string') {
        return [];
      }
    
      const categories = [];
    
      try {
        // Google Play categories are in navigation/dropdown menus
        // Look for category links
        const categoryLinkMatches = html.matchAll(/<a[^>]*href=["'][^"']*\/store\/apps\/category\/([^/"']+)["'][^>]*>/gi);
        
        for (const match of categoryLinkMatches) {
          const category = match[1];
          if (category && !categories.includes(category)) {
            categories.push(category);
          }
        }
    
        // Also try extracting from script tags with category data
        const scriptMatches = html.matchAll(/<script[^>]*>([\s\S]*?)<\/script>/gi);
        
        for (const match of scriptMatches) {
          const scriptContent = match[1];
          
          if (scriptContent.includes('category') || scriptContent.includes('CATEGORY')) {
            try {
              // Try to find category arrays
              const categoryArrayMatch = scriptContent.match(/categories["']?\s*:\s*\[([\s\S]*?)\]/i);
              if (categoryArrayMatch) {
                const categoryData = categoryArrayMatch[1];
                const categoryMatches = categoryData.matchAll(/"([^"]+)"/g);
                
                for (const catMatch of categoryMatches) {
                  const category = catMatch[1];
                  if (category && !categories.includes(category)) {
                    categories.push(category);
                  }
                }
              }
            } catch (e) {
              // Continue
            }
          }
        }
    
        // If no categories found, return common ones
        if (categories.length === 0) {
          return [
            'APPLICATION',
            'GAME',
            'ART_AND_DESIGN',
            'AUTO_AND_VEHICLES',
            'BEAUTY',
            'BOOKS_AND_REFERENCE',
            'BUSINESS',
            'COMICS',
            'COMMUNICATION',
            'DATING',
            'EDUCATION',
            'ENTERTAINMENT',
            'EVENTS',
            'FINANCE',
            'FOOD_AND_DRINK',
            'HEALTH_AND_FITNESS',
            'HOUSE_AND_HOME',
            'LIBRARIES_AND_DEMO',
            'LIFESTYLE',
            'MAPS_AND_NAVIGATION',
            'MEDICAL',
            'MUSIC_AND_AUDIO',
            'NEWS_AND_MAGAZINES',
            'PARENTING',
            'PERSONALIZATION',
            'PHOTOGRAPHY',
            'PRODUCTIVITY',
            'SHOPPING',
            'SOCIAL',
            'SPORTS',
            'TOOLS',
            'TRAVEL_AND_LOCAL',
            'VIDEO_PLAYERS',
            'WEATHER',
          ];
        }
    
        return categories.sort();
      } catch (error) {
        console.error('Error parsing Google Play categories:', error);
        return [];
      }
    }
  • Helper function that builds the URL for the Google Play apps store page to scrape categories from.
    export function buildCategoriesUrl() {
      return `${GOOGLE_PLAY_BASE}/store/apps`;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states it 'gets' a list without detailing behavior. It doesn't disclose if it's read-only, requires authentication, has rate limits, returns structured data, or handles errors. This is inadequate for a tool with zero annotation coverage.

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 zero waste. It's front-loaded with the core action and context, making it highly concise and well-structured.

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 no annotations, no output schema, and a simple tool with 0 parameters, the description is incomplete. It lacks behavioral details (e.g., what the list contains, format, or error handling) that would help an agent use it correctly, despite the low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema coverage, so the schema fully documents the lack of inputs. The description adds no parameter information, but with no parameters, a baseline of 4 is appropriate as there's nothing to compensate for.

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 ('list of available categories') with specific context ('Google Play'). It doesn't distinguish from siblings like 'gp_list' or 'list' which might also retrieve lists, but the purpose is unambiguous.

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_list' or 'gp_search'. The description implies it's for category data, but doesn't specify use cases, prerequisites, or exclusions.

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