{"openapi":"3.1.0","info":{"title":"Empire Build API","version":"0.1.0","description":"A real, playable, fully local territory/civilization-lite sim — a deterministic tile map with real per-tile yields, real adjacency-validated territory claiming, a real combat-resolution formula with documented randomness bounds for garrisoned tiles, and real per-turn income aggregation. Fully stateless — every tool call passes the full game state.\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://empirebuild.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/empirebuild/docs"},"termsOfService":"https://connectorbay.com/empirebuild/terms"},"servers":[{"url":"https://empirebuild.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/empirebuild/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 new Empire Build game owning the center tile, and returns the initial `state`. Use","description":"Starts a new Empire Build game owning the center tile, and returns the initial `state`. Use\n    for \"let's build an empire\", \"start a territory game\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"target_tiles":{"default":8,"description":"Tiles to control to win.","examples":[8],"maximum":25,"minimum":2,"title":"Target Tiles","type":"integer"},"max_turns":{"default":20,"description":"Turns available before the game ends in a loss.","examples":[20],"minimum":1,"title":"Max Turns","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/claim_tile":{"post":{"operationId":"claim_tile","summary":"Claims a tile adjacent to your territory. Unguarded tiles cost real gold; garrisoned tiles","description":"Claims a tile adjacent to your territory. Unguarded tiles cost real gold; garrisoned tiles\n    trigger real combat first (documented randomness bounds) and only succeed on a win, with\n    casualties either way. Use for \"claim tile 1,2\", \"attack the tile north of me\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by a previous call in this connector.","title":"State","type":"object"},"tile_id":{"description":"Tile to claim, as 'row,col'.","examples":["1,2"],"title":"Tile Id","type":"string"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Optional seed for reproducible combat rolls.","title":"Seed"}},"required":["state","tile_id"],"title":"claim_tileArguments","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/recruit_army":{"post":{"operationId":"recruit_army","summary":"Recruits `count` army units at a real per-unit gold cost. Use for \"recruit 5 troops\".","description":"Recruits `count` army units at a real per-unit gold cost. Use for \"recruit 5 troops\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by a previous call in this connector.","title":"State","type":"object"},"count":{"description":"Army units to recruit.","exclusiveMinimum":0,"title":"Count","type":"integer"}},"required":["state","count"],"title":"recruit_armyArguments","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/advance_turn":{"post":{"operationId":"advance_turn","summary":"Ends the current turn: collects real income from every owned tile minus army upkeep, then","description":"Ends the current turn: collects real income from every owned tile minus army upkeep, then\n    checks win/loss. Use for \"end turn\", \"next turn\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by a previous call in this connector.","title":"State","type":"object"}},"required":["state"],"title":"advance_turnArguments","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_status":{"post":{"operationId":"get_status","summary":"Structured numeric status: gold, army, tiles owned, per-turn income, and claimable","description":"Structured numeric status: gold, army, tiles owned, per-turn income, and claimable\n    neighbors. Use for \"what's my current status\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by a previous call in this connector.","title":"State","type":"object"}},"required":["state"],"title":"get_statusArguments","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/list_map":{"post":{"operationId":"list_map","summary":"Every tile's yield, garrison strength, and ownership — use this to plan your next claim. Use","description":"Every tile's yield, garrison strength, and ownership — use this to plan your next claim. Use\n    for \"show me the map\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by a previous call in this connector.","title":"State","type":"object"}},"required":["state"],"title":"list_mapArguments","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_game":{"post":{"operationId":"render_game","summary":"A human-readable status summary — show this to the player, not raw state. Use for \"how's my","description":"A human-readable status summary — show this to the player, not raw state. Use for \"how's my\n    empire doing\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"additionalProperties":true,"description":"The current game state, exactly as returned by a previous call in this connector.","title":"State","type":"object"}},"required":["state"],"title":"render_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/game_rules":{"post":{"operationId":"game_rules","summary":"Explains the map's yield/garrison pattern, claim cost, and combat-resolution formulas, with","description":"Explains the map's yield/garrison pattern, claim cost, and combat-resolution formulas, with\n    no live game needed. Use for \"how does this game work\", \"what are the formulas\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"game_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}}}}