Skip to main content
Glama

gp_search

Search Google Play Store for apps using specific terms, countries, languages, and result counts to retrieve app data.

Instructions

[Google Play] Search for apps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
termYesSearch term
countryNoTwo-letter country code (default: us)us
langNoLanguage code (default: en)en
numNoNumber of results (default: 250)

Implementation Reference

  • Main execution handler for gp_search tool: validates input, builds Google Play search URL, fetches HTML, parses results, returns JSON response or error.
    async function handleGPSearch(args) { try { const { term, country = 'us', lang = 'en', num = 250, } = args; if (!term) { throw new Error('term is required'); } const url = buildGPSearchUrl({ term, country, lang, num }); const html = await fetchText(url); const result = parseGPSearch(html); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: error.message }, null, 2), }, ], isError: true, }; } }
  • Input schema defining parameters for gp_search: term (required string), country, lang, num with defaults.
    inputSchema: { type: 'object', properties: { term: { type: 'string', description: 'Search term', }, country: { type: 'string', description: 'Two-letter country code (default: us)', default: 'us', }, lang: { type: 'string', description: 'Language code (default: en)', default: 'en', }, num: { type: 'number', description: 'Number of results (default: 250)', default: 250, }, }, required: ['term'], },
  • Dispatch registration in CallToolRequestSchema switch statement routing 'gp_search' to handleGPSearch.
    case 'gp_search': return await handleGPSearch(args);
  • Helper function buildSearchUrl (aliased as buildGPSearchUrl) constructs the Google Play search endpoint URL.
    export function buildSearchUrl(params) { const { term, country = 'us', lang = 'en', num = 250, fullDetail = false, } = params; const queryParams = new URLSearchParams({ q: term, c: 'apps', gl: country, hl: lang, }); return `${GOOGLE_PLAY_BASE}/store/search?${queryParams.toString()}`; }
  • Helper parser parseSearchResults (aliased as parseGPSearch) wraps parseSearch to return structured results with count.
    export function parseSearchResults(html) { const apps = parseSearch(html); return { results: apps, count: apps.length, }; }

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