Skip to main content
Glama
es3154

Turf-MCP

by es3154

transformation_concave

Calculate concave hulls from point sets to define irregular boundaries in geospatial data analysis. This tool processes GeoJSON point collections and generates polygon shapes that capture the outer edges of clustered points.

Instructions

计算点集的凹包。

该函数使用 Turf.js 库的 concave 方法,从一组点生成凹包多边形。

Args: points: 点集 GeoJSON FeatureCollection - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范,包含 Point 特征 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-63.601226, 44.642643]}}, ...]}'

options: 可选参数配置
    - 类型: str (JSON 字符串) 或 None
    - 可选字段:
        - maxEdge: 凹包边缘的最大长度 (默认: Infinity)
        - units: 距离单位 (默认: 'kilometers')
            - 有效值: 'miles', 'nauticalmiles', 'kilometers', 'meters', 'yards', 'feet', 'inches'
    - 示例: '{"maxEdge": 1, "units": "miles"}'

Returns: str: JSON 字符串格式的凹包 GeoJSON Polygon 或 MultiPolygon 特征 - 类型: GeoJSON Feature with Polygon or MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} 或 null(如果无法计算) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-63.6, 44.64], [-63.59, 44.65], ...]]}}'

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

Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-63.601226, 44.642643]}}]}' >>> options = '{"maxEdge": 1, "units": "miles"}' >>> result = asyncio.run(concave(points, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-63.6, 44.64], [-63.59, 44.65], ...]]}}'

Notes: - 输入参数 points 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 内部使用 turf-tin 生成几何图形 - 如果无法计算凹包,返回 null - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pointsYes
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: it discloses that the tool returns null if concave hull cannot be computed, depends on Turf.js and Node.js, raises exceptions on failures, and notes internal use of turf-tin. This goes beyond basic functionality, though it could mention performance or limitations more explicitly.

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 (Args, Returns, Raises, Example, Notes), front-loading the purpose. It is appropriately sized but could be slightly more concise by reducing redundancy in examples or notes, though every sentence adds value for clarity and usability.

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 (geometric computation), no annotations, and an output schema present, the description is highly complete: it covers purpose, parameters, return values, errors, examples, and dependencies. The output schema handles return format, so the description focuses on behavioral and usage aspects, leaving no significant gaps.

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 compensates fully by detailing both parameters: 'points' as a GeoJSON FeatureCollection string with format, coordinate system, and examples, and 'options' as a JSON string with fields like maxEdge and units, including valid values and defaults. This adds comprehensive meaning beyond the bare 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: '计算点集的凹包' (computes concave hull of point sets) and specifies it uses Turf.js's concave method. It distinguishes from sibling tools like 'transformation_convex' by focusing on concave hulls, making the verb+resource specific and differentiated.

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 generating concave hulls from point sets but does not explicitly state when to use this tool versus alternatives like 'transformation_convex' or other geometric tools. It provides context on input requirements but lacks explicit guidance on tool selection among siblings.

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