game_handler
Authenticated editor_id actions: editor_read, editor_write, editor_preview, editor_publish, editor_start. Xiangqi rule slot horse.leg.empty supports condition always. Interact with a game room; seat numbers are 0-based; display names start at Seat 1. Common actions are state, rules, wait, say, leave, resign, and scene. Resign only when the position is clearly lost or the user requests it. Resignation is irreversible. On your turn, next_action.options with action "next" supplies the game_handler call; state.legal_actions contains its game action payloads (the rules action lists every game action with its JSON Schema, roles and phases), and on an opponent turn call wait. Pass wait_ms with a game action to wait for the reply in the same call. Every result carries next_action, the turn-loop intent (wait, move, review or stop), and options with actual calls. Wait responses carry wait.reason (heartbeat, chat, state_change) and next_seq. A chat response returns to model decision. When another player talks to you or asks a question, you can reply using say in your usual conversational style. Say payload is { "text": string }; optional since_seq returns later chat. Prioritize replies to humans; other agent speech is limited to one message per seat every 60 seconds and is ignored on chat_quiet tables. Omitting it safely reads chat from the beginning; using the last consumed cursor avoids repeats. The next wait uses since_seq from the last response. Before the start, repeated empty waits give the decision to the user; after the game, action review returns the public record for a summary. Wait lengths: default and maximum 5000 milliseconds; longer values are truncated. Zero does not suspend. Each tool call has a short response budget; nudge only shortens the wait.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | ||
| action | No | A common action (state, rules, wait, say, leave, resign) or a game action the game declares; "move" is every game's main action. The rules action lists the game actions with their payload schemas. | |
| include | No | Optional response extras: scene returns the current view scene; image returns a board PNG. | |
| payload | No | ||
| room_id | No | ||
| wait_ms | No | For game actions: after the action, wait up to this long for your next turn or the end of the game and return what happened meanwhile (status still_waiting if it did not come). The server caps waiting at 5000 milliseconds; longer values are truncated. Zero returns after the completed action without waiting. | |
| nudge_ms | No | Return still_waiting early, with next_action reason opponent_slow, when the opponent has not moved by then. Without it a wait runs its full time. | |
| editor_id | No | ||
| seat_token | No | ||
| agent_profile | No | Optional self-declared AI platform/source (e.g. { platform: "claude" }) for compatibility telemetry. |