Skip to main content
Glama
Mapbox MCP Server

Mapbox MCP Server

Official
by mapbox

Intersect Polygons

intersect_tool
Read-onlyIdempotent

Calculate the intersection geometry of two polygons to identify their shared area for coverage, service, or zone overlap analysis. Returns null when no overlap occurs; works offline.

Instructions

Find the intersection geometry of two polygons — the area they share in common. Useful for coverage overlap analysis, finding shared service areas, or zone overlap. Returns null geometry if the polygons do not overlap. Works offline without API calls. INPUT SHAPE: polygon1 and polygon2 are each an array of rings; each ring is an array of [lng, lat] pairs. When chaining with isochrone_tool, extract feature.geometry.coordinates from each isochrone Feature (with polygons=true).

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": {
      "polygon1": "<polygon1>",
      "polygon2": "<polygon2>"
    },
    "name": "intersect_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
polygon1YesFirst polygon
polygon2YesSecond polygon

Output Schema

NameRequiredDescriptionDefault
geometryYesGeoJSON geometry of the intersection, or null if no overlap
intersectsYesWhether the two polygons overlap
mapboxRenderNoMap-payload reference for `render_map_tool`. Surfaced so the LLM can chain the next call without re-emitting geometry.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 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"
    • addedInput schema / properties / polygon1 / items / description
      Added value: +"A closed linear ring: 4+ [longitude, latitude] coordinate pairs where the first and last pair are identical (e.g. [[-77, 38], [-76, 38], [-76, 39], [-77, 39], [-77, 38]])."
    • addedInput schema / properties / polygon1 / items / minItems
      Added value: +4
    • addedInput schema / properties / polygon2 / items / description
      Added value: +"A closed linear ring: 4+ [longitude, latitude] coordinate pairs where the first and last pair are identical (e.g. [[-77, 38], [-76, 38], [-76, 39], [-77, 39], [-77, 38]])."
    • addedInput schema / properties / polygon2 / items / minItems
      Added value: +4
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +{}
    • addedOutput schema / properties / mapboxRender
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Map-payload reference for `render_map_tool`. Surfaced so the LLM can chain the next call without re-emitting geometry.",
      +  "properties": {
      +    "ref": {
      +      "description": "Server-side payload reference. Pass to `render_map_tool` via `payload_refs: [\"<this ref>\"]` to display the data on a live Mapbox GL JS map, or, in ChatGPT Desktop, to the `redraw_map` tool of the open Mapbox map.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ref"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.12.6

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world behavior, so the bar is lower. The description adds two genuinely behavioral facts beyond them: a null geometry is returned when polygons do not overlap, and the operation runs offline with no API calls.

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?

Purpose is front-loaded in one clean sentence, followed by compact use cases and a clearly labeled INPUT SHAPE note. The input-shape paragraph duplicates schema content and could be trimmed to just the isochrone extraction hint, but nothing is padded or vague.

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?

With an output schema present and rich annotations, the description covers what remains: the null-on-no-overlap outcome, offline behavior, and how to source inputs when chaining. Only explicit guidance on choosing this over union/difference is absent.

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 nested ring structure, closed-ring requirement, coordinate ordering and examples are all already in the schema. The description's INPUT SHAPE section largely restates that, adding value mainly through the pointer to isochrone output coordinates.

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?

The first sentence gives a precise verb+resource ('Find the intersection geometry of two polygons') and immediately defines it as 'the area they share in common', which distinguishes it from geometric siblings like union_tool or difference_tool without needing to name them.

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

Usage Guidelines4/5

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

It supplies concrete use cases (coverage overlap analysis, shared service areas, zone overlap) and a chaining rule for isochrone_tool, including where to pull coordinates from. It stops short of explicit when-not guidance or naming union/difference as alternatives for the non-overlap-combining case.

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