Skip to main content
Glama

Save Cloud Data

horizon_save_cloud_data
DestructiveIdempotent

Save a player's progress to the server as a string, overwriting their existing cloud save so it survives reinstalls and loads on another device. Requires userId, data, and sessionToken.

Instructions

Stores a player's save game as one string (usually JSON) on the server, replacing the player's previous save. Use when: the game saves progress so it survives reinstalls and can be loaded on another device. Not for: reading the save (use horizon_load_cloud_data) or server-owned currency that players must not edit (use Validated Actions: horizon_submit_validated and horizon_get_state). Requires: userId and the player's session: sign in with horizon_signin_email or horizon_signin_anonymous and pass its accessToken as sessionToken. Side effects: overwrites the player's single save slot; the old save is gone. Saving the same data again changes nothing. Returns: {success: true, dataSizeBytes}. Errors: 403 when the data exceeds the tier limit (defaults FREE 1 KB, BASIC 5 KB, PRO 20 KB, ENTERPRISE 250 KB): shrink the save or upgrade. 401 means the session is missing or expired: sign in again and retry with the new accessToken. 403 for a session means the token belongs to another user: pass the userId that signed in. 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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe complete save as a string, usually serialized JSON (max 300,000 characters; the tier limit is usually lower)
userIdYesPlayer user ID (UUID) from horizon_signup_* or horizon_signin_*
sessionTokenYesaccessToken from horizon_signin_email or horizon_signin_anonymous for this userId; sent as a Bearer session

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.6.0
    • changedInput schema / properties / data / description
      Previous value: -"Save data string, usually serialized JSON (max 300,000 characters; the tier limit is usually lower)"New value: +"The complete save as a string, usually serialized JSON (max 300,000 characters; the tier limit is usually lower)"
    • changedInput schema / properties / sessionToken / description
      Previous value: -"accessToken returned by horizon_signin_email or horizon_signin_anonymous for this user; sent as a Bearer session"New value: +"accessToken from horizon_signin_email or horizon_signin_anonymous for this userId; sent as a Bearer session"
    • changedInput schema / properties / userId / description
      Previous value: -"User ID (UUID) returned by a horizon_signup_* or horizon_signin_* tool"New value: +"Player user ID (UUID) from horizon_signup_* or horizon_signin_*"
  2. Changed4 schema fields changedv1.5.5
    • changedInput schema / properties / data / description
      Previous value: -"Save data string (max 300,000 characters)"New value: +"Save data string, usually serialized JSON (max 300,000 characters; the tier limit is usually lower)"
    • addedInput schema / properties / sessionToken
      Added value: +{
      +  "description": "accessToken returned by horizon_signin_email or horizon_signin_anonymous for this user; sent as a Bearer session",
      +  "maxLength": 256,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / userId / description
      Previous value: -"User ID (UUID)"New value: +"User ID (UUID) returned by a horizon_signup_* or horizon_signin_* tool"
    • changedInput schema / required
      Previous value: -[
      -  "userId",
      -  "data"
      -]New value: +[
      +  "userId",
      +  "data",
      +  "sessionToken"
      +]
  3. First observedv1.5.4

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes well beyond them: it explains what gets destroyed (the single save slot, old save gone), that re-saving is a no-op, the auth prerequisites (userId + sessionToken from sign-in), and enumerated error meanings (403 tier limit, 401 expired session, 429 rate limit, wrong API key).

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

Conciseness5/5

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

Front-loads the core action in the first sentence, then labels blocks (Use when / Not for / Requires / Side effects / Returns / Errors). Despite its length, every section carries actionable information an agent needs, with no 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 documenting the return shape ({success, dataSizeBytes}) and the full failure surface with status codes and remediation. Auth, side effects, and limits are all covered, leaving no material gap for a mutation tool.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: data is usually serialized JSON subject to a lower tier limit than the schema maxLength, and sessionToken is the accessToken from a specific sign-in tool that must belong to the passed userId. This relationships-and-provenance detail is not in the schema.

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 (Stores) and resource (a player's save game as one string) with scope: it replaces the previous save. Explicitly distinguishes itself from horizon_load_cloud_data and the Validated Actions siblings, so an agent can select it without opening any schema.

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?

Uses explicit 'Use when' and 'Not for' framing, names the alternative read tool (horizon_load_cloud_data) and the server-owned-currency alternative (horizon_submit_validated/horizon_get_state). The condition that selects each sibling is spelled out.

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