Skip to main content
Glama

Analyze Contractor Network Coverage

analyze_network_coverage

Finds 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

NameRequiredDescriptionDefault
tradeNoOne 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).
coverageNoWhat 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_handleNoTerritory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline.
tier_fieldNoOverrides the contractor layer's tier_field.
trade_fieldNoOverrides the contractor layer's trade_field.
demand_layerNoPoint layer of demand (customers, claims, stores, or ZIP centers). Defaults to the only other ingested layer.
demand_metricNoNumeric demand column (e.g. request count). Defaults to 1 per point; non-numeric cells count as 0 with warning DEMAND_METRIC_MISSING.
gap_territoryNoAlso draw ZIPs whose demand is all uncovered as one territory in a new TAL.
capacity_fieldNoOverrides the contractor layer's capacity_field. Enables capacity_ratio.
map_session_idNoOpen map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set.
contractor_layerNoPoint layer of contractors. Defaults to the only layer ingested with layer_role=contractors; otherwise CLARIFICATION_REQUIRED (needs_contractor_layer).
priority_weightsNogap_priority weights; defaults demand 0.6, distance 0.4, single_source_factor 0.5. The formula is echoed in result.priority_formula.
contractor_filterNoColumn -> 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_fieldNoOverrides the contractor layer's service_zip_field (required for zip_list).
saturation_thresholdNoContractor count at which a point is saturated (blue).

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed24 schema fields changed
    • addedInput schema / properties / capacity_field / description
      Added value: +"Overrides the contractor layer's capacity_field. Enables capacity_ratio."
    • changedInput schema / properties / contractor_filter / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {
      +      "anyOf": [
      +        {
      +          "type": [
      +            "string",
      +            "number",
      +            "boolean"
      +          ]
      +        },
      +        {
      +          "items": {
      +            "type": [
      +              "string",
      +              "number",
      +              "boolean"
      +            ]
      +          },
      +          "minItems": 1,
      +          "type": "array"
      +        }
      +      ]
      +    },
      +    "minProperties": 1,
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / contractor_filter / description
      Added value: +"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."
    • removedInput schema / properties / contractor_filter / title
      Removed value: -"Contractor Filter"
    • addedInput schema / properties / contractor_layer / description
      Added value: +"Point layer of contractors. Defaults to the only layer ingested with layer_role=contractors; otherwise CLARIFICATION_REQUIRED (needs_contractor_layer)."
    • changedInput schema / properties / coverage / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "isochrone_tal_id": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "max_km": {
      +        "exclusiveMinimum": 0,
      +        "type": "number"
      +      },
      +      "max_minutes": {
      +        "exclusiveMinimum": 0,
      +        "type": "number"
      +      },
      +      "part_layer": {
      +        "default": "us_zips",
      +        "description": "Part layer the demand points are placed in for zip_list and gap_territory.",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "rule": {
      +        "enum": [
      +          "drive_time",
      +          "zip_list"
      +        ],
      +        "type": "string"
      +      },
      +      "source": {
      +        "default": "travel_model",
      +        "enum": [
      +          "travel_model",
      +          "isochrone_tal"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "rule"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / coverage / description
      Added value: +"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."
    • removedInput schema / properties / coverage / title
      Removed value: -"Coverage"
    • addedInput schema / properties / demand_layer / description
      Added value: +"Point layer of demand (customers, claims, stores, or ZIP centers). Defaults to the only other ingested layer."
    • addedInput schema / properties / demand_metric / description
      Added value: +"Numeric demand column (e.g. request count). Defaults to 1 per point; non-numeric cells count as 0 with warning DEMAND_METRIC_MISSING."
    • addedInput schema / properties / gap_territory / description
      Added value: +"Also draw ZIPs whose demand is all uncovered as one territory in a new TAL."
    • addedInput schema / properties / map_session_id / description
      Added value: +"Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set."
    • addedInput schema / properties / priority_weights / description
      Added value: +"gap_priority weights; defaults demand 0.6, distance 0.4, single_source_factor 0.5. The formula is echoed in result.priority_formula."
    • addedInput schema / properties / saturation_threshold / description
      Added value: +"Contractor count at which a point is saturated (blue)."
    • addedInput schema / properties / service_zip_field / description
      Added value: +"Overrides the contractor layer's service_zip_field (required for zip_list)."
    • addedInput schema / properties / tier_field / description
      Added value: +"Overrides the contractor layer's tier_field."
    • addedInput schema / properties / trade / description
      Added value: +"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)."
    • addedInput schema / properties / trade_field / description
      Added value: +"Overrides the contractor layer's trade_field."
    • removedInput schema / properties / ts
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Ts"
      -}
    • addedInput schema / properties / ts_handle / description
      Added value: +"Territory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline."
    • 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": {
      +      "created_at": {
      +        "type": "string"
      +      },
      +      "do_this_next": {
      +        "type": "object"
      +      },
      +      "estimated_remaining_ms": {
      +        "type": "integer"
      +      },
      +      "estimated_start_ms": {
      +        "type": "integer"
      +      },
      +      "expires_at": {
      +        "type": "string"
      +      },
      +      "job_id": {
      +        "type": "string"
      +      },
      +      "next_action": {
      +        "type": "string"
      +      },
      +      "next_poll_at": {
      +        "type": "string"
      +      },
      +      "phase": {
      +        "type": "string"
      +      },
      +      "poll_interval_ms": {
      +        "type": "integer"
      +      },
      +      "poll_loop": {
      +        "type": "object"
      +      },
      +      "progress": {
      +        "type": "number"
      +      },
      +      "queue_depth": {
      +        "type": "integer"
      +      },
      +      "queue_lane": {},
      +      "queue_position": {
      +        "type": "integer"
      +      },
      +      "recommended_poll_delay_ms": {
      +        "type": "integer"
      +      },
      +      "required_input": {
      +        "type": "object"
      +      },
      +      "result_resource_uri": {
      +        "type": "string"
      +      },
      +      "sleep_ms": {
      +        "type": "integer"
      +      },
      +      "status": {
      +        "type": "string"
      +      },
      +      "status_resource_uri": {
      +        "type": "string"
      +      },
      +      "task_id": {
      +        "type": "string"
      +      },
      +      "terminal": {
      +        "type": "boolean"
      +      },
      +      "tool_name": {
      +        "type": "string"
      +      },
      +      "total": {
      +        "type": [
      +          "null",
      +          "number"
      +        ]
      +      },
      +      "user_cancelled": {
      +        "type": "boolean"
      +      }
      +    },
      +    "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: -"analyze_network_coverageDictOutput"
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already say readOnlyHint=false and destructiveHint=false, but the description adds critical context annotations cannot express: it writes new layers named <demand>_coverage and <demand>_gaps and 'never the source', and gap_territory=true adds a new TAL. It also discloses the cost profile ('straight-line travel model, no provider calls') and that the tool returns a task rather than the result. No contradiction with annotations.

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 purpose and coverage modes, and nearly every clause carries information (output layer names, classification scheme, clarification behavior). It is dense to the point of being run-on, with long parenthetical alias lists and a crammed final sentence, so it's slightly harder to parse than it needed to be.

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

Completeness5/5

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

For a 15-parameter, zero-required tool, the description covers input resolution defaults, clarification behavior, what gets written, and gap_territory side effects; an output schema exists so return values need only a pointer, which it provides ('result has coverage_pct, gap and single-source counts, top_gaps, and per-contractor reach'). Nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real value beyond the schema: it explains how the coverage rule variants interact (travel_model uses max_minutes/max_km; isochrone_tal requires isochrone_tal_id and drops wider bands; zip_list uses service_zip_field) and how trade matching works. It does not cover several notable params (priority_weights, saturation_threshold, capacity_field, contractor_filter) beyond the schema text, keeping it at 4.

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?

Specific verb+resource: 'Finds coverage gaps in a contractor network' with an explicit definition of what counts as a gap (counts contractors reaching each demand point). It also scopes the tool against the sibling that would otherwise be confused with it: 'Assigns nothing; dividing work is auto_build.' An agent can distinguish this from auto_build, analyze_routes, and isochrone_build without opening a 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 enumerates the three coverage modes (drive_time travel model, drive_time with isochrone_tal_id, zip_list), the prerequisites (contractor_layer ingested with layer_role=contractors, plus demand_layer), the 'one trade per call, * for all' rule, and the fallback behavior when inputs are missing (CLARIFICATION_REQUIRED with the question). It also names the alternative tool for the adjacent job (auto_build).

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