Skip to main content
Glama
es3154

Turf-MCP

by es3154

transformation_transformTranslate

Translate GeoJSON objects by specified distance and direction using Turf.js. Input geographic data to shift positions along rhumb lines for spatial analysis and mapping applications.

Instructions

平移 GeoJSON 对象。

该函数使用 Turf.js 库的 transformTranslate 方法,沿恒向线移动 GeoJSON 对象。

Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}'

distance: 移动距离
    - 类型: float
    - 描述: 移动距离,负值表示相反方向
    - 示例: 100.0

direction: 移动方向
    - 类型: float
    - 描述: 移动方向(十进制度数),从北方向顺时针测量
    - 示例: 35.0

options: 可选参数配置
    - 类型: str (JSON 字符串) 或 None
    - 可选字段:
        - units: 距离单位 (默认: 'kilometers')
            - 有效值: 'miles', 'nauticalmiles', 'kilometers', 'meters', 'yards', 'feet', 'inches'
        - zTranslation: 垂直移动距离 (默认: 0)
        - mutate: 是否允许修改输入对象 (默认: false)
    - 示例: '{"units": "miles", "zTranslation": 10, "mutate": false}'

Returns: str: JSON 字符串格式的平移后的 GeoJSON 对象 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 与输入相同的格式 - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0.6,29.3],[4.1,29.3],[3.1,32.3],[0.6,29.3]]]}}'

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

Example: >>> import asyncio >>> geojson = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(transformTranslate(geojson, 100.0, 35.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0.6,29.3],[4.1,29.3],[3.1,32.3],[0.6,29.3]]]}}'

Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 方向从北方向顺时针测量 - 距离可以为负值,表示相反方向移动 - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geojsonYes
distanceYes
directionYes
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 full burden and delivers substantial behavioral information. It explains the coordinate system (WGS84, longitude-first), direction measurement convention (degrees clockwise from north), that negative distance reverses direction, the optional mutate parameter behavior, and dependencies on Turf.js/Node.js. It also documents error conditions (JavaScript execution failure, timeout, malformed input) and return format. The only missing behavioral aspects might be performance characteristics or specific edge cases.

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 well-structured with clear sections (Args, Returns, Raises, Example, Notes) and front-loads the core purpose. While comprehensive, some information could be more concise - the example includes full import/execution code that might be verbose. However, every section adds value, and the organization helps the agent quickly find needed information.

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 (geospatial transformation with multiple parameters), no annotations, and 0% schema coverage, the description provides exceptional completeness. It covers purpose, all parameters in detail, return values (even though an output schema exists), error conditions, dependencies, coordinate system conventions, and includes a working example. The Notes section adds crucial implementation details about JSON string requirements and measurement conventions.

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?

With 0% schema description coverage, the description fully compensates by providing comprehensive parameter documentation. Each parameter (geojson, distance, direction, options) gets detailed explanations including types, formats, constraints, examples, and for options, all sub-parameters with their valid values and defaults. This goes far beyond what the bare schema provides and gives the agent complete understanding of how to use each parameter correctly.

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 starts with a clear, specific statement: '平移 GeoJSON 对象' (translate GeoJSON objects). It specifies the exact method used ('Turf.js 库的 transformTranslate 方法') and the movement type ('沿恒向线移动' - move along a rhumb line). This clearly distinguishes it from other transformation tools like transformRotate or transformScale in the sibling list.

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

Usage Guidelines3/5

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

The description implies usage context through technical details (coordinate system, direction measurement, dependency on Turf.js/Node.js), but doesn't explicitly state when to use this tool versus alternatives. It doesn't provide comparative guidance against other transformation tools like transformRotate or buffer, nor does it mention prerequisites or typical use cases beyond the technical operation.

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