Skip to main content
Glama

gp_search

Search Google Play Store apps using keywords, country codes, and language filters to retrieve app listings and 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

  • The main handler function for the 'gp_search' tool. It extracts parameters from args, validates the search term, builds the Google Play search URL using buildGPSearchUrl, fetches the HTML content, parses it using parseGPSearch, and returns the structured results as JSON or an 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, }; } }
  • The input schema definition for the 'gp_search' tool, specifying parameters like term (required), country, lang, and num with descriptions and defaults.
    { name: 'gp_search', description: '[Google Play] Search for apps', 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'], }, },
  • The switch case in the CallToolRequestSchema handler that routes calls to the 'gp_search' tool to the handleGPSearch function.
    case 'gp_search': return await handleGPSearch(args);
  • The buildSearchUrl function (imported as buildGPSearchUrl) that constructs the Google Play search URL based on term, country, lang, and other parameters.
    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()}`; }
  • The parseSearchResults function (imported as parseGPSearch) that wraps parseSearch to return structured results with results array and count for Google Play search HTML.
    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