Skip to main content
Glama

EasyTerritory MCP

analyze

[Tier 1 — Analysis] When: balance diagnostics, cross-TAL comparison, or post-mutation facts. Accepts ts, ts_handle, or completed job_id (inline ts or result.ts_handle from prior compute jobs). Prerequisites: TAL exists; re-run after any TAL or point change (I-2)—never treat stale analysis as current. Returns JSON facts and presentation guidance URI; no prose. metrics: omit to analyze all declared point-layer columns, or pass explicit names. System dimensions (always valid, not point columns): workload (territory hours; alias total_workload_hours), account_count. Point columns must be fields declared at ingest (metric_fields/workload_fields, e.g. Revenue, Units Sold); undeclared columns are discarded at ingest and fail with UNDECLARED_FIELD — re-ingest with the column declared to analyze it. Response includes available_metrics. METRIC COLUMNS ALWAYS RENDER: the territory_metric_grids (and the MC dock) carry Total Count plus a Total column for EVERY declared metric_fields column of the point layer, in declaration order, even when metrics names only account_count or workload — a count-only panel is never the correct outcome when metrics are declared. Declared names may be bare strings (Designer pull) or {field,label,type} objects (ingest). Metric cells are parsed leniently: '14,651', '$1,200.50', and padded strings sum as numbers. DWELL / WORKLOAD (T-171): workload hours need onsite/dwell time — request dwell_time, TAL build_provenance.dwell_time (auto_build), or the point layer's dwell_time_field. When none resolves, Analyze STILL RUNS and reports counts, metrics, classification breakdowns, and balance on those dimensions; workload is OMITTED (no total_workload_hours column, workload_total null) — never drive-only hours. The result then carries workload_omitted {tal_ids, ask_user, retry}: report the statistics FIRST, then relay ask_user verbatim (it asks for an average onsite/dwell time). Re-run analyze with dwell_time only if the user answers; never invent a default (including 30 minutes). Do not ask for dwell before the first analyze just to avoid the note. Prefer analysis_panel=single with map_session_id so the MC dock fills on this call — that is the one-shot post-build path. The completed result then has analysis_panel.status=pushed, and session state has analysis_panel.loaded=true. phase_timings_ms.panel_push is only a duration, not proof the dock opened. Otherwise pass the full Analyze result (or its task_id) to load_analysis_panel. WORKLOAD UNITS: territories[].workload_total is minutes (workload_unit=minutes). Quote hours only from territory_metric_grids cell total_workload_hours.value. When metrics is omitted and dwell resolves, balance_scores includes workload plus declared metrics — not a location-match score. DOCK HIDE: minimizing the table leaves analysis_panel.loaded true; do not call load_analysis_panel again just to restore it. A new analysis_panel_loaded event opens the dock. Chat-only JSON is not completion when a map is open. Use ezt://guidance/analysis-presentation for narrative. Full atom: ezt://guidance/workflows/analyze-and-present. Scenarios: AN-001..007, MC-009, S002.

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
guidance_handleNo
hypothetical_movesNo
visit_frequency_fieldNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations, the description fully carries the behavioral burden and does so richly: it discloses that workload omission still returns counts/metrics (workload_total null, never drive-only hours), that undeclared columns fail with UNDECLARED_FIELD, that metric cells are parsed leniently, that workload_total is in minutes while hours only come from grids, and that panel push duration is not proof the dock opened. This is far beyond what a schema could convey.

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 guidance is valuable but delivered as a dense wall of text with repetition — workload omission is re-explained multiple times, dock behavior is revisited, and 'never invent a default (including 30 minutes)' restates an earlier point. Some length is justified by tool complexity, but it is not tightly front-loaded or easily scannable.

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?

Because an output schema exists, the description is not obligated to describe return values, and it still covers prerequisites, the failure mode (UNDECLARED_FIELD), units, and panel-state semantics comprehensively. The gap is the unexplained params, but for a tool of this complexity the behavioral coverage is nearly sufficient on its own.

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% across 15 parameters, so the description must compensate and it only partially does. It explains ts/ts_handle/job_id inputs, metrics semantics (omit for all declared columns, bare strings vs {field,label,type}), dwell_time, tal_ids in workload_omitted, and analysis_panel=single with map_session_id. Eight parameters (scope, max_depth, part_layer, compare_tals, guidance_handle, hypothetical_moves, visit_frequency_field) receive no explanation at all.

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

Purpose4/5

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

The description opens with a specific scope: '[Tier 1 — Analysis] When: balance diagnostics, cross-TAL comparison, or post-mutation facts,' which clearly identifies the resource and operation. It is distinct from analyze_routes by implication but never explicitly contrasts with sibling analysis tools. An agent understands what it does, though not the full boundary against nearby tools.

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 states explicit trigger conditions (balance diagnostics, cross-TAL comparison, post-mutation facts), prerequisites ('TAL exists; re-run after any TAL or point change (I-2)—never treat stale analysis as current'), and an alternative path ('Otherwise pass the full Analyze result ... to load_analysis_panel'). There is also an explicit prohibition: 'Do not ask for dwell before the first analyze just to avoid the note.'

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