Skip to main content
Glama
appreply-co

mcp-appstore

by appreply-co

fetch_reviews

Retrieve user reviews from Google Play Store or Apple App Store for app analysis and feedback monitoring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesThe unique identifier for the app (Android package name, iOS numeric ID or bundle ID).
platformYesThe platform of the app ('ios' or 'android').
numNoNumber of reviews to fetch (1-1000, default 100). Note: Actual number may be less due to API limitations. For iOS, limited to 10 pages max.
countryNoTwo-letter country code for the App Store/Play Store region. Default 'us'.us
langNoLanguage code for reviews. Default 'en'.en
sortNoSorting order for reviews: 'newest', 'rating', 'helpfulness'. Default 'newest'.newest

Implementation Reference

  • server.js:806-975 (registration)
    Registration of the 'fetch_reviews' MCP tool using server.tool(), including input schema and handler function.
    // Tool to fetch raw reviews without analysis
    server.tool(
      "fetch_reviews",
      {
        appId: z.string().describe("The unique identifier for the app (Android package name, iOS numeric ID or bundle ID)."),
        platform: z.enum(["ios", "android"]).describe("The platform of the app ('ios' or 'android')."),
        num: z.number().optional().default(100).describe("Number of reviews to fetch (1-1000, default 100). Note: Actual number may be less due to API limitations. For iOS, limited to 10 pages max."),
        country: z.string().length(2).optional().default("us").describe("Two-letter country code for the App Store/Play Store region. Default 'us'."),
        lang: z.string().optional().default("en").describe("Language code for reviews. Default 'en'."),
        sort: z.enum(["newest", "rating", "helpfulness"]).optional().default("newest").describe("Sorting order for reviews: 'newest', 'rating', 'helpfulness'. Default 'newest'.")
      },
      async ({ appId, platform, num, country, lang, sort }) => {
        try {
          let reviews = [];
          
          // Fetch reviews from the appropriate platform
          if (platform === "android") {
            let sortType;
            switch (sort) {
              case "newest":
                sortType = gplay.sort.NEWEST;
                break;
              case "rating":
                sortType = gplay.sort.RATING;
                break;
              case "helpfulness":
                sortType = gplay.sort.HELPFULNESS;
                break;
              default:
                sortType = gplay.sort.NEWEST;
            }
            
            const result = await memoizedGplay.reviews({
              appId,
              num: Math.min(num, 1000), // Limit to 1000 reviews max
              sort: sortType,
              country,
              lang
            });
            
            reviews = result.data || [];
            
            // Android reviews have developer replies included if available
            return {
              content: [{ 
                type: "text", 
                text: JSON.stringify({
                  appId,
                  platform,
                  count: reviews.length,
                  reviews: reviews.map(review => ({
                    id: review.id,
                    userName: review.userName,
                    userImage: review.userImage,
                    score: review.score,
                    scoreText: review.scoreText,
                    title: review.title || "",
                    text: review.text,
                    date: review.date,
                    url: review.url,
                    version: review.version,
                    thumbsUp: review.thumbsUp,
                    replyDate: review.replyDate,
                    replyText: review.replyText,
                    hasDeveloperResponse: !!review.replyText
                  }))
                }, null, 2)
              }]
            };
          } else {
            let page = 1;
            let allReviews = [];
            let sortType;
            
            switch (sort) {
              case "newest":
                sortType = appStore.sort.RECENT;
                break;
              case "helpfulness":
                sortType = appStore.sort.HELPFUL;
                break;
              default:
                sortType = appStore.sort.RECENT;
            }
            
            // For iOS, we might need to fetch multiple pages
            while (allReviews.length < num && page <= 10) { // App Store only allows 10 pages
              try {
                // For iOS apps, we need to use id instead of appId
                let iosParams = {};
                
                // Check if the appId is already a numeric ID
                if (/^\d+$/.test(appId)) {
                  iosParams = {
                    id: appId,
                    page,
                    sort: sortType,
                    country
                  };
                } else {
                  // First we need to fetch the app to get its numeric ID
                  try {
                    const appDetails = await memoizedAppStore.app({ appId, country });
                    iosParams = {
                      id: appDetails.id.toString(),
                      page,
                      sort: sortType,
                      country
                    };
                  } catch (appError) {
                    console.error(`Could not fetch app details for ${appId}:`, appError.message);
                    break;
                  }
                }
                
                const pageReviews = await memoizedAppStore.reviews(iosParams);
                
                if (!pageReviews || pageReviews.length === 0) {
                  break; // No more reviews
                }
                
                allReviews = [...allReviews, ...pageReviews];
                page++;
              } catch (err) {
                console.error(`Error fetching reviews page ${page}:`, err);
                break;
              }
            }
            
            reviews = allReviews.slice(0, num);
            
            // iOS reviews don't include developer responses in the API
            return {
              content: [{ 
                type: "text", 
                text: JSON.stringify({
                  appId,
                  platform,
                  count: reviews.length,
                  reviews: reviews.map(review => ({
                    id: review.id,
                    userName: review.userName,
                    userUrl: review.userUrl,
                    score: review.score,
                    title: review.title,
                    text: review.text,
                    date: review.updated,
                    version: review.version,
                    url: review.url,
                    hasDeveloperResponse: false // App Store API doesn't provide this info
                  }))
                }, null, 2)
              }]
            };
          }
        } catch (error) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({
                error: error.message,
                appId,
                platform
              }, null, 2)
            }],
            isError: true
          };
        }
      }
    );
  • The core handler function that fetches raw app reviews from either Google Play Store (using google-play-scraper) or Apple App Store (using app-store-scraper), supporting pagination for iOS and including developer responses where available.
      async ({ appId, platform, num, country, lang, sort }) => {
        try {
          let reviews = [];
          
          // Fetch reviews from the appropriate platform
          if (platform === "android") {
            let sortType;
            switch (sort) {
              case "newest":
                sortType = gplay.sort.NEWEST;
                break;
              case "rating":
                sortType = gplay.sort.RATING;
                break;
              case "helpfulness":
                sortType = gplay.sort.HELPFULNESS;
                break;
              default:
                sortType = gplay.sort.NEWEST;
            }
            
            const result = await memoizedGplay.reviews({
              appId,
              num: Math.min(num, 1000), // Limit to 1000 reviews max
              sort: sortType,
              country,
              lang
            });
            
            reviews = result.data || [];
            
            // Android reviews have developer replies included if available
            return {
              content: [{ 
                type: "text", 
                text: JSON.stringify({
                  appId,
                  platform,
                  count: reviews.length,
                  reviews: reviews.map(review => ({
                    id: review.id,
                    userName: review.userName,
                    userImage: review.userImage,
                    score: review.score,
                    scoreText: review.scoreText,
                    title: review.title || "",
                    text: review.text,
                    date: review.date,
                    url: review.url,
                    version: review.version,
                    thumbsUp: review.thumbsUp,
                    replyDate: review.replyDate,
                    replyText: review.replyText,
                    hasDeveloperResponse: !!review.replyText
                  }))
                }, null, 2)
              }]
            };
          } else {
            let page = 1;
            let allReviews = [];
            let sortType;
            
            switch (sort) {
              case "newest":
                sortType = appStore.sort.RECENT;
                break;
              case "helpfulness":
                sortType = appStore.sort.HELPFUL;
                break;
              default:
                sortType = appStore.sort.RECENT;
            }
            
            // For iOS, we might need to fetch multiple pages
            while (allReviews.length < num && page <= 10) { // App Store only allows 10 pages
              try {
                // For iOS apps, we need to use id instead of appId
                let iosParams = {};
                
                // Check if the appId is already a numeric ID
                if (/^\d+$/.test(appId)) {
                  iosParams = {
                    id: appId,
                    page,
                    sort: sortType,
                    country
                  };
                } else {
                  // First we need to fetch the app to get its numeric ID
                  try {
                    const appDetails = await memoizedAppStore.app({ appId, country });
                    iosParams = {
                      id: appDetails.id.toString(),
                      page,
                      sort: sortType,
                      country
                    };
                  } catch (appError) {
                    console.error(`Could not fetch app details for ${appId}:`, appError.message);
                    break;
                  }
                }
                
                const pageReviews = await memoizedAppStore.reviews(iosParams);
                
                if (!pageReviews || pageReviews.length === 0) {
                  break; // No more reviews
                }
                
                allReviews = [...allReviews, ...pageReviews];
                page++;
              } catch (err) {
                console.error(`Error fetching reviews page ${page}:`, err);
                break;
              }
            }
            
            reviews = allReviews.slice(0, num);
            
            // iOS reviews don't include developer responses in the API
            return {
              content: [{ 
                type: "text", 
                text: JSON.stringify({
                  appId,
                  platform,
                  count: reviews.length,
                  reviews: reviews.map(review => ({
                    id: review.id,
                    userName: review.userName,
                    userUrl: review.userUrl,
                    score: review.score,
                    title: review.title,
                    text: review.text,
                    date: review.updated,
                    version: review.version,
                    url: review.url,
                    hasDeveloperResponse: false // App Store API doesn't provide this info
                  }))
                }, null, 2)
              }]
            };
          }
        } catch (error) {
          return {
            content: [{ 
              type: "text", 
              text: JSON.stringify({
                error: error.message,
                appId,
                platform
              }, null, 2)
            }],
            isError: true
          };
        }
      }
    );
  • Zod input schema defining parameters for the fetch_reviews tool: appId (required), platform (ios/android), num reviews, country, lang, and sort order.
    {
      appId: z.string().describe("The unique identifier for the app (Android package name, iOS numeric ID or bundle ID)."),
      platform: z.enum(["ios", "android"]).describe("The platform of the app ('ios' or 'android')."),
      num: z.number().optional().default(100).describe("Number of reviews to fetch (1-1000, default 100). Note: Actual number may be less due to API limitations. For iOS, limited to 10 pages max."),
      country: z.string().length(2).optional().default("us").describe("Two-letter country code for the App Store/Play Store region. Default 'us'."),
      lang: z.string().optional().default("en").describe("Language code for reviews. Default 'en'."),
      sort: z.enum(["newest", "rating", "helpfulness"]).optional().default("newest").describe("Sorting order for reviews: 'newest', 'rating', 'helpfulness'. Default 'newest'.")
    },
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

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

Parameters1/5

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

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

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/appreply-co/mcp-appstore'

If you have feedback or need assistance with the MCP directory API, please join our Discord server