Skip to main content
Glama

make_valid

Fix invalid geometries in GIS data to ensure accurate geospatial analysis and prevent processing errors.

Instructions

Make a geometry valid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @gis_mcp.tool() that implements the 'make_valid' tool. It parses WKT geometry, applies Shapely's make_valid to fix invalid geometries, 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, make_valid
            geom = wkt.loads(geometry)
            result = make_valid(geom)
            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 listing that includes 'make_valid' among available validation operations, indicating its registration in the MCP toolset.
    @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"
            ]
        }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral information. It implies a write/mutation operation ('Make') but doesn't disclose what happens to the input geometry, whether the operation is destructive, what validation rules are applied, or what happens if repair fails. The description doesn't mention error conditions, performance characteristics, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words, with zero wasted text. It's front-loaded with the core purpose. While potentially under-specified, it achieves maximum efficiency in word count.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a geometry repair tool with no annotations, 0% parameter documentation, and significant behavioral implications, the description is inadequate. While an output schema exists (which helps), the description doesn't provide enough context about what the tool actually does, what problems it solves, or how to use it effectively. The combination of sparse description and missing annotations creates significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for the single 'geometry' parameter, the description provides no additional parameter information. It doesn't specify the expected format (WKT, GeoJSON, etc.), coordinate system requirements, or what constitutes a valid vs. invalid geometry input. The description fails to compensate for the complete lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Make a geometry valid' states the tool's purpose (repairing invalid geometries) but is vague about what 'valid' means in this context. It distinguishes from sibling 'is_valid' (which checks validity) but doesn't specify what types of geometry issues it fixes or what validation standard it uses.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. While the name suggests it should be used after 'is_valid' detects an invalid geometry, this relationship isn't stated. There's no mention of prerequisites, limitations, or comparison to other geometry repair tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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