get_crs_info
Retrieve detailed information about a Coordinate Reference System (CRS) by providing its identifier. This tool on the GIS MCP Server supports geospatial analysis by enabling precise CRS data queries for accurate coordinate transformations and spatial operations.
Instructions
Get information about a CRS.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crs | Yes |
Implementation Reference
- src/gis_mcp/pyproj_functions.py:86-107 (handler)The primary handler function for the 'get_crs_info' tool. It uses pyproj.CRS to fetch detailed information about the specified CRS, including name, type, axis info, geographic/projected status, datum, ellipsoid, prime meridian, and area of use.@gis_mcp.tool() def get_crs_info(crs: str) -> Dict[str, Any]: """Get information about a CRS.""" try: import pyproj crs_obj = pyproj.CRS(crs) return { "status": "success", "name": crs_obj.name, "type": crs_obj.type_name, "axis_info": [axis.direction for axis in crs_obj.axis_info], "is_geographic": crs_obj.is_geographic, "is_projected": crs_obj.is_projected, "datum": str(crs_obj.datum), "ellipsoid": str(crs_obj.ellipsoid), "prime_meridian": str(crs_obj.prime_meridian), "area_of_use": str(crs_obj.area_of_use) if crs_obj.area_of_use else None, "message": "CRS information retrieved successfully" } except Exception as e: logger.error(f"Error getting CRS info: {str(e)}") raise ValueError(f"Failed to get CRS info: {str(e)}")
- MCP resource that lists available CRS information operations, including 'get_crs_info'. This serves as a schema or discovery endpoint for the tool.@gis_mcp.resource("gis://crs/info") def get_crs_info_operations() -> Dict[str, List[str]]: """List available CRS information operations.""" return { "operations": [ "get_crs_info", "get_available_crs", "get_utm_zone", "get_utm_crs", "get_geocentric_crs" ] }