Skip to main content
Glama

symmetric_difference

Calculate the symmetric difference between two geometries to identify areas that belong exclusively to one geometry or the other, excluding overlapping regions.

Instructions

Find symmetric difference between geometries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometry1Yes
geometry2Yes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'symmetric_difference' tool. It takes two WKT geometry strings, parses them with Shapely, computes the symmetric difference, and returns the result as WKT with status and message.
    @gis_mcp.tool()
    def symmetric_difference(geometry1: str, geometry2: str) -> Dict[str, Any]:
        """Find symmetric difference between geometries."""
        try:
            from shapely import wkt
            geom1 = wkt.loads(geometry1)
            geom2 = wkt.loads(geometry2)
            result = geom1.symmetric_difference(geom2)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Symmetric difference created successfully"
            }
        except Exception as e:
            logger.error(f"Error creating symmetric difference: {str(e)}")
            raise ValueError(f"Failed to create symmetric difference: {str(e)}")
  • The @gis_mcp.tool() decorator registers the symmetric_difference function as an MCP tool.
    @gis_mcp.tool()
  • Resource listing that includes 'symmetric_difference' among basic geometric operations, aiding tool discovery.
    @gis_mcp.resource("gis://operations/basic")
    def get_basic_operations() -> Dict[str, List[str]]:
        """List available basic geometric operations."""
        return {
            "operations": [
                "buffer",
                "intersection",
                "union",
                "difference",
                "symmetric_difference"
            ]
        }
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 but offers no behavioral details. It doesn't disclose whether this is a read-only or mutating operation, what the output format is, error conditions, or performance implications, making it inadequate for a tool with geometric computations.

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, clear sentence with no wasted words. It's front-loaded and efficiently states the core action, making it highly concise and well-structured for its brevity.

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 the complexity of geometric operations, no annotations, 0% schema coverage, and an output schema (which helps but isn't described), the description is incomplete. It lacks essential context like input formats, behavioral traits, and differentiation from siblings, making it insufficient for effective tool use.

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?

Schema description coverage is 0%, and the description adds no information about parameters. It doesn't explain what 'geometry1' and 'geometry2' represent (e.g., formats like GeoJSON, WKT), their constraints, or examples, failing to compensate for the 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 states the verb ('Find') and resource ('symmetric difference between geometries'), which gives a basic purpose. However, it doesn't specify what 'symmetric difference' means in this geometric context or distinguish it from similar sibling tools like 'difference' or 'intersection', making it somewhat vague.

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 sibling tools like 'difference' and 'intersection' available, the description lacks any context about specific use cases, prerequisites, or comparisons, leaving the agent without usage 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