Skip to main content
Glama

Request Part Selection

request_part_selection

Lets the person adjust boundaries by picking parts (e.g. ZIPs) on the map: puts the open map into select mode on a part_layer, for purpose realign, a new territory, or a plain list. Returns selection_task_id; get_part_selection reports status (awaiting_user_selection, then committed, expired, or cancelled) and the committed part_ids, and its response carries recommended_poll_delay_ms. The commit happens on the map, not in chat. destination_territory_id and realign_operation pre-set a realign. Works on the in-chat map and the map_url tab. map_session_id selects on the open map; ts_handle opens a stored Territory Solution first. initial_part_filter opens with a set pre-selected (e.g. in_tal or white space not_in_tal) for the person to trim; build from the committed set with part_filter {selection_task_id}. A selection the person started from the map legend is read with get_map_selection.

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>"
    },
    "name": "request_part_selection"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptNoHuman-facing selection instruction shown by the host/agent or MC.
purposeNogeneric
user_idNoStable caller id; finds the open map when map_session_id is omitted.
ts_handleNoTerritory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline.
part_layerYes
active_tal_idNoAlignment shown as active while the person selects.
new_territoryNo
expiry_secondsNo
map_session_idNoOpen map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set.
realign_operationNo
initial_part_filterNoPre-selects the parts this filter matches (same shape as auto_build part_filter, e.g. {in_tal: {tal_id}} or {state_abbr: TX, not_in_tal: {tal_id}}). Resolved server-side, up to 50,000 parts; selection_task_id is rejected here.
destination_territory_idNoOptional receiver leaf territory when Monica/agent named the destination up front.
remove_empty_territoriesNo

Output Schema

