Create Territory from Parts
create_territory_from_partsCreates one leaf territory from a list of part_ids (e.g. a committed map selection), in a new alignment or an existing one (tal_id). With map_session_id the live map's Territory Solution is updated and repainted; otherwise ts_handle (a new ts_handle is returned). map_session_id wins when both are passed. territory_name is a display label; the result's created_territory.territory_id is the stable id for later edits, plus leaf_territories and selection_summary (duplicate_part_ids). Dwell is optional here and is not inherited from an earlier auto_build; dwell_time is recorded for later analyze. Without it, analyze reports every statistic except workload and returns workload_omitted.ask_user. Returns a task.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"part_layer": "<part_layer>",
"part_ids": "<part_ids>",
"territory_name": "<territory_name>"
},
"name": "create_territory_from_parts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tal_id | No | Existing TAL to append the new territory to; omit to start a new alignment. | |
| part_ids | Yes | Parts for the new territory, e.g. committed part_ids from get_part_selection. | |
| ts_handle | No | Territory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline. | |
| dwell_time | No | ||
| part_layer | Yes | ||
| repair_policy | No | Topology repair policy for dissolved geometry (default, strict, or report_only). Interior holes occupied by existing territories in the TS are never filled. | |
| map_session_id | No | Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set. | |
| territory_name | Yes | ||
| territory_path | No | ||
| conflict_policy | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | Present when ok is false. | |
| result | No | Present when ok is true. A submission returns the task reference (task_id, next_action, sleep_ms); the completed task result carries the remaining fields. | |
| warnings | No |