{"openapi":"3.1.0","info":{"title":"Dot Boxes API","version":"0.1.0","description":"A fully local, playable Dots and Boxes engine with a genuinely chain-aware AI opponent (safe-move avoidance, shortest-chain sacrifice, double-cross endgame rule). Stateless: the caller holds the game state between calls.\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://dotboxes.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/dotboxes/docs"},"termsOfService":"https://connectorbay.com/dotboxes/terms"},"servers":[{"url":"https://dotboxes.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/dotboxes/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":"Start a new Dots and Boxes game on a rows x cols grid of boxes and return its initial state. Use","description":"Start a new Dots and Boxes game on a rows x cols grid of boxes and return its initial state. Use\n    for \"let's play dots and boxes\", \"start a 5x5 game\", \"new game, AI goes first\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"rows":{"default":3,"description":"Number of box rows.","maximum":12,"minimum":1,"title":"Rows","type":"integer"},"cols":{"default":3,"description":"Number of box columns.","maximum":12,"minimum":1,"title":"Cols","type":"integer"},"first_player":{"default":"human","description":"Who moves first: 'human' or 'ai'.","title":"First Player","type":"string"}},"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":"Apply the human player's move: draw the given line. Returns the new state and a status (in_progress","description":"Apply the human player's move: draw the given line. Returns the new state and a status (in_progress\n    / win / loss / draw / invalid_move). Completing a box grants an extra human turn -- check\n    `state.current_player` before calling ai_move.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"Current game state, exactly as returned by a previous call.","title":"State","type":"object"},"line_type":{"description":"'h' for a horizontal line, 'v' for a vertical line.","title":"Line Type","type":"string"},"row":{"description":"Line row index.","minimum":0,"title":"Row","type":"integer"},"col":{"description":"Line column index.","minimum":0,"title":"Col","type":"integer"}},"required":["state","line_type","row","col"],"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/ai_move":{"post":{"operationId":"ai_move","summary":"Compute AND apply the AI's move. 'optimal' never volunteers a free box when a safe move exists,","description":"Compute AND apply the AI's move. 'optimal' never volunteers a free box when a safe move exists,\n    sacrifices the shortest chain when forced to, and applies the double-cross rule at the tail of a long\n    chain when other territory remains. Completing a box grants an extra AI turn -- call this again while\n    `state.current_player` is still \"ai\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"Current game state, exactly as returned by a previous call.","title":"State","type":"object"},"difficulty":{"default":"optimal","description":"'optimal' (chain-aware, double-cross strategy) or 'easy' (random legal move).","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}},"/v1/tools/get_valid_moves":{"post":{"operationId":"get_valid_moves","summary":"List every undrawn line, each annotated with how many boxes (0, 1, or 2) it would immediately","description":"List every undrawn line, each annotated with how many boxes (0, 1, or 2) it would immediately\n    complete if drawn.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"Current game state, exactly as returned by a previous call.","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_board":{"post":{"operationId":"render_board","summary":"Render the current board as a human-readable ASCII grid, with score and turn.","description":"Render the current board as a human-readable ASCII grid, with score and turn.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"Current game state, exactly as returned by a previous call.","title":"State","type":"object"}},"required":["state"],"title":"render_boardArguments","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/analyze_position":{"post":{"operationId":"analyze_position","summary":"Expose the same chain reasoning ai_move uses: whether an immediate capture (and possibly a","description":"Expose the same chain reasoning ai_move uses: whether an immediate capture (and possibly a\n    double-cross) is available, or whether any safe move exists right now.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"Current game state, exactly as returned by a previous call.","title":"State","type":"object"}},"required":["state"],"title":"analyze_positionArguments","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_info":{"post":{"operationId":"rules_info","summary":"Explain how Dots and Boxes is played and the core strategy ideas (safe moves, chains, the","description":"Explain how Dots and Boxes is played and the core strategy ideas (safe moves, chains, the\n    double-cross).","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"rules_infoArguments","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}}}}