Skip to main content
Glama

simplify

Reduce geometric complexity while preserving essential shapes for GIS analysis. Specify tolerance to control simplification level and maintain topology as needed.

Instructions

Simplify a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes
toleranceYes
preserve_topologyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'simplify' tool. It takes a WKT geometry string and tolerance, simplifies the geometry using Shapely's simplify method, and returns the result as WKT.
    @gis_mcp.tool()
    def simplify(geometry: str, tolerance: float, 
                preserve_topology: bool = True) -> Dict[str, Any]:
        """Simplify a geometry."""
        try:
            from shapely import wkt
            geom = wkt.loads(geometry)
            result = geom.simplify(tolerance=tolerance, preserve_topology=preserve_topology)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Geometry simplified successfully"
            }
        except Exception as e:
            logger.error(f"Error simplifying geometry: {str(e)}")
            raise ValueError(f"Failed to simplify geometry: {str(e)}")
  • Resource listing that includes 'simplify' as an available validation operation, aiding in tool discovery.
    @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"
            ]
        }
  • Function signature defining the input schema (geometry: str, tolerance: float, preserve_topology: bool=True) and output (Dict[str, Any]).
    def simplify(geometry: str, tolerance: float, 
                preserve_topology: bool = True) -> Dict[str, Any]:
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool simplifies geometry but doesn't disclose behavioral traits such as whether it modifies input data, requires specific permissions, has rate limits, or what the output entails (e.g., simplified geometry format). This leaves significant gaps for a mutation tool.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words. It's front-loaded and clear in its brevity, though it could benefit from more detail given the complexity of the tool and lack of annotations.

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?

Given the tool has an output schema (which likely describes the return value), the description doesn't need to explain outputs. However, with 3 parameters at 0% schema coverage, no annotations, and many sibling tools, the description is incomplete—it lacks usage context, parameter details, and behavioral transparency, making it minimally adequate but with clear 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?

The input schema has 0% description coverage, so parameters 'geometry', 'tolerance', and 'preserve_topology' are undocumented. The description adds no meaning beyond the schema—it doesn't explain what 'geometry' expects (e.g., GeoJSON string), how 'tolerance' affects simplification, or what 'preserve_topology' controls. This fails to compensate for the low schema coverage.

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 'Simplify a geometry' clearly states the action (simplify) and target (geometry), but it's vague about what simplification entails (e.g., reducing vertices, smoothing). It doesn't differentiate from siblings like 'normalize_geometry' or 'make_valid', which might have overlapping purposes in geometric processing.

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 on when to use this tool versus alternatives. With many sibling tools for geometry manipulation (e.g., 'normalize_geometry', 'make_valid', 'buffer'), the description lacks context on specific use cases, prerequisites, or exclusions, leaving the agent to guess based on the tool name alone.

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