Skip to main content
Glama

Link Guest Account to Apple

horizon_link_apple
Destructive

Converts a signed-in guest player into an Apple account while preserving the same user ID, verifying the Apple identity token and keeping the current session active.

Instructions

Converts a signed-in guest player into an Apple account while keeping the same user ID. Use when: a guest player completes Apple Sign-In and explicitly chooses to link the account. Not for: new players (use horizon_signup_apple), existing apple accounts (use horizon_signin_apple) and accounts that are not guests. Requires: a signed-in guest player: the userId and current accessToken from horizon_signup_anonymous or horizon_signin_anonymous. Side effects: verifies the identity token and turns the guest into an APPLE account with the same userId. The current session keeps working and the guest anonymous token is deleted on the server. Returns: 200 with userId, appleUserId, isPrivateRelayEmail, isAnonymous: false, isVerified and authStatus: AUTHENTICATED. Use horizon_signin_apple on other devices. Errors: 409 when the Apple account already belongs to another account or the account is not a guest: do not retry, ask the player. 401 for an invalid session: sign in again. 400 for invalid input. 404 or 403 for other failures. Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "userId": "<userId>",
      "sessionToken": "<sessionToken>",
      "appleIdentityToken": "<appleIdentityToken>"
    },
    "name": "horizon_link_apple"
  }
}

Input Schema

NameRequiredDescriptionDefault
userIdYesPlayer user ID (UUID) from the result of horizon_signup_* or horizon_signin_*
sessionTokenYesPlayer accessToken from signup, signin or refresh-session, passed as sessionToken (max 256 characters)
preferredLanguageNoOptional language code for the account, such as en or de (max 10 characters)
appleIdentityTokenYesApple identity-token JWT obtained after player consent, with audience matching this project's configured Services ID or Bundle ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, and the description goes well beyond them: it discloses that the identity token is verified, the account flips to APPLE with the same userId, the current session survives, and the guest anonymous token is deleted server-side. It also maps failure modes (409 do-not-retry, 401 re-signin, 429 wait-and-retry, HORIZON_API_KEY misconfiguration cross-checked against horizon_test_connection), which is exactly the operational context annotations cannot convey.

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

Conciseness4/5

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

Labeled sections (Use when / Not for / Requires / Side effects / Returns / Errors) make it fast to scan, and purpose is front-loaded in the first sentence. It is on the long side, with the error enumeration carrying the most bulk, but nearly every line is actionable rather than filler.

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

Completeness5/5

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

No output schema exists, and the description compensates fully by spelling out the 200 response fields (userId, appleUserId, isPrivateRelayEmail, isAnonymous:false, isVerified, authStatus). Combined with prerequisites, destructive side effects, and status-coded errors, an agent has everything needed to call this correctly or decide not to.

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

Parameters3/5

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

Schema description coverage is 100%, so userId, sessionToken, preferredLanguage and appleIdentityToken are already documented, including the accessToken-as-sessionToken mapping and the audience requirement. The description reinforces the session source but adds no new format or constraint detail beyond the schema, so the baseline of 3 applies.

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

Purpose5/5

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

States a specific verb and transformation: converts a signed-in guest player into an Apple account while preserving the same userId. That framing is immediately distinguishable from horizon_signup_apple (new players) and horizon_signin_apple (existing Apple accounts), which the description names explicitly.

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

Usage Guidelines5/5

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

Provides an explicit 'Use when' trigger (guest completes Apple Sign-In and chooses to link) and a 'Not for' list routing to horizon_signup_apple, horizon_signin_apple, and non-guest accounts. Prerequisites (a signed-in guest with userId and accessToken from the anonymous flows) are stated up front.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools