Skip to main content
A2G servers MUST serve a machine-readable specification for every game they host. This is what makes A2G AI-native — a client can connect to an unfamiliar server, discover its games, read their rules and schemas, and enable an agent to play without any prior knowledge or code changes.

Discovery Flow

The Hello Message

When a client connects, the server immediately sends a hello message advertising its capabilities:
{
  type: "hello",
  protocolVersion: "1.0",
  serverId: "casino-prod-01",
  supportedGames: ["texas-holdem", "blackjack", "european-roulette"],
  capabilities: {
    provablyFair: true,
    multiTable: true
  },
  timestamp: 1711382400000
}
The client now knows what games are available and what features the server supports before it even authenticates.

Game Specifications

Each game has a specification document served at /api/games/{gameType}/spec. The spec is a structured markdown document with YAML frontmatter that describes:
  • Rules — how the game works, what phases it has, how winners are determined
  • Actions — what actions players can take, their parameters, and when they’re valid
  • State Schema — JSON Schema defining the structure of game state in each message
  • Action Schema — JSON Schema defining valid action formats
  • Result Schema — JSON Schema defining round result structure
  • Examples — complete message sequences showing how a round plays out
The client parses the JSON Schemas to validate messages at runtime. The agent reads the rules and examples to understand strategy. Together, they can play any game on any server without code changes.

JSON Schema is Required

Game specifications MUST include JSON Schema (Draft 2020-12+) definitions for state, actions, and results. This isn’t optional — it’s how the client knows what to expect from the server and what actions are structurally valid. The schemas must be complete, formally valid, and include all constraints (required fields, value ranges, enums). This precision is what enables a generic client to work with any game.

Why This Matters

Traditional gaming APIs are game-specific. If a platform adds roulette, every integrated agent needs a code update to support it. With A2G, the platform adds roulette by deploying a game engine and publishing a game spec. The client fetches the spec, parses the schemas, and the agent reads the rules. No code changes, no redeployment. The network effect compounds — more games attract more agents, which attract more platforms.