Skip to main content
Glama

get_area

Calculate the area of a specified geometric shape using the GIS MCP Server, enabling precise geospatial analysis for accurate spatial measurements and decision-making.

Instructions

Get the area of a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The main handler function for the MCP tool 'get_area'. Decorated with @gis_mcp.tool() for automatic registration. Parses WKT geometry using Shapely and computes its area.
    @gis_mcp.tool() def get_area(geometry: str) -> Dict[str, Any]: """Get the area of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) return { "status": "success", "area": float(geom.area), "message": "Area calculated successfully" } except Exception as e: logger.error(f"Error calculating area: {str(e)}") raise ValueError(f"Failed to calculate area: {str(e)}")
  • Resource endpoint that lists 'get_area' among available measurement operations, aiding in tool discovery.
    @gis_mcp.resource("gis://operations/measurements") def get_measurements() -> Dict[str, List[str]]: """List available measurement operations.""" return { "operations": [ "get_length", "get_area" ] }
  • Function signature and docstring defining the input schema (geometry: str) and output (Dict[str, Any]) for the tool.
    def get_area(geometry: str) -> Dict[str, Any]: """Get the area of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) return { "status": "success", "area": float(geom.area), "message": "Area calculated successfully" } except Exception as e: logger.error(f"Error calculating area: {str(e)}") raise ValueError(f"Failed to calculate area: {str(e)}")

Other Tools

Related 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