Skip to main content
Glama

Check Authentication

horizon_check_auth
Idempotent

Checks whether a player's session token is still valid for a given user, so you can decide if they must sign in again before a session action or when a game resumes.

Instructions

Checks whether a player's session token (accessToken) is still valid for the given user. Use when: before a session tool when the token may have expired, or when a game resumes, to decide whether the player must sign in again. Not for: testing the API key or base URL (use horizon_test_connection) or getting a new token (use horizon_signin_email or horizon_signin_anonymous). Requires: userId and the accessToken from horizon_signup_*, horizon_signin_* or horizon_refresh_session. Side effects: a valid check refreshes the session's one hour idle timeout; nothing else changes. Returns: {userId, isAuthenticated, authStatus, message}. An invalid or expired token is not an HTTP error: isAuthenticated is false, so sign in again with horizon_signin_*. Errors: 400 for a malformed userId or token: pass the values from the sign-in result. 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>"
    },
    "name": "horizon_check_auth"
  }
}

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)

Output Schema

NameRequiredDescriptionDefault
userIdNo
messageNo
authStatusNo
isAuthenticatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.11.1
    • changedInput schema / properties / sessionToken / description
      Previous value: -"accessToken from horizon_signin_email or horizon_signin_anonymous (max 256 characters)"New value: +"Player accessToken from signup, signin or refresh-session, passed as sessionToken (max 256 characters)"
  2. Changed4 schema fields changedv1.6.0
    • changedInput schema / properties / sessionToken / description
      Previous value: -"accessToken returned by a horizon_signin_* tool (max 256 characters)"New value: +"accessToken from horizon_signin_email or horizon_signin_anonymous (max 256 characters)"
    • addedInput schema / properties / sessionToken / minLength
      Added value: +1
    • 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 the result of horizon_signup_* or horizon_signin_*"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "authStatus": {
      +      "anyOf": [
      +        {
      +          "description": "Server auth status name",
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "isAuthenticated": {
      +      "anyOf": [
      +        {
      +          "description": "true when the session is valid",
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "message": {
      +      "anyOf": [
      +        {
      +          "description": "Human-readable status message",
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "userId": {
      +      "anyOf": [
      +        {
      +          "description": "User ID the session belongs to",
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed2 schema fields changedv1.5.5
    • changedInput schema / properties / sessionToken / description
      Previous value: -"Session token (max 256 characters)"New value: +"accessToken returned by a horizon_signin_* tool (max 256 characters)"
    • changedInput schema / properties / userId / description
      Previous value: -"User ID (UUID)"New value: +"User ID (UUID) returned by a horizon_signup_* or horizon_signin_* tool"
  4. First observedv1.5.4

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing a real side effect (a valid check refreshes the one-hour idle timeout, nothing else changes), the non-obvious fact that an invalid token is not an HTTP error but isAuthenticated=false, the HORIZON_API_KEY requirement, and the meaning of 400/401/429 failures. The side-effect disclosure is consistent with readOnlyHint=false and idempotentHint=true.

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?

Well front-loaded and organized with labeled Use when / Not for / Requires / Side effects / Returns / Errors sections, so an agent can scan it quickly. The 'Returns' sentence largely restates the existing output schema, which is the one piece that does not fully earn its place.

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?

Covers everything an agent needs for a two-parameter auth check: prerequisites, the crucial distinction between an invalid token and an HTTP error, what to do next on failure, the auth-key dependency, and rate-limit recovery. Output schema exists, so the return-value sentence is supplementary rather than a gap-filler.

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 both parameters are already documented, including that the token is passed as sessionToken with a 256-character cap. The description only adds the provenance chain (values from horizon_signup_*/signin/refresh) and the 400 cause for malformed values, which is a modest increment over 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 and resource: checks whether a player's session token (accessToken) is still valid for the given user. It is immediately distinguishable from horizon_test_connection (API key/base URL) and horizon_signin_* (new token) 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?

Explicit 'Use when' conditions (before session tools when the token may have expired, on game resume to decide re-signin) and explicit 'Not for' exclusions that name the correct alternative tools. No inference is required to choose between this and its siblings.

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