Skip to main content
Glama

get_bounds

Retrieve the bounding box coordinates of a specified geometry. Use this to define the spatial extent for geospatial analysis and mapping within the GIS MCP Server.

Instructions

Get the bounds of a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The handler function for the 'get_bounds' tool. It parses a WKT geometry string using Shapely, computes the bounds (minx, miny, maxx, maxy), and returns them in a success dictionary or raises an error.
    @gis_mcp.tool() def get_bounds(geometry: str) -> Dict[str, Any]: """Get the bounds of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) return { "status": "success", "bounds": list(geom.bounds), "message": "Bounds calculated successfully" } except Exception as e: logger.error(f"Error calculating bounds: {str(e)}") raise ValueError(f"Failed to calculate bounds: {str(e)}")

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