{"openapi":"3.1.0","info":{"title":"Mancala Play API","version":"0.1.0","description":"A real, stateless, playable Kalah-rules sowing game engine (full sowing logic, extra-turn-on-own-store, landing-in-empty-own-pit captures, end-game sweep) with a minimax + alpha-beta pruning AI opponent (easy/medium/hard difficulty). 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://mancalaplay.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/mancalaplay/docs"},"termsOfService":"https://connectorbay.com/mancalaplay/terms"},"servers":[{"url":"https://mancalaplay.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/mancalaplay/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":"Starts a fresh mancala game (12 pits + 2 stores) and returns its initial state. Use for","description":"Starts a fresh mancala game (12 pits + 2 stores) and returns its initial state. Use for\n    \"let's play mancala\", \"start a new game\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"first_player":{"default":"A","description":"Which side moves first.","examples":["A","B"],"title":"First Player","type":"string"},"stones_per_pit":{"default":4,"description":"Starting stones in each of the 12 pits (default 4).","maximum":10,"minimum":1,"title":"Stones Per Pit","type":"integer"}},"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/make_move":{"post":{"operationId":"make_move","summary":"Sows from `pit` and returns the resulting state. status is invalid_move (illegal — state","description":"Sows from `pit` and returns the resulting state. status is invalid_move (illegal — state\n    unchanged), in_progress, extra_turn (landed in the mover's own store — SAME player moves\n    again), or win (a side's pits emptied; the sweep has been applied). Use for \"sow from pit 3\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/make_move.","examples":[{"current_player":"A","pits":[4,4,4,4,4,4,0,4,4,4,4,4,4,0]}],"title":"State","type":"object"},"pit":{"description":"One of the mover's own pits: 0-5 for A, 7-12 for B.","maximum":12,"minimum":0,"title":"Pit","type":"integer"}},"required":["state","pit"],"title":"make_moveArguments","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":"Lists the mover's non-empty pits. Empty once the game has ended. Use for \"which pits can I","description":"Lists the mover's non-empty pits. Empty once the game has ended. Use for \"which pits can I\n    play\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/make_move.","examples":[{"current_player":"A","pits":[4,4,4,4,4,4,0,4,4,4,4,4,4,0]}],"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/render":{"post":{"operationId":"render","summary":"A human-readable board: both rows of pits, both stores, and pit-index legends. Use for \"show","description":"A human-readable board: both rows of pits, both stores, and pit-index legends. Use for \"show\n    me the board\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/make_move.","examples":[{"current_player":"A","pits":[4,4,4,4,4,4,0,4,4,4,4,4,4,0]}],"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/ai_move":{"post":{"operationId":"ai_move","summary":"Chooses the AI's next pit to sow from for whichever side is currently to move, WITHOUT","description":"Chooses the AI's next pit to sow from for whichever side is currently to move, WITHOUT\n    applying it — call make_move with the returned `pit` to actually play it. Use for \"make the\n    computer's move\", \"play as the AI on hard\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/make_move.","examples":[{"current_player":"A","pits":[4,4,4,4,4,4,0,4,4,4,4,4,4,0]}],"title":"State","type":"object"},"difficulty":{"default":"hard","description":"easy, medium, or hard (default). Real minimax + alpha-beta search at every level; hard searches deepest.","title":"Difficulty","type":"string"}},"required":["state"],"title":"ai_moveArguments","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}}}}