Skip to main content
Glama

difference

Calculate geometric differences between two spatial datasets to identify unique areas and perform spatial analysis in GIS workflows.

Instructions

Find difference between geometries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometry1Yes
geometry2Yes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the "difference" tool. It computes the geometric difference between two input geometries provided as WKT strings using Shapely.geometry.difference, returning the result WKT or raising an error.
    @gis_mcp.tool()
    def difference(geometry1: str, geometry2: str) -> Dict[str, Any]:
        """Find difference between geometries."""
        try:
            from shapely import wkt
            geom1 = wkt.loads(geometry1)
            geom2 = wkt.loads(geometry2)
            result = geom1.difference(geom2)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Difference created successfully"
            }
        except Exception as e:
            logger.error(f"Error creating difference: {str(e)}")
            raise ValueError(f"Failed to create difference: {str(e)}")
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Find difference between geometries' implies a computational operation but reveals nothing about what the tool actually returns (e.g., geometric difference, boolean result, area calculation), whether it modifies inputs, error conditions, or performance characteristics. This leaves the agent guessing about the tool's behavior and output.

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 a single, focused sentence with zero wasted words. It's appropriately sized for a simple tool concept and front-loads the core purpose immediately. While lacking detail, it achieves maximum efficiency in its minimal form.

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?

Given 2 required parameters with no schema descriptions, no annotations, and a sibling-rich context of 80+ geometric tools, the description is severely incomplete. While an output schema exists (which helps), the description doesn't provide enough context about what geometric 'difference' means, how it differs from similar operations, or what the agent should expect. For a computational geometry tool in a crowded namespace, this leaves critical gaps.

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

Parameters1/5

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

With 0% schema description coverage for both parameters, the description adds no semantic information about what 'geometry1' and 'geometry2' represent. It doesn't specify expected formats (e.g., GeoJSON, WKT), coordinate systems, or valid geometry types. The description fails to compensate for the complete lack of parameter documentation in the schema.

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

Purpose2/5

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

The description 'Find difference between geometries' restates the tool name 'difference' without specifying what 'difference' means in this geometric context. It doesn't distinguish this from sibling tools like 'intersection', 'symmetric_difference', or 'union', leaving the specific operation ambiguous. This is essentially a tautology that provides minimal clarification beyond the name itself.

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

Usage Guidelines1/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 'intersection', 'symmetric_difference', or 'clip_vector'. There's no mention of prerequisites, expected input formats, or typical use cases. The agent must infer usage entirely from the tool name and parameters without any contextual direction.

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