Skip to main content
Glama

scale_geometry

Scale geometric shapes by adjusting X and Y dimensions to resize maps, models, or spatial data for analysis and visualization.

Instructions

Scale a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes
xfactYes
yfactYes
originNocenter

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main execution logic for the 'scale_geometry' tool. Parses WKT input, applies shapely.affinity.scale with xfact, yfact, and origin parameters, returns scaled geometry as WKT.
    @gis_mcp.tool()
    def scale_geometry(geometry: str, xfact: float, yfact: float, 
                    origin: str = "center") -> Dict[str, Any]:
        """Scale a geometry."""
        try:
            from shapely import wkt
            from shapely.affinity import scale
            geom = wkt.loads(geometry)
            result = scale(geom, xfact=xfact, yfact=yfact, origin=origin)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Geometry scaled successfully"
            }
        except Exception as e:
            logger.error(f"Error scaling geometry: {str(e)}")
            raise ValueError(f"Failed to scale geometry: {str(e)}")
  • Resource endpoint listing available transformation tools, including 'scale_geometry'.
    @gis_mcp.resource("gis://operations/transformations")
    def get_transformations() -> Dict[str, List[str]]:
        """List available geometric transformations."""
        return {
            "operations": [
                "rotate_geometry",
                "scale_geometry",
                "translate_geometry"
            ]
        }
  • Function signature defining input schema (geometry: str WKT, xfact/yfact: float scaling factors, origin: str='center') and output (Dict with status, geometry WKT, message).
    def scale_geometry(geometry: str, xfact: float, yfact: float, 
                    origin: str = "center") -> Dict[str, Any]:
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. 'Scale a geometry' implies a mutation operation, but it fails to describe any behavioral traits such as whether the scaling is destructive, requires specific permissions, has side effects, or handles errors. This is inadequate for a tool with no annotation coverage.

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 extremely concise with a single sentence 'Scale a geometry.' It is front-loaded and wastes no words, though this brevity comes at the cost of clarity and completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a geometry transformation with 4 parameters), lack of annotations, 0% schema description coverage, and presence of an output schema, the description is severely incomplete. It does not explain what the tool does beyond the name, how to use it, or what to expect, making it inadequate for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning none of the 4 parameters (geometry, xfact, yfact, origin) are documented in the schema. The description adds no information about parameter meanings, formats, or usage, failing to compensate for the complete lack of schema documentation.

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 'Scale a geometry' is a tautology that merely restates the tool name 'scale_geometry' without adding specificity. It does not clarify what type of geometry (e.g., vector, raster) or what scaling operation is performed, nor does it distinguish this tool from sibling tools like 'rotate_geometry' or 'translate_geometry' that also transform geometries.

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 no guidance on when to use this tool versus alternatives. It does not mention any prerequisites, context for scaling operations, or comparisons to sibling tools like 'normalize_geometry' or 'transform_coordinates', leaving the agent with no usage direction.

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