Analyze Contractor Network Coverage
analyze_network_coverageFinds coverage gaps in a contractor (vendor, service provider, technician, repair shop) network: counts the contractors that reach each demand point (customer, claim, store, ZIP center). Reads contractor_layer (ingested with layer_role=contractors) and demand_layer. coverage: {rule: drive_time, max_minutes} (straight-line travel model, no provider calls), {rule: drive_time, source: isochrone_tal, isochrone_tal_id} (isochrone_build areas around the contractors), or {rule: zip_list} (declared service ZIPs). One trade per call ('*' for all). Missing layers, coverage, or trade return CLARIFICATION_REQUIRED with the question. Writes new layers, never the source: _coverage (contractor_count, single_source, coverage_class red none / amber one / green 2+ / blue saturated, nearest contractor and minutes, capacity_ratio, gap score) and _gaps; gap_territory=true adds the all-gap ZIPs as one territory. Assigns nothing; dividing work is auto_build. Returns a task; the result has coverage_pct, gap and single-source counts, top_gaps, and per-contractor reach.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "analyze_network_coverage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trade | No | One trade per call, matched case-insensitively against the comma-separated trade_field values. '*' (or 'all') keeps every contractor. Required when the contractor layer has a trade_field (needs_trade). | |
| coverage | No | What counts as covered. drive_time with source travel_model (default) needs max_minutes or max_km and uses the calibrated quadkey detour-factor model with CONSTITUTION speed-curve fallback (no provider calls). drive_time with source isochrone_tal needs isochrone_tal_id: a point is covered by a contractor when one of that contractor's isochrone_build polygons contains it (origin_id = contractor id); max_minutes, when given, drops wider time bands. zip_list uses each contractor's service_zip_field. | |
| 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. | |
| tier_field | No | Overrides the contractor layer's tier_field. | |
| trade_field | No | Overrides the contractor layer's trade_field. | |
| demand_layer | No | Point layer of demand (customers, claims, stores, or ZIP centers). Defaults to the only other ingested layer. | |
| demand_metric | No | Numeric demand column (e.g. request count). Defaults to 1 per point; non-numeric cells count as 0 with warning DEMAND_METRIC_MISSING. | |
| gap_territory | No | Also draw ZIPs whose demand is all uncovered as one territory in a new TAL. | |
| capacity_field | No | Overrides the contractor layer's capacity_field. Enables capacity_ratio. | |
| map_session_id | No | Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set. | |
| contractor_layer | No | Point layer of contractors. Defaults to the only layer ingested with layer_role=contractors; otherwise CLARIFICATION_REQUIRED (needs_contractor_layer). | |
| priority_weights | No | gap_priority weights; defaults demand 0.6, distance 0.4, single_source_factor 0.5. The formula is echoed in result.priority_formula. | |
| contractor_filter | No | Column -> value (or list of values), e.g. {"tier": "Preferred"}. The key tier maps to tier_field when the layer has no literal tier column. | |
| service_zip_field | No | Overrides the contractor layer's service_zip_field (required for zip_list). | |
| saturation_threshold | No | Contractor count at which a point is saturated (blue). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | Present when ok is false. | |
| result | No | Present when ok is true. | |
| warnings | No |