unit_action
Issue commands to units in Civilization VI: move, attack, fortify, found cities, improve tiles, activate Great People, and more, with support for builders, military engineers, and religious units.
Instructions
Issue a command to a unit.
Args:
unit_id: The unit's composite ID (from get_units output)
action: One of: move, attack, fortify, skip, found_city, improve, repair, remove_improvement, remove_feature, build_route, automate, heal, alert, sleep, delete, trade_route, activate, sacrifice_charges, 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 repair: repairs a pillaged improvement on the builder's current tile. No improvement name needed.
For remove_improvement: demolishes an intact improvement on the builder's current tile (e.g. to replace a farm with a mine). Costs one charge.
For activate: activates a Great Person on their matching district.
For sacrifice_charges: Royal Society builder sacrifice — spends ALL builder charges to boost a district project (2% of cost per charge). Builder must be on the district tile.
For spread_religion: spreads religion at current tile. Missionaries/Apostles only.
For build_route: builds road/railroad on current tile. Military Engineers only. No charges used; costs 1 Iron + 1 Coal per railroad tile.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit_id | Yes | ||
| action | Yes | ||
| target_x | No | ||
| target_y | No | ||
| improvement | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |