{"openapi":"3.1.0","info":{"title":"Resource Race API","version":"0.1.0","description":"A real, playable, fully local resource-management economy sim — worker allocation drives real production, population eats real food with a genuinely computed starvation penalty on shortage, buildings upgrade on a real polynomial cost curve, and surplus food grows population. 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://resourcerace.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/resourcerace/docs"},"termsOfService":"https://connectorbay.com/resourcerace/terms"},"servers":[{"url":"https://resourcerace.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/resourcerace/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 Resource Race colony (population 6, starter resources and buildings) and returns","description":"Starts a new Resource Race colony (population 6, starter resources and buildings) and returns\n    the initial `state`. Use for \"let's build a colony\", \"start a resource management game\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"target_population":{"default":50,"description":"Population to reach to win. Starting population is 6.","examples":[50],"minimum":7,"title":"Target Population","type":"integer"},"max_turns":{"default":30,"description":"Turns available to reach the target before the colony loses.","examples":[30],"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/assign_workers":{"post":{"operationId":"assign_workers","summary":"Reallocates the whole workforce across wood/food/gold for future turns (unassigned","description":"Reallocates the whole workforce across wood/food/gold for future turns (unassigned\n    population is idle). Takes effect starting with the next advance_turn. Use for \"assign 3\n    workers to food\", \"put everyone on gold\".","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"},"wood":{"description":"Population to assign to wood-cutting.","minimum":0,"title":"Wood","type":"integer"},"food":{"description":"Population to assign to farming.","minimum":0,"title":"Food","type":"integer"},"gold":{"description":"Population to assign to gold-mining.","minimum":0,"title":"Gold","type":"integer"}},"required":["state","wood","food","gold"],"title":"assign_workersArguments","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/build":{"post":{"operationId":"build","summary":"Upgrades a building by one level, deducting its real polynomial, level-scaled cost — fails","description":"Upgrades a building by one level, deducting its real polynomial, level-scaled cost — fails\n    with a clear error if unaffordable. Use for \"build a farm\", \"upgrade the mine\".","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"},"building":{"description":"Which building to upgrade by one level.","examples":["house","sawmill","farm","mine"],"title":"Building","type":"string"}},"required":["state","building"],"title":"buildArguments","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: applies production, food consumption, the starvation penalty if food","description":"Ends the current turn: applies production, food consumption, the starvation penalty if food\n    ran short, building upkeep, and population growth from surplus food, then checks win/loss. Use\n    for \"end turn\", \"next turn\", \"advance the game\".","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: resources, workers, buildings, housing capacity, and next upgrade","description":"Structured numeric status: resources, workers, buildings, housing capacity, and next upgrade\n    costs. Use for \"what's my current status\", \"show me the numbers\".","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/render_game":{"post":{"operationId":"render_game","summary":"A human-readable status summary of the colony — show this to the player, not raw state. Use","description":"A human-readable status summary of the colony — show this to the player, not raw state. Use\n    for \"how's my colony 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 every production, consumption, starvation, growth and upgrade-cost formula, with no","description":"Explains every production, consumption, starvation, growth and upgrade-cost formula, with no\n    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}}}}