Skip to main content
Glama

make_valid

Ensure geometry validity for accurate geospatial analysis. Fix invalid geometries to enable precise GIS operations and spatial measurements using the GIS MCP Server.

Instructions

Make a geometry valid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The handler function decorated with @gis_mcp.tool() that implements the make_valid tool. It parses WKT input, calls Shapely's make_valid method, and returns the result as WKT.
    @gis_mcp.tool() def make_valid(geometry: str) -> Dict[str, Any]: """Make a geometry valid.""" try: from shapely import wkt geom = wkt.loads(geometry) result = geom.make_valid() return { "status": "success", "geometry": result.wkt, "message": "Geometry made valid successfully" } except Exception as e: logger.error(f"Error making geometry valid: {str(e)}") raise ValueError(f"Failed to make geometry valid: {str(e)}")
  • Resource endpoint that lists 'make_valid' among available validation operations, serving as tool discovery/registration.
    @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" ] }

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