Skip to main content
Glama

is_valid

Validate geometry accuracy with the GIS MCP Server's tool, ensuring geospatial data integrity for precise geometric operations and analysis.

Instructions

Check if a geometry is valid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The core handler function for the 'is_valid' MCP tool. It takes a WKT geometry string, loads it with Shapely, checks if it is valid using geom.is_valid, and returns a dictionary with status, is_valid boolean, and message.
    @gis_mcp.tool() def is_valid(geometry: str) -> Dict[str, Any]: """Check if a geometry is valid.""" try: from shapely import wkt geom = wkt.loads(geometry) return { "status": "success", "is_valid": bool(geom.is_valid), "message": "Geometry validation completed successfully" } except Exception as e: logger.error(f"Error validating geometry: {str(e)}") raise ValueError(f"Failed to validate geometry: {str(e)}")
  • Supporting resource that catalogs the available validation operations, including the 'is_valid' tool.
    @gis_mcp.resource("gis://operations/validation") def get_validation_operations() -> Dict[str, List[str]]: """List available validation operations.""" return { "operations": [ "is_valid", "make_valid", "simplify" ] }

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