Skip to main content
Glama

Analyze Territories

analyze

Computes territory statistics for one or more alignments, i.e. how balanced the territories are and how alignments compare: account counts, declared metric totals (e.g. Revenue), workload hours, balance scores, and cross-TAL comparison; hypothetical_moves previews a realign. Input: map_session_id (the open map as it is now), ts_handle, ts, or a completed build job_id (pass tal_ids when several TALs exist). metrics: omit for every declared column, or name them; workload and account_count are always available. Workload needs dwell (dwell_time, the build's recorded dwell, or the layer's dwell_time_field); without it the result has every other statistic, no workload, and workload_omitted.ask_user, the question for the user. analysis_panel=single with map_session_id fills the map's analysis dock (analysis_panel.status=pushed). territories[].workload_total is minutes; hours are in territory_metric_grids. Drive-time alignments count accounts inside each polygon. Returns a task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tsNo
scopeNo
job_idNo
metricsNo
tal_idsNo
max_depthNo
ts_handleNo
dwell_timeNo
part_layerNo
compare_talsNo
analysis_panelNo
map_session_idNo
hypothetical_movesNo
visit_frequency_fieldNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / dwell_time / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "description": "Onsite (dwell) time per visit: {type: 'scalar', value: <number>, unit: 'minutes'|'hours'} or {type: 'field', field: '<column>', unit: 'minutes'|'hours'}.",
      +    "properties": {
      +      "field": {
      +        "description": "Point column name holding per-account onsite time when type='field'.",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "type": {
      +        "description": "Dwell source: 'scalar' for a fixed per-visit duration or 'field' for an ingested point column.",
      +        "enum": [
      +          "scalar",
      +          "field"
      +        ],
      +        "type": "string"
      +      },
      +      "unit": {
      +        "default": "minutes",
      +        "description": "Time unit for value or field ('minutes' or 'hours').",
      +        "enum": [
      +          "minutes",
      +          "hours"
      +        ],
      +        "type": "string"
      +      },
      +      "value": {
      +        "description": "Confirmed onsite duration per visit when type='scalar'.",
      +        "minimum": 0,
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "type"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / analysis_panel / anyOf
      Previous value: -[
      -  {
      -    "description": "single fills the open map's analysis dock with this result (needs map_session_id). comparison_slot fills the same dock (no side-by-side layout). none or omitted pushes nothing. Not the same enum as load_analysis_panel.presentation_mode (single|compare).",
      -    "enum": [
      -      "none",
      -      "single",
      -      "comparison_slot"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "single fills the open map's analysis dock with this result (needs map_session_id). The dock shows one alignment at a time: with several tal_ids each TAL gets its own dock entry and the dock follows the map's active TAL. comparison_slot does the same and also returns cross_tal_comparison. none or omitted pushes nothing.",
      +    "enum": [
      +      "none",
      +      "single",
      +      "comparison_slot"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed2 schema fields changed
    • changedInput schema / properties / analysis_panel / anyOf
      Previous value: -[
      -  {
      -    "description": "single fills the open map's analysis dock with this result (pass map_session_id); prefer it. comparison_slot fills the same dock (no side-by-side layout). none or omitted pushes nothing. Not the same enum as load_analysis_panel.presentation_mode (single|compare).",
      -    "enum": [
      -      "none",
      -      "single",
      -      "comparison_slot"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "single fills the open map's analysis dock with this result (needs map_session_id). comparison_slot fills the same dock (no side-by-side layout). none or omitted pushes nothing. Not the same enum as load_analysis_panel.presentation_mode (single|compare).",
      +    "enum": [
      +      "none",
      +      "single",
      +      "comparison_slot"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / guidance_handle
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Guidance Handle"
      -}
  4. Changed1 schema field changed
    • changedInput schema / properties / analysis_panel / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "single fills the open map's analysis dock with this result (pass map_session_id); prefer it. comparison_slot fills the same dock (no side-by-side layout). none or omitted pushes nothing. Not the same enum as load_analysis_panel.presentation_mode (single|compare).",
      +    "enum": [
      +      "none",
      +      "single",
      +      "comparison_slot"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  5. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and idempotentHint=false, so the description needn't repeat safety basics. It adds valuable context by disclosing the side effect of analysis_panel filling the map dock, the task-based return, and the workload omission behavior with workload_omitted.ask_user, all of which help an agent anticipate runtime behavior.

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

Conciseness3/5

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

The purpose is front-loaded, which is good, but the rest is a dense, run-on paragraph mixing input options, metric rules, workload dependencies, panel behavior, and output notes. Some sentences are overly packed, and structuring the details would improve readability without losing content.

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?

For a tool with 14 parameters, 0% schema descriptions, and an output schema, the description covers the main behavior, input sources, workload handling, panel side effect, and task return. It still omits explanations for several parameters (scope, max_depth, part_layer, compare_tals, visit_frequency_field), leaving gaps that an agent might need to fill by trial or inference.

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 description coverage is 0%, so the description must carry parameter meaning. It successfully explains several key parameters (map_session_id, ts_handle, ts, job_id, metrics, tal_ids, dwell_time, analysis_panel, hypothetical_moves), but it leaves scope, max_depth, part_layer, compare_tals, and visit_frequency_field undocumented, so the coverage is partial.

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 ('Computes') and resource ('territory statistics for one or more alignments'), and enumerates the core outputs (account counts, metric totals, workload hours, balance scores, cross-TAL comparison). This distinguishes it from sibling analysis tools like analyze_routes and analyze_network_coverage.

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

Usage Guidelines3/5

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

Describes input options (map_session_id, ts_handle, ts, job_id) and some conditional behavior (e.g., metrics omission, workload dependency), which implies when the tool is applicable. However, it never explicitly contrasts with alternatives such as territory_rebalance or analyze_network_coverage, and there are no clear when-not-to-use statements.

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