geofence_contains
Tests one or more points for containment inside a polygon you supply as GeoJSON (Polygon, MultiPolygon, or a Feature/FeatureCollection wrapping one). Pure geometry against your own shape - it does not search a place index, so use explore or search_places to find what's near a point instead. Boundary points count as contained. Up to 1000 points per call, against a polygon of up to 100 rings/parts and 1000 positions per ring; larger inputs are rejected. A polygon with more than about 1,500 positions in total must be sent as a GeoJSON string (the same GeoJSON, JSON-encoded) instead of as an object. Runs locally with no external lookup, but still counts as one metered request like other tools, so batch points into a single call rather than looping. Errors, rather than returning false, when the polygon is structurally invalid. Returns one boolean per point, in order, plus contained_count and point_count.
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>"
},
"name": "geofence_contains"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| points | Yes | Points to test ({ lat, lon } each), up to 1000 | |
| polygon | No | A GeoJSON Polygon / MultiPolygon geometry, a Feature wrapping one, or a FeatureCollection. Send it as a JSON-encoded string if it has more than about 1,500 positions |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| results | Yes | One containment boolean per input point (in order) | |
| warnings | No | ||
| point_count | Yes | Number of points tested | |
| contained_count | Yes | How many input points are contained |