get_available_crs
Retrieve a list of available Coordinate Reference Systems (CRS) for geospatial analysis using the GIS MCP Server, enabling accurate coordinate transformations and spatial measurements.
Instructions
Get list of available CRS.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/gis_mcp/pyproj_functions.py:109-133 (handler)The handler function implementing the 'get_available_crs' MCP tool. It uses pyproj to list all CRS, retrieves basic info for each (calling get_crs_info), and returns a dictionary with the list of available CRS including auth_name, code, name, and type.@gis_mcp.tool() def get_available_crs() -> Dict[str, Any]: """Get list of available CRS.""" try: import pyproj crs_list = [] for crs in pyproj.database.get_crs_list(): try: crs_info = get_crs_info({"crs": crs}) crs_list.append({ "auth_name": crs.auth_name, "code": crs.code, "name": crs_info["name"], "type": crs_info["type"] }) except: continue return { "status": "success", "crs_list": crs_list, "message": "Available CRS list retrieved successfully" } except Exception as e: logger.error(f"Error getting available CRS: {str(e)}") raise ValueError(f"Failed to get available CRS: {str(e)}")
- src/gis_mcp/pyproj_functions.py:19-30 (registration)MCP resource that lists 'get_available_crs' among the available CRS operations, serving as a discovery mechanism 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" ] }