Skip to main content
Glama

is_valid

Validate geometry data for GIS operations by checking if it meets geospatial standards and can be used in spatial analysis.

Instructions

Check if a geometry is valid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'is_valid' MCP tool. It parses WKT geometry using Shapely, checks if it is valid with geom.is_valid, and returns a dictionary containing the validation status.
    @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)}")
  • The @gis_mcp.tool() decorator registers the is_valid function as an MCP tool.
    @gis_mcp.tool()
  • Resource listing that includes 'is_valid' among available validation operations.
    @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 for behavioral disclosure. 'Check if a geometry is valid' implies a read-only diagnostic operation, but doesn't specify what 'valid' means in this context, what validation criteria are used, what the output format is, or whether this tool has any side effects or performance characteristics.

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 maximally concise with a single, clear sentence that states the core functionality without any unnecessary words. It's perfectly front-loaded and wastes no space.

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

Completeness3/5

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

For a single-parameter diagnostic tool with an output schema (which should document the validation result), the description is minimally adequate. However, it lacks important context about validation criteria, geometry formats, and relationship to the 'make_valid' sibling tool, leaving significant gaps in understanding.

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 semantic information about what format the geometry should be in (e.g., WKT, GeoJSON, coordinates), what coordinate systems are supported, or what constitutes valid input. The description doesn't compensate for the schema's lack of documentation.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Check') and resource ('a geometry'), making it immediately understandable. However, it doesn't distinguish this validation tool from the 'make_valid' sibling tool, which appears to perform a related corrective function.

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?

The description provides no guidance on when to use this tool versus alternatives like 'make_valid' or other geometry analysis tools. There's no mention of prerequisites, error conditions, or typical use cases for geometry validation.

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