Skip to main content
Glama
Mapbox MCP Server

Mapbox MCP Server

Official
by mapbox

Points Within Polygon

points_within_polygon_tool
Read-onlyIdempotent

Tests single or batched geographic points against a polygon and returns only those inside, enabling delivery zone validation, fleet geofencing, and customer segmentation offline.

Instructions

Test one or more geographic points against a polygon, returning only those inside. Handles a single point or a batch of points in one call. Useful for delivery zone validation, fleet geofencing, and customer segmentation. Works offline without API calls.

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": {
      "points": "<points>",
      "polygon": "<polygon>"
    },
    "name": "points_within_polygon_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
pointsYesArray of points to test against the polygon
polygonYesPolygon coordinates as array of rings (first is outer, rest are holes). Each ring is [longitude, latitude] pairs.

Output Schema

NameRequiredDescriptionDefault
countYesNumber of points inside the polygon
totalYesTotal number of input points tested
points_withinYesPoints that are inside the polygon

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.18.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.12.6

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so the safety profile is fully covered. The description adds genuine value with 'Works offline without API calls,' but it omits important behavioral semantics such as whether points on the boundary count as inside and how holes affect results.

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?

Four sentences, front-loaded with the core operation and followed by input shape, use cases, and a runtime property. Nothing is redundant, though the use-case list is somewhat expendable compared to missing boundary-semantics detail.

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?

The tool is simple (2 required parameters), annotations cover safety and world-access traits, the schema fully documents both parameters, and an output schema exists, so the description needn't explain return values. Only the boundary-inclusion rule is a meaningful gap.

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 100%, and the schema itself documents the point array, coordinate ranges, and the ring/hole structure of the polygon. The description's note that it handles a single point or a batch clarifies how to use the points array, but otherwise adds little beyond the schema, fitting the baseline 3.

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 states a specific verb and resource ('Test one or more geographic points against a polygon') along with a precise scope: returns only the points inside the polygon, and accepts single or batch input. It does not, however, distinguish itself from plausible siblings such as intersect_tool or nearest_point_tool, so the agent must infer the boundary between them.

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?

Three concrete use cases (delivery zone validation, fleet geofencing, customer segmentation) give clear context for when to reach for this tool. However, there is no when-not guidance, no named alternative, and no statement about polygonal boundary cases or holes, leaving the agent to guess at routing and edge conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.