Skip to main content
Glama

point_in_polygon

Determines whether a latitude/longitude point lies inside a GeoJSON Polygon or MultiPolygon for spatial containment checks.

Instructions

True if the point is inside a GeoJSON Polygon or MultiPolygon (GeoJSON is lon, lat order).

polygon_geojson is the GeoJSON object itself or a JSON string of it.

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": {
      "lat": "<lat>",
      "lon": "<lon>",
      "polygon_geojson": "<polygon_geojson>"
    },
    "name": "point_in_polygon"
  }
}

Input Schema

NameRequiredDescriptionDefault
latYes
lonYes
polygon_geojsonYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With zero annotations the description carries the full burden, and it does disclose two useful behaviors: the return is a boolean 'True if inside' and the polygon uses lon, lat ordering while the point parameters are lat/lon. It omits edge-case behavior (points on the boundary, invalid or self-intersecting polygons, antimeridian handling) which matters for a geometry predicate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the predicate and return meaning, then the one input nuance that is easy to get wrong. No wasted wording.

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 simple three-parameter geometric predicate with an output schema already covering the return value, the description supplies the essential semantics: boolean result, GeoJSON input type, and coordinate ordering. Remaining gaps are edge cases rather than anything needed to call it correctly.

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 0%, so the description must compensate. It clarifies that polygon_geojson is the GeoJSON object itself or a JSON string of it, and warns about the lon/lat ordering inside that object versus the separate lat/lon params — meaningful added semantics. It still says nothing about what lat and lon themselves accept (ranges, WGS84 assumption).

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?

States a specific predicate and resource: a boolean containment test of a point against a GeoJSON Polygon or MultiPolygon. That is clearly distinguishable from siblings like distance_bearing or features_within, though it never names them explicitly.

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

Usage Guidelines2/5

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

There is no when-to-use guidance and no alternatives referenced. The agent must infer from the tool name and the word 'inside' when this beats features_within or nearest_features.

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