Skip to main content
Glama

geofence_contains

Read-onlyIdempotent

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

NameRequiredDescriptionDefault
pointsYesPoints to test ({ lat, lon } each), up to 1000
polygonNoA 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

NameRequiredDescriptionDefault
resultsYesOne containment boolean per input point (in order)
warningsNo
point_countYesNumber of points tested
contained_countYesHow many input points are contained

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / polygon / description
      Previous value: -"A GeoJSON Polygon / MultiPolygon geometry, a Feature wrapping one, or a FeatureCollection"New value: +"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"
    • addedInput schema / properties / polygon / type
      Added value: +[
      +  "object",
      +  "string"
      +]
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnly/idempotent/openWorld, so the description adds substantial value: boundary points count as contained, limits are rejected rather than truncated, large polygons must be JSON-encoded strings, invalid geometry raises errors instead of returning false, and each call is metered even though it runs locally. Minor tension: openWorldHint=true sits slightly at odds with 'runs locally with no external lookup', though that hint more likely signals open-ended output than a real conflict.

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?

Dense but front-loaded: the core test, the sibling exclusion, then constraints and return shape. A few clauses are packed into one paragraph, but virtually every sentence carries non-redundant information.

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?

Despite a two-parameter tool with real complexity (dual-typed polygon input, hard limits, string-encoding threshold, error-vs-false semantics), the description covers everything an agent needs to invoke it correctly; the boolean-per-point return is also sketched even though an output schema exists.

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 would be 3; the description goes further by explaining the dual type of the polygon parameter (object vs JSON-encoded string at ~1,500 positions) and the per-call point/ring/position caps that the schema only partially reflects (maxItems is in schema, ring limits are not).

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?

States a specific verb and resource ('Tests one or more points for containment inside a polygon you supply as GeoJSON') and immediately names the sibling it is not ('it does not search a place index, so use explore or search_places'). An agent can distinguish it from the other geo tools without opening the 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?

Gives explicit when-not guidance by routing point-proximity queries to explore/search_places, and gives operational guidance to batch points into one call rather than looping. The alternative and the condition selecting it are both stated.

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