Docs
Tool Reference

Action Tools

Tools that modify game state

Tools that modify game state — unit commands, production, research, diplomacy. (34 tools)

Appoint a new governor.

Details
Args:
        governor_type: e.g. GOVERNOR_THE_EDUCATOR (Pingala), GOVERNOR_THE_DEFENDER (Victor)

    Requires available governor points. Use get_governors to see options.
ParameterTypeDefaultDescription
governor_type*stringGovernor Type

Assign an appointed governor to a city.

Details
Args:
        governor_type: The governor type (from get_governors output)
        city_id: The city ID (from get_cities output)

    Governor must already be appointed. Takes several turns to establish.
ParameterTypeDefaultDescription
governor_type*stringGovernor Type
city_id*integerCity Id

Switch to a different government type.

Details
Args:
        government_type: e.g. GOVERNMENT_CLASSICAL_REPUBLIC, GOVERNMENT_OLIGARCHY

    Use get_policies to see current government. First switch after
    unlocking a new tier is free (no anarchy).
ParameterTypeDefaultDescription
government_type*stringGovernment Type

Choose a dedication/commemoration for the current era.

Details
Args:
        dedication_index: The index of the dedication (from get_dedications output)

    Use get_dedications first to see available options and their bonuses.
ParameterTypeDefaultDescription
dedication_index*integerDedication Index

Found a pantheon with the specified belief.

Details
Args:
        belief_type: e.g. BELIEF_GOD_OF_THE_FORGE, BELIEF_DIVINE_SPARK

    Use get_pantheon_beliefs first to see options. Requires enough faith
    and no existing pantheon.
ParameterTypeDefaultDescription
belief_type*stringBelief Type

Issue a command to a city.

Details
Args:
        city_id: City ID (from get_cities output)
        action: Currently supported: 'attack' (city ranged attack)
        target_x: Target X coordinate (required for attack)
        target_y: Target Y coordinate (required for attack)

    For attack: city must have walls and not have fired this turn.
    Range is 2 tiles from city center.

    For captured/disloyal city decisions (city_id is ignored, uses pending city):
    - 'keep': Keep the city (works for both captured and loyalty-flipped cities)
    - 'reject': Reject/free a disloyal city (loyalty flip only)
    - 'raze': Raze a captured city (military conquest only)
    - 'liberate_founder': Liberate to original founder
    - 'liberate_previous': Liberate to previous owner
ParameterTypeDefaultDescription
city_id*integerCity Id
action*stringAction
target_xintegernullTarget X
target_yintegernullTarget Y

Dismiss any blocking popup in the game UI.

Details
Call this if you suspect a popup (e.g. historic moment, boost notification)
    is blocking interaction.

No parameters

Form an alliance with another civilization.

Details
Args:
        other_player_id: The player ID (from get_diplomacy output)
        alliance_type: One of: MILITARY, RESEARCH, CULTURAL, ECONOMIC, RELIGIOUS

    Requires declared friendship and Diplomatic Service civic.
    Use get_trade_options to check alliance eligibility first.
ParameterTypeDefaultDescription
other_player_id*integerOther Player Id
alliance_typestring"MILITARY"Alliance Type

Found a religion with a chosen name, follower belief, and founder belief.

Details
Args:
        religion_type: e.g. RELIGION_HINDUISM, RELIGION_BUDDHISM, RELIGION_ISLAM
        follower_belief: e.g. BELIEF_WORK_ETHIC, BELIEF_CHORAL_MUSIC
        founder_belief: e.g. BELIEF_STEWARDSHIP, BELIEF_CHURCH_PROPERTY

    Requires your Great Prophet to have already activated on a Holy Site
    (via UNITOPERATION_FOUND_RELIGION). Use get_religion_beliefs
    first to see available options.
ParameterTypeDefaultDescription
religion_type*stringReligion Type
follower_belief*stringFollower Belief
founder_belief*stringFounder Belief

Get current era age, available dedications, and active ones.

Details
Shows era score thresholds, whether you're in a Golden/Dark/Normal age,
    and lists available dedication choices with their bonuses.
    Use choose_dedication to select one when required.

No parameters

Get religion founding status, available religions, and available beliefs.

Details
Shows whether you've founded a religion, available religion types to choose,
    and beliefs grouped by class (Follower, Founder, Enhancer, Worship).
    Use found_religion to found a religion after your Great Prophet activates.

