Skip to main content
Glama

get_coordinates

Extract coordinate data from geometric shapes to enable geospatial analysis and mapping applications.

Instructions

Get the coordinates of a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The handler function for the 'get_coordinates' MCP tool. It takes a WKT geometry string, loads it using Shapely, extracts the coordinates using geom.coords, and returns them as a list of lists in a success dictionary. Errors are logged and raised.
    @gis_mcp.tool() def get_coordinates(geometry: str) -> Dict[str, Any]: """Get the coordinates of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) return { "status": "success", "coordinates": [list(coord) for coord in geom.coords], "message": "Coordinates retrieved successfully" } except Exception as e: logger.error(f"Error getting coordinates: {str(e)}") raise ValueError(f"Failed to get coordinates: {str(e)}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mahdin75/gis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server