NameRequiredDescriptionDefault
okYes
errorNoPresent when ok is false.
resultNoPresent when ok is true.
warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / initial_part_filter
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "minProperties": 1,
      +      "properties": {
      +        "county_name": {
      +          "type": [
      +            "string",
      +            "array"
      +          ]
      +        },
      +        "in_tal": {
      +          "additionalProperties": false,
      +          "description": "Keep only the parts assigned to a leaf territory of tal_id: the TAL's whole footprint, however many separate regions it has. ANDed with the other predicates (alone it is exactly that footprint). The TAL must use the same part_layer and hold parts. query_parts needs ts_handle or map_session_id here; builds read the TAL from the build's own Territory Solution.",
      +          "properties": {
      +            "map_session_id": {
      +              "description": "query_parts only: open map session whose Territory Solution holds the TAL.",
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "tal_id": {
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "territory_ids": {
      +              "description": "Narrow to these territory_id values (not display labels); a rollup includes every leaf below it. Unknown ids return UNKNOWN_TERRITORY_ID with available_territory_ids.",
      +              "items": {
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "minItems": 1,
      +              "type": "array"
      +            },
      +            "ts_handle": {
      +              "description": "query_parts only: Territory Solution reference (tsh_...) holding the TAL.",
      +              "minLength": 1,
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "tal_id"
      +          ],
      +          "type": "object"
      +        },
      +        "not_in_tal": {
      +          "additionalProperties": false,
      +          "description": "White space: drop every part assigned to a leaf territory of tal_id from whatever the other predicates select (the whole layer when alone). The TAL must use the same part_layer. query_parts needs ts_handle or map_session_id here; builds read the TAL from the build's own Territory Solution.",
      +          "properties": {
      +            "map_session_id": {
      +              "description": "query_parts only: open map session whose Territory Solution holds the TAL.",
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "tal_id": {
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "ts_handle": {
      +              "description": "query_parts only: Territory Solution reference (tsh_...) holding the TAL.",
      +              "minLength": 1,
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "tal_id"
      +          ],
      +          "type": "object"
      +        },
      +        "part_layer": {
      +          "type": "string"
      +        },
      +        "population": {
      +          "oneOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "minProperties": 1,
      +              "properties": {
      +                "between": {
      +                  "items": {
      +                    "type": "number"
      +                  },
      +                  "maxItems": 2,
      +                  "minItems": 2,
      +                  "type": "array"
      +                },
      +                "eq": {
      +                  "type": "number"
      +                },
      +                "gt": {
      +                  "type": "number"
      +                },
      +                "gte": {
      +                  "type": "number"
      +                },
      +                "lt": {
      +                  "type": "number"
      +                },
      +                "lte": {
      +                  "type": "number"
      +                }
      +              },
      +              "type": "object"
      +            }
      +          ]
      +        },
      +        "selection_task_id": {
      +          "description": "Builds only (auto_build, account_build, seed_build): a committed request_part_selection task (psel_...) whose part_ids become the scope; it is the only key in that part_filter.",
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "spatial": {
      +          "additionalProperties": false,
      +          "oneOf": [
      +            {
      +              "required": [
      +                "bbox"
      +              ]
      +            },
      +            {
      +              "required": [
      +                "geometry"
      +              ]
      +            }
      +          ],
      +          "properties": {
      +            "bbox": {
      +              "description": "[min_lon, min_lat, max_lon, max_lat] in EPSG:4326.",
      +              "items": {
      +                "type": "number"
      +              },
      +              "maxItems": 4,
      +              "minItems": 4,
      +              "type": "array"
      +            },
      +            "geometry": {
      +              "description": "GeoJSON Polygon or MultiPolygon in EPSG:4326.",
      +              "type": "object"
      +            },
      +            "operator": {
      +              "enum": [
      +                "intersects",
      +                "within",
      +                "contains"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "operator"
      +          ],
      +          "type": "object"
      +        },
      +        "state_abbr": {
      +          "type": [
      +            "string",
      +            "array"
      +          ]
      +        },
      +        "text": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "case_sensitive": {
      +              "default": false,
      +              "type": "boolean"
      +            },
      +            "field": {
      +              "description": "Safe text field to search. Defaults to the public part ID column.",
      +              "type": "string"
      +            },
      +            "mode": {
      +              "default": "prefix",
      +              "enum": [
      +                "prefix",
      +                "contains",
      +                "exact"
      +              ],
      +              "type": "string"
      +            },
      +            "value": {
      +              "minLength": 1,
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "value"
      +          ],
      +          "type": "object"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Pre-selects the parts this filter matches (same shape as auto_build part_filter, e.g. {in_tal: {tal_id}} or {state_abbr: TX, not_in_tal: {tal_id}}). Resolved server-side, up to 50,000 parts; selection_task_id is rejected here."
      +}
    • addedOutput schema / properties / result / properties / initial_part_count
      Added value: +{
      +  "type": "integer"
      +}
  2. Changed13 schema fields changed
    • addedInput schema / properties / active_tal_id / description
      Added value: +"Alignment shown as active while the person selects."
    • addedInput schema / properties / destination_territory_id / description
      Added value: +"Optional receiver leaf territory when Monica/agent named the destination up front."
    • addedInput schema / properties / map_session_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set.",
      +  "title": "Map Session Id"
      +}
    • changedInput schema / properties / new_territory / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "territory_id": {
      +        "type": "string"
      +      },
      +      "territory_label": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "territory_path": {
      +        "items": {
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 5,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "territory_label"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / new_territory / title
      Removed value: -"New Territory"
    • addedInput schema / properties / prompt / description
      Added value: +"Human-facing selection instruction shown by the host/agent or MC."
    • removedInput schema / properties / ts
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Ts"
      -}
    • addedInput schema / properties / ts_handle
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Territory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline.",
      +  "title": "Ts Handle"
      +}
    • addedInput schema / properties / user_id / description
      Added value: +"Stable caller id; finds the open map when map_session_id is omitted."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "description": "Present when ok is false.",
      +    "properties": {
      +      "ask_user": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "code": {
      +        "type": "string"
      +      },
      +      "details": {
      +        "type": "object"
      +      },
      +      "do_this_next": {
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "ok": {
      +    "type": "boolean"
      +  },
      +  "result": {
      +    "description": "Present when ok is true.",
      +    "properties": {
      +      "active_tal_id": {
      +        "type": "string"
      +      },
      +      "created_at": {
      +        "type": "string"
      +      },
      +      "destination_territory_id": {
      +        "type": "string"
      +      },
      +      "do_this_next": {
      +        "type": "object"
      +      },
      +      "expires_at": {
      +        "type": "string"
      +      },
      +      "map_session_id": {
      +        "type": "string"
      +      },
      +      "map_url": {
      +        "type": "string"
      +      },
      +      "new_territory": {
      +        "type": "object"
      +      },
      +      "part_layer": {
      +        "type": "string"
      +      },
      +      "poll_interval_ms": {
      +        "type": "integer"
      +      },
      +      "poll_loop": {
      +        "type": "object"
      +      },
      +      "prompt": {
      +        "type": "string"
      +      },
      +      "purpose": {
      +        "type": "string"
      +      },
      +      "realign_operation": {
      +        "type": "string"
      +      },
      +      "recommended_poll_delay_ms": {
      +        "type": "integer"
      +      },
      +      "remove_empty_territories": {
      +        "type": "boolean"
      +      },
      +      "selection_resource_uri": {
      +        "type": "string"
      +      },
      +      "selection_task_id": {
      +        "type": "string"
      +      },
      +      "session_exists": {
      +        "type": "boolean"
      +      },
      +      "state_resource_uri": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "type": "string"
      +      },
      +      "ts_identity": {
      +        "type": "object"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "warnings": {
      +    "items": {
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "ok"
      +]
    • removedOutput schema / title
      Removed value: -"request_part_selectionDictOutput"
  3. Changed1 schema field changed
    • removedInput schema / properties / guidance_handle
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Guidance Handle"
      -}
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

With readOnlyHint=false already declared, the description adds real behavior: an async task id is returned, the status lifecycle is awaiting_user_selection then committed/expired/cancelled, its response carries recommended_poll_delay_ms, and it works across both the in-chat map and the map_url tab. It stops short of stating that repeated calls create new tasks (non-idempotent per annotations) or what happens on expiry, so a 4 rather than a 5.

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?

Front-loaded with the core effect, then the async contract, then parameter guidance in a logical order; almost every clause carries information. It is one dense block of run-on sentences, though, and a short structured split (effect / follow-up / parameters) would scan faster.

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

Completeness4/5

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

For a 13-parameter, non-idempotent, asynchronous tool this covers the essential mechanics: where the result appears, how to poll, and which inputs select which map. Gaps remain around expiry_seconds behavior, remove_empty_territories defaults, and permission or failure modes, but the output schema carries the response shape.

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

Parameters5/5

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

At 54% schema coverage the description compensates well: map_session_id selects on the open map while ts_handle opens a stored Territory Solution first, destination_territory_id and realign_operation pre-set a realign, and initial_part_filter is explained with in_tal / not_in_tal white-space examples, the 50,000-part cap, and the rejection of selection_task_id. It also explains the downstream part_filter {selection_task_id} handoff to builds, which is meaning the schema does not convey.

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?

'Lets the person adjust boundaries by picking parts (e.g. ZIPs) on the map: puts the open map into select mode on a part_layer' is a specific verb, resource and side effect. It explicitly separates itself from get_part_selection (status/committed part_ids) and get_map_selection (legend-started selections), so an agent can route 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?

It names the three concrete purposes (realign, a new territory, a plain list) and the alternative tools with their selecting conditions: get_part_selection for polling status, get_map_selection for a selection the person started from the map legend. It also states that commit happens on the map, not in chat, which tells the agent not to expect a synchronous result.

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