No parameters

Buy a Great Person instantly with gold or faith.

Details
Args:
        individual_id: The individual's ID (from get_great_people output)
        yield_type: YIELD_GOLD (default) or YIELD_FAITH

    Costs shown in get_great_people output under "Patronize:".
    Requires enough gold/faith to cover the cost.
ParameterTypeDefaultDescription
individual_id*integerIndividual Id
yield_typestring"YIELD_GOLD"Yield Type

Promote a governor with a new ability.

Details
Args:
        governor_type: The governor type (from get_governors output)
        promotion_type: The promotion type (from get_governors output, shown under each governor)

    Requires available governor points. Use get_governors to see available promotions.
ParameterTypeDefaultDescription
governor_type*stringGovernor Type
promotion_type*stringPromotion Type

Apply a promotion to a unit.

Details
Args:
        unit_id: The unit's composite ID (from get_units output)
        promotion_type: e.g. PROMOTION_BATTLECRY, PROMOTION_TORTOISE

    Use get_unit_promotions first to see available options.
ParameterTypeDefaultDescription
unit_id*integerUnit Id
promotion_type*stringPromotion Type

Propose white peace to a civilization you're at war with.

Details
Args:
        other_player_id: The player ID (from get_diplomacy output)

    Requires being at war and past the 10-turn war cooldown.
    The AI may accept or reject based on war score and relationship.
ParameterTypeDefaultDescription
other_player_id*integerOther Player Id

Propose a trade deal to another civilization.

Details
Args:
        other_player_id: The player ID (from get_diplomacy output)
        offer_gold: Lump sum gold to give them
        offer_gold_per_turn: Gold per turn to give them (30-turn duration)
        offer_resources: Comma-separated resource types to offer, e.g. "RESOURCE_SILK,RESOURCE_TEA"
        offer_favor: Diplomatic favor to offer
        offer_open_borders: True to offer our open borders
        request_gold: Lump sum gold to request from them
        request_gold_per_turn: Gold per turn to request (30-turn duration)
        request_resources: Comma-separated resource types to request
        request_favor: Diplomatic favor to request from them
        request_open_borders: True to request their open borders
        joint_war_target: Player ID of a third civ to declare joint war against

    Examples: Gift 100 gold: offer_gold=100. Trade silk for 3 gpt: offer_resources="RESOURCE_SILK", request_gold_per_turn=3.
    Mutual open borders: offer_open_borders=True, request_open_borders=True.
    Trade favor for gold: offer_favor=20, request_gold=100.
ParameterTypeDefaultDescription
other_player_id*integerOther Player Id
offer_goldinteger0Offer Gold
offer_gold_per_turninteger0Offer Gold Per Turn
offer_resourcesstring""Offer Resources
offer_favorinteger0Offer Favor
offer_open_bordersbooleanfalseOffer Open Borders
request_goldinteger0Request Gold
request_gold_per_turninteger0Request Gold Per Turn
request_resourcesstring""Request Resources
request_favorinteger0Request Favor
request_open_bordersbooleanfalseRequest Open Borders
joint_war_targetinteger0Joint War Target

Purchase a unit or building instantly with gold or faith.

Details
Args:
        city_id: City ID (from get_cities output)
        item_type: UNIT or BUILDING
        item_name: e.g. UNIT_WARRIOR, BUILDING_MONUMENT
        yield_type: YIELD_GOLD (default) or YIELD_FAITH

    Costs gold/faith immediately. Use get_city_production to see what's available.
ParameterTypeDefaultDescription
city_id*integerCity Id
item_type*stringItem Type
item_name*stringItem Name
yield_typestring"YIELD_GOLD"Yield Type

Buy a tile for a city with gold.

Details
Args:
        city_id: City ID
        x: Tile X coordinate
        y: Tile Y coordinate

    Use get_purchasable_tiles first to see costs and options.
ParameterTypeDefaultDescription
city_id*integerCity Id
x*integerX
y*integerY

Pre-configure World Congress votes for the upcoming session.

