Skip to content

analyze_top_keywords fails for Android platform with "Cannot read properties of undefined (reading 'length')" #9

Description

@PankajSavaliya

Bug Report

Describe the bug

The analyze_top_keywords tool crashes when platform is set to android. It returns a runtime error instead of results. The same tool works correctly on ios.

To Reproduce

{
  "keyword": "pill reminder",
  "platform": "android",
  "num": 5
}

Expected behavior

Should return top-ranking Android apps for the keyword along with keyword analysis, same as it does for iOS.

Actual behavior

{
  "error": "Cannot read properties of undefined (reading 'length')",
  "keyword": "pill reminder",
  "platform": "android"
}

Works fine on iOS

{
  "keyword": "pill reminder",
  "platform": "ios",
  "num": 5
}

✅ Returns correct results on iOS.

Root cause hypothesis

The tool likely reads a .length property on a field that exists in the iOS App Store response but is missing or undefined in the Google Play Store response. The Android data structure may differ (e.g. categoryDistribution or ratings field returning undefined instead of an empty object/array).

Environment

  • Tool: mcp-appstore
  • Method: analyze_top_keywords
  • Platform affected: android only
  • Platform working: ios

Workaround

Manually using search_app + get_app_details on Android as a substitute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions