Skip to main content
Glama

buffer

Create a buffer zone around geographic features to analyze proximity, define boundaries, or calculate spatial relationships in GIS workflows.

Instructions

Create a buffer around a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes
distanceYes
resolutionNo
join_styleNo
mitre_limitNo
single_sidedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'buffer' MCP tool. It takes WKT geometry string, distance, and buffer parameters, uses Shapely to create a buffer, and returns the resulting WKT geometry in a success dict or raises error.
    @gis_mcp.tool()
    def buffer(geometry: str, distance: float, resolution: int = 16, 
            join_style: int = 1, mitre_limit: float = 5.0, 
            single_sided: bool = False) -> Dict[str, Any]:
        """Create a buffer around a geometry."""
        try:
            from shapely import wkt
            geom = wkt.loads(geometry)
            buffered = geom.buffer(
                distance=distance,
                resolution=resolution,
                join_style=join_style,
                mitre_limit=mitre_limit,
                single_sided=single_sided
            )
            return {
                "status": "success",
                "geometry": buffered.wkt,
                "message": "Buffer created successfully"
            }
        except Exception as e:
            logger.error(f"Error creating buffer: {str(e)}")
            raise ValueError(f"Failed to create buffer: {str(e)}")
  • Function signature providing input schema via type hints (geometry: str WKT, distance: float, etc.) and output as Dict[str, Any], with docstring description.
    def buffer(geometry: str, distance: float, resolution: int = 16, 
            join_style: int = 1, mitre_limit: float = 5.0, 
            single_sided: bool = False) -> Dict[str, Any]:
  • The @gis_mcp.tool() decorator registers this function as the MCP tool named 'buffer'.
    @gis_mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Create a buffer' implies a write/mutation operation, but it doesn't disclose behavioral traits like whether it modifies input geometry, requires specific permissions, has rate limits, or what the output looks like (though an output schema exists). This leaves significant gaps for a tool with 6 parameters.

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, efficient sentence that states the core purpose without waste. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 6 parameters with 0% schema coverage and no annotations, the description is incomplete—it doesn't explain parameter semantics or behavioral context. However, the existence of an output schema mitigates the need to describe return values, keeping it from being a total failure.

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. It mentions 'geometry' and 'distance' implicitly but doesn't explain any parameters—what geometry format is expected, what units distance uses, or what 'resolution', 'join_style', etc., mean. This fails to add meaning beyond the bare schema.

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 action ('Create a buffer') and the target ('around a geometry'), which is specific and unambiguous. However, it doesn't differentiate this tool from other geometry manipulation siblings like 'simplify' or 'convex_hull', which would require mentioning the spatial buffer operation specifically.

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. With many sibling tools for geometry operations (e.g., 'simplify', 'convex_hull', 'difference'), there's no indication of when buffering is appropriate or what prerequisites might be needed.

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