Details
Args:
        votes: JSON array of vote objects, e.g.
            '[{"hash": -513644209, "option": 1, "target": 2, "votes": 5}]'
            hash = resolution type hash (from get_world_congress)
            option = 1 for A, 2 for B
            target = player ID for PlayerType resolutions (from get_world_congress
                     target list, e.g. [target=2] Portugal), or target value for
                     non-player resolutions. The handler resolves to the correct
                     0-based index at runtime.
            votes = max votes to allocate (will use as many as favor allows)

    Call this BEFORE end_turn when get_world_congress shows 0 turns until next
    session. Registers an event handler that fires during WC processing and
    casts your votes with the specified preferences.

    If you don't call this, end_turn will pause at the World Congress session
    and return control to you for interactive voting.
ParameterTypeDefaultDescription
votes*stringVotes

Recruit a Great Person using accumulated GP points.

Details
Args:
        individual_id: The individual's ID (from get_great_people output, shown after ability)

    Requires enough Great Person points for that class.
    The GP spawns in your capital. Use get_great_people to check [CAN RECRUIT] status.
ParameterTypeDefaultDescription
individual_id*integerIndividual Id

Pass on a Great Person (skip to the next one in that class).

Details
Args:
        individual_id: The individual's ID (from get_great_people output)

    Costs faith. The next Great Person in that class becomes available.
    Use when you don't want the current GP and want to save points for a better one.
ParameterTypeDefaultDescription
individual_id*integerIndividual Id

Respond to a pending diplomacy encounter.

Details
Args:
        other_player_id: The player ID of the other civilization (from get_pending_diplomacy)
        response: "POSITIVE" (friendly) or "NEGATIVE" (dismissive)

    First meetings typically have 2-3 rounds. The tool automatically detects
    and closes goodbye-phase sessions (where dialogue text stops changing).
    If SESSION_CONTINUES is returned, send another response for the next round.
ParameterTypeDefaultDescription
other_player_id*integerOther Player Id
response*stringResponse

Accept or reject a pending trade deal.

Details
Args:
        other_player_id: The player ID of the civilization (from get_pending_trades)
        accept: True to accept the deal, False to reject it

    Use get_pending_trades first to see what's being offered.
ParameterTypeDefaultDescription
other_player_id*integerOther Player Id
accept*booleanAccept

Send a proactive diplomatic action to another civilization.

Details
Args:
        other_player_id: The player ID (from get_diplomacy output)
        action: One of: DIPLOMATIC_DELEGATION, DECLARE_FRIENDSHIP, DENOUNCE,
                RESIDENT_EMBASSY, OPEN_BORDERS

    Delegations cost 25 gold and can be rejected if the civ dislikes you.
    Embassies require Writing tech. Use get_diplomacy to see available actions.
ParameterTypeDefaultDescription
other_player_id*integerOther Player Id
action*stringAction

Send an envoy to a city-state.

Details
Args:
        player_id: The city-state's player ID (from get_city_states)

    Requires available envoy tokens. Use get_city_states to see options.
ParameterTypeDefaultDescription
player_id*integerPlayer Id

Set a city's citizen yield priority.

Details
Args:
        city_id: City ID
        focus: One of: food, production, gold, science, culture, faith, default
               'default' clears all focus settings.

    Cities automatically assign citizens to tiles. This biases the AI
    toward the chosen yield type when assigning new citizens.
ParameterTypeDefaultDescription
city_id*integerCity Id
focus*stringFocus

Set what a city should produce.

Details
Args:
        city_id: City ID (from get_cities output)
        item_type: UNIT, BUILDING, DISTRICT, or PROJECT
        item_name: e.g. UNIT_WARRIOR, BUILDING_MONUMENT, DISTRICT_CAMPUS, PROJECT_LAUNCH_EARTH_SATELLITE
        target_x: X coordinate for district placement (use get_district_advisor to find best tile)
        target_y: Y coordinate for district placement

    Tip: call get_cities first to see your cities and their IDs.
ParameterTypeDefaultDescription
city_id*integerCity Id
item_type*stringItem Type
item_name*stringItem Name
target_xintegernullTarget X
target_yintegernullTarget Y

Set policy cards in government slots.

Details
Args:
        assignments: Comma-separated slot assignments, e.g.
            "0=POLICY_AGOGE,1=POLICY_URBAN_PLANNING"
            Slots not listed will be cleared. Use get_policies to see
            available policies and slot indices.

    Wildcard slots can accept any policy type. Military slots accept
    military policies, economic slots accept economic policies, etc.
ParameterTypeDefaultDescription
assignments*stringAssignments

