{"openapi":"3.1.0","info":{"title":"Snake Logic API","version":"0.1.0","description":"A real, stateless, playable snake game engine: grid movement, real self-collision and wall-collision (or wrap-around) detection, and real food-spawn-and-grow logic. 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://snakelogic.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/snakelogic/docs"},"termsOfService":"https://connectorbay.com/snakelogic/terms"},"servers":[{"url":"https://snakelogic.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/snakelogic/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 snake game and returns its initial state (a length-3 snake heading right, one","description":"Starts a fresh snake game and returns its initial state (a length-3 snake heading right, one\n    food cell placed on a random empty cell). Use for \"let's play snake\", \"start a new game\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"width":{"default":14,"description":"Grid width in cells.","maximum":40,"minimum":5,"title":"Width","type":"integer"},"height":{"default":14,"description":"Grid height in cells.","maximum":40,"minimum":5,"title":"Height","type":"integer"},"wrap":{"default":false,"description":"If true, the snake wraps around edges instead of dying on wall contact.","title":"Wrap","type":"boolean"}},"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/move":{"post":{"operationId":"move","summary":"Advances the snake exactly one tick. status is invalid_move (game over already, or a bad","description":"Advances the snake exactly one tick. status is invalid_move (game over already, or a bad\n    direction — state unchanged), in_progress, ate (grew + scored), game_over (wall or\n    self-collision), or win (board full). Use for \"move up\", \"turn left\", \"keep going\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/move.","examples":[{"direction":"right","food":[10,4],"game_over":false,"height":14,"score":0,"snake":[[7,7],[6,7],[5,7]],"ticks":0,"width":14,"wrap":false}],"title":"State","type":"object"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"up, down, left, or right. Omit to continue straight in the current heading. A direct reversal is ignored unless the snake is length 1.","title":"Direction"}},"required":["state"],"title":"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/render":{"post":{"operationId":"render","summary":"A human-readable ASCII grid: H = head, o = body, * = food, . = empty. Use for \"show me the","description":"A human-readable ASCII grid: H = head, o = body, * = food, . = empty. Use for \"show me the\n    board\", \"what does it look like now\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by new_game/move.","examples":[{"direction":"right","food":[10,4],"game_over":false,"height":14,"score":0,"snake":[[7,7],[6,7],[5,7]],"ticks":0,"width":14,"wrap":false}],"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}}}}