Skip to main content
Glama

get_geometry_type

Identify the geometry type (e.g., point, line, polygon) of a given geospatial shape. Enables precise geospatial analysis by determining the structure of input geometries for GIS operations.

Instructions

Get the type of a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The handler function decorated with @gis_mcp.tool(), which parses WKT input geometry using Shapely, retrieves its geom_type, and returns it in a structured dictionary with status and message.
    @gis_mcp.tool() def get_geometry_type(geometry: str) -> Dict[str, Any]: """Get the type of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) return { "status": "success", "type": geom.geom_type, "message": "Geometry type retrieved successfully" } except Exception as e: logger.error(f"Error getting geometry type: {str(e)}") raise ValueError(f"Failed to get geometry type: {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