Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums
  1. Home
  2. General
  3. [Bug Report] [Cloud Code / MCP] Different leaderboard entry fields between Portal and MCP execution

[Bug Report] [Cloud Code / MCP] Different leaderboard entry fields between Portal and MCP execution

Scheduled Pinned Locked Moved Unsolved General
3 Posts 2 Posters 16 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moondory77
    wrote last edited by
    #1

    Hi BrainCloud Team

    The same uploaded Cloud Code script succeeds in Portal Run and Debug, but fails when called through MCP using the same app and parameters.

    Inside Cloud Code, the script calls:

    leaderboardProxy.getGlobalLeaderboardPageByVersion(
    leaderboardId, "HIGH_TO_LOW", 0, 0, 1
    );

    The original script successfully reads score, rank, and data when executed from the Portal. However, diagnostics during MCP execution show:

    • score, rank, and data are undefined.
    • The entry contains bestScore, otherData, and tRank instead.
    • isClientBridge() returns true; isServerBridge() returns false.

    This difference is observable inside the Cloud Code script, before its result is returned to MCP.

    Steps to reproduce

    1. Use a client-callable Cloud Code script that reads an existing historical division leaderboard.
    2. Inspect the first entry’s keys and its score, rank, and data fields.
    3. Compare Portal Run and Debug with MCP initClientSession → runScript, using identical inputs.

    Expected: consistent entry fields across both execution paths.

    Supporting both field formats in our script works around the issue. Is this difference intentional, or could it be a response-conversion bug?

    1 Reply Last reply
    0
    • M moondory77 has marked this topic as solved
    • M moondory77 has marked this topic as unsolved
    • Paul WinterhalderP Offline
      Paul WinterhalderP Offline
      Paul Winterhalder
      brainCloudAdmin
      wrote last edited by
      #2

      Can you copy the errors here or send us a support chat message with them?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        moondory77
        wrote last edited by moondory77
        #3

        To clarify, the API call returns 200. The error comes from our Cloud Code validation because score is undefined.

        During MCP execution, getGlobalLeaderboardPageByVersion() returns
        entries containing bestScore and otherData,
        while score, data, and rank are missing.

        The same script works in Portal Run and Debug—the issue is the differing response structure.

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Solved
        • Unsolved
        • Users