Skip to content

Commit 4abdad5

Browse files
use geometry model instead of polygon/point
1 parent bb9dd13 commit 4abdad5

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/planet_mcp/models.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
from typing_extensions import Literal, TypedDict
1+
from typing import Any
2+
from typing_extensions import TypedDict
23

34

4-
class Polygon(TypedDict):
5-
type: Literal["Polygon"]
6-
coordinates: list[list[list[float]]]
7-
8-
9-
class Point(TypedDict):
10-
type: Literal["Point"]
11-
coordinates: list[float]
5+
class Geometry(TypedDict):
6+
type: str
7+
coordinates: Any

src/planet_mcp/servers/sdk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ async def wrapper(*args, **kwargs):
150150
if param_name in ("feature", "quad", "mosaic", "series"):
151151
wrapper.__annotations__[param_name] = dict
152152
elif param_name == "geometry" and "planet.models" in str(param.annotation):
153-
# llms should always submit geometry inputs as a Polygon or Point
154-
hint = models.Polygon | models.Point
153+
# llms should always submit geometry inputs as a geojson geometry
154+
hint = models.Geometry
155155

156156
# add None if originally used (NoneType will be an arg
157157
# within a Union type)

0 commit comments

Comments
 (0)