Skip to main content
Glama

reviews

Retrieve app reviews from app stores with pagination and sorting options to analyze user feedback.

Instructions

Get app reviews with pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoiTunes trackId of the app
appIdNoBundle ID of the app
countryNoTwo-letter country code (default: us)us
pageNoPage number (1-10, default: 1)
sortNoSort order: mostRecent or mostHelpfulmostRecent

Implementation Reference

  • The main handler function for the 'reviews' MCP tool. Builds the reviews URL using buildReviewsUrl, fetches JSON data, parses it with parseReviews, and returns the paginated reviews in JSON format.
    /** * Reviews tool - Get app reviews with pagination */ async function handleReviews(args) { try { const { id, appId, country = 'us', page = 1, sort = 'mostRecent', } = args; if (!id && !appId) { throw new Error('Either id or appId must be provided'); } const url = buildReviewsUrl({ id, appId, country, page, sort }); const data = await fetchJSON(url); const reviews = parseReviews(data); return { content: [ { type: 'text', text: JSON.stringify({ page, reviews, count: reviews.length, }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: error.message }, null, 2), }, ], isError: true, }; } }
  • Input schema definition for the 'reviews' tool, including parameters like id/appId, country, page, and sort order.
    name: 'reviews', description: 'Get app reviews with pagination', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'iTunes trackId of the app', }, appId: { type: 'string', description: 'Bundle ID of the app', }, country: { type: 'string', description: 'Two-letter country code (default: us)', default: 'us', }, page: { type: 'number', description: 'Page number (1-10, default: 1)', default: 1, }, sort: { type: 'string', description: 'Sort order: mostRecent or mostHelpful', default: 'mostRecent', enum: ['mostRecent', 'mostHelpful'], }, }, }, },
  • Registration of the 'reviews' tool handler in the CallToolRequestSchema switch statement.
    case 'reviews': return await handleReviews(args);
  • Helper function that parses the raw iTunes RSS feed JSON into an array of structured review objects.
    export function parseReviews(data) { if (!data || !data.feed || !data.feed.entry) { return []; } // First entry is app metadata, skip it const reviews = Array.isArray(data.feed.entry) ? data.feed.entry.slice(1) : []; return reviews.map(entry => { const author = entry.author?.[0] || entry.author || {}; const rating = entry['im:rating']?.label || entry['im:rating'] || '0'; const version = entry['im:version']?.label || entry['im:version'] || null; const title = entry.title?.label || entry.title || null; const content = entry.content?.label || entry.content?.[0]?.label || entry.content || null; const updated = entry.updated?.label || entry.updated || null; const id = entry.id?.label || entry.id || null; // Extract user ID from author URI if available let userId = null; let userUrl = null; if (author.uri?.label || author.uri) { const uri = author.uri.label || author.uri; const match = uri.match(/\/id(\d+)/); if (match) { userId = match[1]; userUrl = uri; } } return { id: id || null, userName: author.name?.label || author.name || 'Anonymous', userUrl: userUrl || null, version: version, score: parseInt(rating, 10) || 0, title: title, text: content, updated: updated, url: entry.link?.[0]?.attributes?.href || entry.link?.attributes?.href || null, }; }); }
  • Helper function that constructs the iTunes RSS URL for fetching customer reviews based on app ID, country, page, and sort order.
    export function buildReviewsUrl(params) { const { id, appId, country = 'us', page = 1, sort = 'mostRecent' } = params; if (!id && !appId) { throw new Error('Either id or appId must be provided'); } const appIdParam = id || appId; const pageNum = Math.min(page, 10); // Max 10 pages const sortParam = sort === 'mostHelpful' ? 'mostHelpful' : 'mostRecent'; return `${ITUNES_BASE}/${country}/rss/customerreviews/page=${pageNum}/id=${appIdParam}/sortby=${sortParam}/json`; }

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