Skip to main content
Glama
es3154

Turf-MCP

by es3154

coordinate_mutation_clean_coords

Remove redundant coordinate points from GeoJSON data to simplify geometries and clean spatial datasets by eliminating consecutive duplicates.

Instructions

清理 GeoJSON 数据中的冗余坐标点。

此功能自动移除连续的重复坐标点,简化几何图形,使数据更加整洁。

Args: geojson: GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]}'

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

Returns: str: JSON 字符串格式的清理后的 GeoJSON 特征或几何图形 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 清理冗余坐标后的 GeoJSON - 示例: '{"type": "LineString", "coordinates": [[0, 0], [0, 10]]}'

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

Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]}' >>> result = asyncio.run(clean_coords(line)) >>> print(result) '{"type": "LineString", "coordinates": [[0, 0], [0, 10]]}'

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 full burden and adds significant behavioral context beyond the input schema. It discloses that the tool removes consecutive duplicate coordinates, simplifies geometries, depends on Turf.js and Node.js, and can raise exceptions for execution failures, timeouts, or bad input. It also notes coordinate order and JSON string requirements, though it could mention performance or rate limits.

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 sections for Args, Returns, Raises, Example, and Notes, making it easy to navigate. It is appropriately sized but could be more concise by integrating some details (e.g., coordinate order) into the Args section. Every sentence adds value, though minor redundancies exist.

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 complexity of a mutation tool with no annotations, 2 parameters, and an output schema, the description is highly complete. It covers purpose, parameters, returns, errors, examples, and dependencies. The output schema exists, so the description needn't explain return values in detail, and it provides sufficient context for effective tool use.

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?

The schema description coverage is 0%, so the description must compensate, which it does effectively. 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 like 'mutate', and an example. This adds substantial meaning beyond the basic schema.

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 with specific verbs ('清理' meaning 'clean', '移除' meaning 'remove', '简化' meaning 'simplify') and resource ('GeoJSON 数据中的冗余坐标点' meaning 'redundant coordinate points in GeoJSON data'). It distinguishes from siblings like 'coordinate_mutation_flip' or 'coordinate_mutation_round_number' by focusing on coordinate deduplication and simplification rather than transformation or rounding.

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 for cleaning redundant coordinates in GeoJSON data, but does not explicitly state when to use this tool versus alternatives like 'transformation_simplify' (which might simplify geometry differently) or other coordinate mutation tools. It provides context about removing consecutive duplicate points, but lacks explicit guidance on exclusions or comparisons with sibling tools.

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