Skip to main content
Glama

Build Territories from Assignments

direct_build
Destructive

Builds territories from known part-to-territory assignments (a ZIP-to-territory sheet or file, including a three-level region/district/territory hierarchy via territory_path) and adds them to the Territory Solution as a new alignment (TAL). Assignments come inline or as an assignments_handle (aup_...) from request_assignment_upload. Sheets with Postal Code plus Territory/Region/Division columns are mapped automatically. Duplicate part_ids follow duplicate_part_policy (default keep_first). Returns a task; the result carries tal_id and ts_handle and paints the open map. Location points load with ingest_accounts; balanced partitions come from auto_build; grouping by a column is account_build.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tsNo
tal_idNo
tal_labelYes
ts_handleNo
part_layerYes
assignmentsNo
repair_policyNoTopology repair for dissolved territories. default fills interior holes in the dissolved geometry (no part is added or reassigned; repair_summary.changed_part_ids lists the territories' own parts). report_only detects holes and changes nothing (warning REPAIR_AVAILABLE). strict fails with REPAIR_REQUIRED when a hole is found.default
map_session_idNo
expected_revisionNo
assignments_handleNo
missing_part_policyNofail
duplicate_part_policyNokeep_first

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / guidance_handle
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Guidance Handle"
      -}
  2. Changed2 schema fields changed
    • addedInput schema / properties / repair_policy / description
      Added value: +"Topology repair for dissolved territories. default fills interior holes in the dissolved geometry (no part is added or reassigned; repair_summary.changed_part_ids lists the territories' own parts). report_only detects holes and changes nothing (warning REPAIR_AVAILABLE). strict fails with REPAIR_REQUIRED when a hole is found."
    • addedInput schema / properties / repair_policy / enum
      Added value: +[
      +  "default",
      +  "strict",
      +  "report_only"
      +]
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructive=true, idempotent=false, readOnly=false, so the safety profile is covered. The description adds genuinely useful behavior beyond that: it creates a new TAL alignment, duplicate handling defaults to keep_first, auto-maps common column names, and it returns a task whose result carries tal_id and ts_handle while painting the open map. It could say more about how destructive the operation is to existing TALs, hence 4.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense and front-loaded: the core action and the input formats lead, and the sibling routing comes last. It remains readable, though the run-on listing of alternative tools is packed tightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values needn't be spelled out, yet the description restates the task/result contract usefully. However, for a 12-parameter destructive tool with 8% schema coverage, several parameters go unexplained in both description and schema, leaving real gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 8% and there are 12 parameters, so the description must carry the load. It clarifies assignments vs assignments_handle, duplicate_part_policy (keep_first), territory_path, and implies part_layer/tal_label usage, but leaves ts, tal_id, ts_handle, map_session_id, expected_revision, and missing_part_policy unexplained. Partial compensation earns a mid score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Builds territories from known part-to-territory assignments') and immediately differentiates itself from siblings by naming the exact input shape (ZIP-to-territory sheet, territory_path hierarchy) and how it produces a new alignment (TAL). An agent can distinguish it from auto_build, account_build, and create_territory_from_parts without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: 'Location points load with ingest_accounts; balanced partitions come from auto_build; grouping by a column is account_build', and tells the agent to source assignments via request_assignment_upload. This is when-to-use/when-to-use-alternative guidance of the highest quality.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources