Skip to main content
Glama
es3154

Turf-MCP

by es3154

coordinate_mutation_rewind

Corrects polygon ring orientation to ensure outer rings are counterclockwise and inner rings clockwise, meeting GIS standards for accurate area calculations.

Instructions

修正多边形的环方向,确保外环逆时针、内环顺时针。

此功能自动调整多边形的环方向,符合地理信息系统标准,确保多边形区域计算正确。

Args: geojson: GeoJSON 多边形特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Polygon 或 MultiPolygon 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[121, -29], [138, -29], [138, -18], [121, -18], [121, -29]]]}'

options: 可选参数配置
    - 类型: str (JSON 字符串) 或 None
    - 可选字段:
        - reverse: 是否启用反向重绕 (默认: false)
        - mutate: 是否允许修改输入 GeoJSON (默认: false)
    - 示例: '{"reverse": true, "mutate": false}'

Returns: str: JSON 字符串格式的重绕后的 GeoJSON 多边形 - 类型: GeoJSON Feature with Polygon geometry - 格式: 重绕环方向后的多边形 - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[121, -29], [121, -18], [138, -18], [138, -29], [121, -29]]]}}'

Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常

Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[121, -29], [138, -29], [138, -18], [121, -18], [121, -29]]]}' >>> result = asyncio.run(rewind(polygon)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[121, -29], [121, -18], [138, -18], [138, -29], [121, -29]]]}}'

Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 外环应为逆时针方向,内环应为顺时针方向 - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geojsonYes
optionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: it's a mutation tool (implied by '修正' and '调整'), specifies input/output formats (GeoJSON strings), notes dependencies (Turf.js and Node.js), and mentions error conditions (JavaScript execution failures, timeouts, data format errors). However, it lacks details on performance, rate limits, or authentication needs, which could be relevant for an agent.

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

Conciseness3/5

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

The description is appropriately sized but not optimally structured. It starts with a clear purpose, but includes extensive sections (Args, Returns, Raises, Example, Notes) that, while informative, could be more streamlined. Some redundancy exists (e.g., coordinate order mentioned multiple times). Every sentence adds value, but the organization could be more front-loaded for quick scanning by an agent.

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

Completeness5/5

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

Given the tool's complexity (mutation of geometric data), no annotations, and an output schema present, the description is highly complete. It covers purpose, usage context, parameter details, return values, error handling, examples, and technical notes (dependencies, coordinate systems). The output schema handles return structure, so the description need not duplicate that, allowing focus on behavioral and semantic aspects.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It provides detailed semantics for both parameters: 'geojson' is explained with type, format, coordinate system, and an example; 'options' is described with type, optional fields ('reverse' and 'mutate'), defaults, and an example. This adds substantial value beyond the bare schema, covering all parameter aspects comprehensively.

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

Purpose5/5

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

The description clearly states the tool's purpose: '修正多边形的环方向,确保外环逆时针、内环顺时针' (corrects polygon ring orientation to ensure outer rings are counterclockwise and inner rings are clockwise). It specifies the exact operation (orientation correction) and target resource (polygons), and distinguishes from siblings like 'coordinate_mutation_flip' or 'coordinate_mutation_clean_coords' by focusing on ring orientation rather than coordinate transformation or cleaning.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: for ensuring polygon ring orientation complies with GIS standards for correct area calculations. However, it does not explicitly state when NOT to use it or name specific alternatives among the many sibling tools, such as 'booleans_booleanPointInPolygon' for point-in-polygon checks or 'transformation_union' for combining polygons, which might be relevant in related workflows.

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/es3154/turf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server