Choose a technology or civic to research.

Details
Args:
        tech_or_civic: The type name, e.g. TECH_POTTERY or CIVIC_CRAFTSMANSHIP
        category: "tech" or "civic" (default: tech)

    Tip: call get_tech_civics first to see available options.
ParameterTypeDefaultDescription
tech_or_civic*stringTech Or Civic
categorystring"tech"Category

Skip all units that still have moves remaining.

Details
Useful after diplomacy encounters invalidate all standing orders.
    Uses GameCore FinishMoves on each unit — fast, reliable, no async issues.

No parameters

Send a spy to a city or launch a spy mission.

Details
Args:
        unit_id: The spy's composite ID (from get_spies output)
        action: 'travel' to move spy to a city, or a mission type to launch a mission.
            Mission types: COUNTERSPY, GAIN_SOURCES, SIPHON_FUNDS, STEAL_TECH_BOOST,
            SABOTAGE_PRODUCTION, GREAT_WORK_HEIST, RECRUIT_PARTISANS,
            NEUTRALIZE_GOVERNOR, FABRICATE_SCANDAL
        target_x: X coordinate of the target city tile
        target_y: Y coordinate of the target city tile

    Travel notes:
        - Valid targets: your own cities and city-states only.
        - Allied civ cities are NOT valid travel targets.
        - Travel is queued end-of-turn; spy position updates after turn ends.

    Mission notes:
        - Spy must be physically IN the target city to launch any offensive mission.
        - Use 'travel' first, then end the turn, then launch the mission.
        - COUNTERSPY defends your own city (spy must be in your city).
        - get_spies shows which ops are available at the spy's current location.
ParameterTypeDefaultDescription
unit_id*integerUnit Id
action*stringAction
target_x*integerTarget X
target_y*integerTarget Y

Issue a command to a unit.

Details
Args:
        unit_id: The unit's composite ID (from get_units output)
        action: One of: move, attack, fortify, skip, found_city, improve, remove_feature, automate, heal, alert, sleep, delete, trade_route, activate, teleport, spread_religion
        target_x: Target X coordinate (required for move/attack/trade_route/teleport)
        target_y: Target Y coordinate (required for move/attack/trade_route/teleport)
        improvement: Improvement type for builders (required for improve), e.g.
            IMPROVEMENT_FARM, IMPROVEMENT_MINE, IMPROVEMENT_QUARRY,
            IMPROVEMENT_PLANTATION, IMPROVEMENT_CAMP, IMPROVEMENT_PASTURE,
            IMPROVEMENT_FISHING_BOATS, IMPROVEMENT_LUMBER_MILL

    For move/attack: provide target_x and target_y.
    For trade_route: provide target_x and target_y of destination city.
    For teleport: provide target_x and target_y of destination city. Traders only, must be idle (not on active route).
    For improve: provide improvement name. Builder must be on the tile.
    For activate: activates a Great Person on their matching district.
    For spread_religion: spreads religion at current tile. Missionaries/Apostles only.
    For fortify/skip/found_city/automate/heal/alert/sleep/delete: no target needed.
    heal = fortify until healed (auto-wake at full HP).
    alert = sleep but auto-wake when enemy enters sight range.
    delete = permanently disband the unit.
ParameterTypeDefaultDescription
unit_id*integerUnit Id
action*stringAction
target_xintegernullTarget X
target_yintegernullTarget Y
improvementstringnullImprovement

Upgrade a unit to its next type (e.g. Slinger -> Archer).

Details
Args:
        unit_id: The unit's composite ID (from get_units output)

    Requires the right technology, enough gold, and the unit must have
    moves remaining. The unit's movement is consumed by upgrading.
ParameterTypeDefaultDescription
unit_id*integerUnit Id

Vote on a World Congress resolution.

Details
Args:
        resolution_hash: Resolution type hash (from get_world_congress)
        option: 1 for option A, 2 for option B
        target_index: 0-based index into the resolution's possible targets list
        num_votes: Number of votes (1 is free, extras cost diplomatic favor)

    After voting on all resolutions, call end_turn() to submit and advance.
    Use get_world_congress first to see available resolutions and targets.
ParameterTypeDefaultDescription
resolution_hash*integerResolution Hash
option*integerOption
target_index*integerTarget Index
num_votesinteger1Num Votes