Skip to main content
Glama

union

Combine two geometries to create a single unified shape for spatial analysis in GIS operations.

Instructions

Combine two geometries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometry1Yes
geometry2Yes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'union' MCP tool. It takes two WKT geometry strings, computes their union using Shapely, and returns the result as WKT with status.
    @gis_mcp.tool()
    def union(geometry1: str, geometry2: str) -> Dict[str, Any]:
        """Combine two geometries."""
        try:
            from shapely import wkt
            geom1 = wkt.loads(geometry1)
            geom2 = wkt.loads(geometry2)
            result = geom1.union(geom2)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Union created successfully"
            }
        except Exception as e:
            logger.error(f"Error creating union: {str(e)}")
            raise ValueError(f"Failed to create union: {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. 'Combine two geometries' is vague—it doesn't specify what 'combine' means (e.g., union, merge, overlay), what the output is, whether it's a read-only or destructive operation, or any error conditions. This leaves critical behavioral traits undefined.

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—a single three-word sentence—with no wasted words. It's front-loaded and efficiently states the core action, though this brevity comes at the cost of completeness.

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 (a geometric operation with 2 parameters, 0% schema coverage, no annotations, but with an output schema), the description is incomplete. It doesn't explain what 'combine' entails, how it differs from siblings, or what the output represents. The presence of an output schema mitigates some gaps, but the description lacks essential context for effective tool selection and use.

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?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'two geometries' which aligns with the two parameters (geometry1, geometry2), but adds no semantic details beyond what's inferred from the parameter names—no format, constraints, or examples. This is insufficient given the coverage gap.

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 'Combine two geometries' clearly states the verb ('combine') and resource ('geometries'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'intersection', 'difference', or 'symmetric_difference' that also operate on two geometries, leaving some ambiguity about what specific type of combination it performs.

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. Given the many sibling tools that also process geometries (e.g., 'intersection', 'difference', 'symmetric_difference'), there's no indication of what 'combine' means in this context or when it's the appropriate choice over other geometric operations.

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