Skip to main content
Glama

get_coordinates

Extracts coordinates from a given geometry using the GIS MCP Server, enabling precise geospatial analysis for location-based data processing.

Instructions

Get the coordinates of a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The primary handler implementation for the 'get_coordinates' MCP tool. Decorated with @gis_mcp.tool() for registration, it parses input WKT geometry using Shapely, extracts coordinates from geom.coords, and returns them in a standardized dict format.
    @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)}")
  • Helper resource endpoint that lists 'get_coordinates' as one of the available geometric property operations, aiding in tool discovery.
    @gis_mcp.resource("gis://operations/geometric") def get_geometric_properties() -> Dict[str, List[str]]: """List available geometric property operations.""" return { "operations": [ "convex_hull", "envelope", "minimum_rotated_rectangle", "get_centroid", "get_bounds", "get_coordinates", "get_geometry_type" ] }

Other Tools

Related Tools

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