{"openapi":"3.1.0","info":{"title":"War Card API","version":"0.1.0","description":"A real, stateless, playable two-player card-battle engine (higher card wins, with a full war-tie/burn mechanic). Every tool call takes the full game state and returns the new state; nothing is stored server-side.\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://warcard.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/warcard/docs"},"termsOfService":"https://connectorbay.com/warcard/terms"},"servers":[{"url":"https://warcard.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/warcard/docs"},"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/new_game":{"post":{"operationId":"new_game","summary":"Shuffles a fresh 52-card deck and deals it evenly (26/26) between player and AI. Use for","description":"Shuffles a fresh 52-card deck and deals it evenly (26/26) between player and AI. Use for\n    \"let's play War\", \"start a new game\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"new_gameArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_valid_moves":{"post":{"operationId":"get_valid_moves","summary":"War has no real decisions -- returns [\"play_round\"] while the game is still in progress,","description":"War has no real decisions -- returns [\"play_round\"] while the game is still in progress,\n    else an empty list. Use for \"what can I do here\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/play_round/play_until_done.","examples":[{"ai_deck":["KS","9D"],"last_round":null,"player_deck":["7H","2C"],"rounds_played":3,"status":"in_progress","winner":null}],"title":"State","type":"object"}},"required":["state"],"title":"get_valid_movesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/play_round":{"post":{"operationId":"play_round","summary":"Plays exactly one forced round: both sides flip their top card, higher card wins both --","description":"Plays exactly one forced round: both sides flip their top card, higher card wins both --\n    with a full war-tie escalation (burn 3, flip 1, repeat on further ties) automatically resolved\n    and reported in `round_result.war_steps` when a tie occurs. status is invalid_move, in_progress,\n    win (game over, `winner` set to player or ai), or draw (extremely rare stalemate safety valve).\n    Use for \"flip the next card\", \"play a round\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/play_round/play_until_done.","examples":[{"ai_deck":["KS","9D"],"last_round":null,"player_deck":["7H","2C"],"rounds_played":3,"status":"in_progress","winner":null}],"title":"State","type":"object"}},"required":["state"],"title":"play_roundArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/play_until_done":{"post":{"operationId":"play_until_done","summary":"Auto-plays forced rounds until the game ends or `max_rounds` is reached, returning the final","description":"Auto-plays forced rounds until the game ends or `max_rounds` is reached, returning the final\n    state plus how many rounds ran and the last few round results. Use for \"just play this whole\n    game out\", \"who wins\", \"fast forward\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/play_round/play_until_done.","examples":[{"ai_deck":["KS","9D"],"last_round":null,"player_deck":["7H","2C"],"rounds_played":3,"status":"in_progress","winner":null}],"title":"State","type":"object"},"max_rounds":{"default":2000,"description":"Safety cap on additional rounds to auto-play.","maximum":5000,"minimum":1,"title":"Max Rounds","type":"integer"}},"required":["state"],"title":"play_until_doneArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/render":{"post":{"operationId":"render","summary":"A human-readable summary: each side's remaining deck size, the last round played (including","description":"A human-readable summary: each side's remaining deck size, the last round played (including\n    any war), and the game status. Use for \"show me the score\", \"who's ahead\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/play_round/play_until_done.","examples":[{"ai_deck":["KS","9D"],"last_round":null,"player_deck":["7H","2C"],"rounds_played":3,"status":"in_progress","winner":null}],"title":"State","type":"object"}},"required":["state"],"title":"renderArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/rules":{"post":{"operationId":"rules","summary":"Plain-language rules: how a round is won, exactly how the war-tie mechanic works, and why","description":"Plain-language rules: how a round is won, exactly how the war-tie mechanic works, and why\n    there's no AI opponent to out-think here. Use for \"how do you play War\", \"what happens on a\n    tie\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"anyOf":[{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/play_round/play_until_done.","examples":[{"ai_deck":["KS","9D"],"last_round":null,"player_deck":["7H","2C"],"rounds_played":3,"status":"in_progress","winner":null}],"type":"object"},{"type":"null"}],"default":null,"title":"State"}},"title":"rulesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}