Skip to main content
Glama

Check Authentication

horizon_check_auth
Idempotent

Checks if a player's session token is still valid, helping decide whether they must sign in again before 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_signin_email or horizon_signin_anonymous. 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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesPlayer user ID (UUID) from the result of horizon_signup_* or horizon_signin_*
sessionTokenYesaccessToken from horizon_signin_email or horizon_signin_anonymous (max 256 characters)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNo
messageNo
authStatusNo
isAuthenticatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. 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"
  3. First observedv1.5.4

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false and idempotentHint=true; the description supplies the reason — a valid check refreshes the one-hour idle timeout and nothing else changes — which is exactly the non-obvious behavior the hint implies. It further discloses that an invalid token is NOT an HTTP error (isAuthenticated=false), the API-key requirement, the 429 rate-limit meaning, and the isError contract on failures.

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?

Dense but well-labeled (Use when / Not for / Requires / Side effects / Returns / Errors) with the core purpose front-loaded. Slightly over-long: the recover-by-signing-in guidance appears twice (under Returns and implicitly under Not for), and the Returns detail overlaps the output schema.

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?

For a two-parameter authenticated check, the description covers trigger, alternatives, prerequisites, side effects, success shape, and the full error taxonomy — more than enough even though an output schema already exists. Nothing an agent needs to call it correctly is missing.

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 schema already documents both parameters, but the description adds real meaning by naming the origin of each value (userId from signup/signin, token from horizon_signin_*) and explaining that a 400 means malformed input. Minor friction: the prose calls the token 'accessToken' while the schema property is 'sessionToken', resolving the synonym is left to the schema's own description.

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 (checks) and resource (a player's session token validity for a userId) up front, and explicitly differentiates itself from siblings like horizon_test_connection and horizon_signin_*. An agent can identify the tool's role without opening the 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?

Provides an explicit 'Use when' trigger (before session tools when a token may have expired, or on game resume) and an explicit 'Not for' with named alternatives for both excluded cases. Nothing about tool selection is left to inference.

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