Skip to main content
Glama

app

Retrieve comprehensive app details from App Store and Google Play Store using iTunes trackId or bundle ID to analyze applications across iOS and Android platforms.

Instructions

Get detailed information about an app by ID or bundleId

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoiTunes trackId of the app (e.g., 553834731)
appIdNoBundle ID of the app (e.g., com.midasplayer.apps.candycrushsaga)
countryNoTwo-letter country code (default: us)us

Implementation Reference

  • Main handler function for the 'app' MCP tool. Builds the App Store lookup URL, fetches JSON data using fetchJSON, parses it with parseApp, and returns the app details as JSON text content or error.
    async function handleApp(args) { try { const { id, appId, country = 'us' } = args; if (!id && !appId) { throw new Error('Either id or appId must be provided'); } const url = buildAppUrl({ 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), }, ], }; } return { content: [ { type: 'text', text: JSON.stringify(app, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: error.message }, null, 2), }, ], isError: true, }; } }
  • Input schema definition for the 'app' tool, registered in ListToolsRequestSchema handler. Defines parameters: id (number), appId (string), country (string, default 'us').
    { name: 'app', description: 'Get detailed information about an app by ID or bundleId', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'iTunes trackId of the app (e.g., 553834731)', }, appId: { type: 'string', description: 'Bundle ID of the app (e.g., com.midasplayer.apps.candycrushsaga)', }, country: { type: 'string', description: 'Two-letter country code (default: us)', default: 'us', }, }, }, },
  • Registration of the 'app' tool handler in the CallToolRequestSchema switch statement.
    case 'app': return await handleApp(args);
  • Helper function to build the iTunes lookup URL for app details by trackId or bundleId.
    export function buildAppUrl(params) { const { id, appId, country = 'us' } = params; if (id) { return `${ITUNES_BASE}/lookup?id=${id}&country=${country}`; } if (appId) { // First lookup by bundleId to get trackId return `${ITUNES_BASE}/lookup?bundleId=${appId}&country=${country}`; } throw new Error('Either id or appId must be provided'); }
  • Helper function that parses and normalizes the raw iTunes API response into a structured app object.
    export function parseApp(data) { if (!data || !data.results || data.results.length === 0) { return null; } const app = data.results[0]; return { id: app.trackId || null, appId: app.bundleId || null, title: app.trackName || null, url: app.trackViewUrl || null, description: app.description || null, releaseNotes: app.releaseNotes || null, version: app.version || null, releaseDate: app.releaseDate || null, currentVersionReleaseDate: app.currentVersionReleaseDate || null, price: app.price || 0, currency: app.currency || null, free: app.price === 0, developer: { id: app.artistId || null, name: app.artistName || null, url: app.artistViewUrl || null, }, category: { id: app.primaryGenreId || null, name: app.primaryGenreName || null, genres: app.genres || [], }, rating: { average: app.averageUserRating || null, count: app.userRatingCount || 0, }, contentAdvisoryRating: app.contentAdvisoryRating || null, screenshotUrls: app.screenshotUrls || [], ipadScreenshotUrls: app.ipadScreenshotUrls || [], appletvScreenshotUrls: app.appletvScreenshotUrls || [], artwork: { icon: app.artworkUrl512 || app.artworkUrl100 || app.artworkUrl60 || null, icon60: app.artworkUrl60 || null, icon100: app.artworkUrl100 || null, icon512: app.artworkUrl512 || null, }, supportedDevices: app.supportedDevices || [], minimumOsVersion: app.minimumOsVersion || null, languageCodesISO2A: app.languageCodesISO2A || [], fileSizeBytes: app.fileSizeBytes || null, sellerName: app.sellerName || null, formattedPrice: app.formattedPrice || null, isGameCenterEnabled: app.isGameCenterEnabled || false, features: app.features || [], advisories: app.advisories || [], kind: app.kind || null, averageUserRatingForCurrentVersion: app.averageUserRatingForCurrentVersion || null, userRatingCountForCurrentVersion: app.userRatingCountForCurrentVersion || 0, }; }

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