Simplify geometry
simplify_geometrySimplify GeoJSON geometry to fit a token budget while reporting lost detail. Automatically adjusts tolerance to preserve as much accuracy as possible.
Instructions
Simplify a GeoJSON geometry to fit a token budget, reporting what was lost.
Works on caller-supplied GeoJSON (Polygon, MultiPolygon, LineString,
MultiLineString; Points/MultiPoints pass through unchanged). Binary
searches the simplification tolerance until the result fits max_tokens
instead of asking the caller to guess one. Returns {"geometry": ...,
"max_deviation_m": ..., "original_points": N, "kept_points": M}, or a
structured {"error": "invalid_geometry", ...} for malformed input.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geojson | Yes | ||
| max_tokens | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||