Skip to main content
Glama

translate_geometry

Move a geometry by specified offsets in X, Y, and optionally Z directions to reposition spatial features in GIS analysis.

Instructions

Translate a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes
xoffYes
yoffYes
zoffNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'translate_geometry' MCP tool. It parses WKT input geometry, applies translation using shapely.affinity.translate with xoff, yoff, and optional zoff offsets, and returns the resulting WKT geometry in a success response dictionary. Errors are logged and raised.
    @gis_mcp.tool()
    def translate_geometry(geometry: str, xoff: float, yoff: float, 
                        zoff: float = 0.0) -> Dict[str, Any]:
        """Translate a geometry."""
        try:
            from shapely import wkt
            from shapely.affinity import translate
            geom = wkt.loads(geometry)
            result = translate(geom, xoff=xoff, yoff=yoff, zoff=zoff)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Geometry translated successfully"
            }
        except Exception as e:
            logger.error(f"Error translating geometry: {str(e)}")
            raise ValueError(f"Failed to translate geometry: {str(e)}")
  • Helper resource endpoint that lists available geometric transformation operations, including 'translate_geometry', for discovery purposes.
    def get_transformations() -> Dict[str, List[str]]:
        """List available geometric transformations."""
        return {
            "operations": [
                "rotate_geometry",
                "scale_geometry",
                "translate_geometry"
            ]
        }
  • The @gis_mcp.tool() decorator registers the translate_geometry function as an MCP tool, with schema inferred from type hints and docstring.
    @gis_mcp.tool()
    def translate_geometry(geometry: str, xoff: float, yoff: float, 
                        zoff: float = 0.0) -> Dict[str, Any]:
        """Translate a geometry."""
        try:
            from shapely import wkt
            from shapely.affinity import translate
            geom = wkt.loads(geometry)
            result = translate(geom, xoff=xoff, yoff=yoff, zoff=zoff)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Geometry translated successfully"
            }
        except Exception as e:
            logger.error(f"Error translating geometry: {str(e)}")
            raise ValueError(f"Failed to translate geometry: {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 the full burden of behavioral disclosure. 'Translate a geometry' implies a geometric transformation but reveals nothing about required permissions, whether the operation is destructive or read-only, performance characteristics, error conditions, or output format. For a tool that modifies spatial data, this lack of transparency creates significant uncertainty about its effects and limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single three-word phrase—with zero wasted words. However, this brevity comes at the cost of under-specification; while structurally minimal, it lacks the necessary detail for effective tool use. It's front-loaded by default but doesn't provide the substance needed beyond its compact form.

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 tool's geometric transformation purpose, zero annotation coverage, 0% schema description coverage, and the presence of an output schema (which relieves some burden for describing return values), the description is severely incomplete. It doesn't address critical context like coordinate systems, units, whether the operation preserves geometric properties, or how it relates to sibling tools. The output schema helps, but the description fails to provide enough information for confident tool selection and invocation.

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%, meaning none of the four parameters (geometry, xoff, yoff, zoff) have descriptions in the schema. The tool description adds no parameter information whatsoever—it doesn't explain what 'geometry' should contain (e.g., WKT, GeoJSON), what units the offset parameters use, or what 'zoff' defaults to. While it doesn't contradict the schema, it fails to compensate for the complete lack of schema documentation, leaving parameters semantically opaque.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Translate a geometry' is a tautology that restates the tool name without elaboration. It specifies the verb 'translate' and resource 'geometry', but provides no information about what translation means in this context (e.g., spatial displacement), how it differs from similar tools like 'transform_coordinates' or 'project_geometry', or what coordinate systems are involved. This is minimally better than a single-word description but fails to distinguish the tool's specific purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides absolutely no guidance on when to use this tool versus alternatives. With many sibling tools performing geometric operations (e.g., 'rotate_geometry', 'scale_geometry', 'project_geometry', 'transform_coordinates'), there is no indication of when translation is appropriate, what prerequisites exist, or what alternatives might be better suited for different scenarios. This leaves the agent guessing about appropriate use cases.

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