Skip to main content
Glama
es3154

Turf-MCP

by es3154

feature_conversion_combine

Combine GeoJSON feature collections into composite geometries like MultiPoint, MultiLineString, or MultiPolygon for efficient geospatial data processing.

Instructions

将特征集合合并为复合几何图形。

此功能将点、线或多边形特征集合分别合并为多点、多线或多边形复合几何图形。

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

Returns: str: JSON 字符串格式的合并后 GeoJSON 特征集合 - 类型: GeoJSON FeatureCollection with MultiPoint, MultiLineString or MultiPolygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "...", "coordinates": [...]}}]}

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

Example: >>> import asyncio >>> fc = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [19.026432, 47.49134]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [19.074497, 47.509548]}}]}' >>> result = asyncio.run(combine(fc)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "MultiPoint", "coordinates": [[19.026432, 47.49134], [19.074497, 47.509548]]}}]}'

Notes: - 输入参数 feature_collection 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 点特征会合并为多点,线特征会合并为多线,多边形特征会合并为多多边形 - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feature_collectionYes

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. It discloses key behavioral traits: it specifies the coordinate system (WGS84 with longitude-first), notes dependencies on Turf.js and Node.js, and mentions error conditions (JavaScript execution failure, timeouts, input format errors). However, it doesn't detail performance aspects like rate limits or memory usage, which keeps it from a perfect score.

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), making it easy to parse. It's front-loaded with the core purpose. However, it includes some redundancy (e.g., repeating JSON format details) and could be slightly more concise without losing clarity, hence not a perfect 5.

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 (geometric operations), no annotations, and an output schema present, the description is highly complete. It covers input requirements, output format, error handling, dependencies, and provides a clear example. The output schema handles return value details, so the description doesn't need to reiterate them, making it appropriately comprehensive.

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 fully compensate. It provides extensive parameter semantics: defines 'feature_collection' as a JSON string in GeoJSON FeatureCollection format, specifies the coordinate system, gives an example, and notes validation requirements (must be valid JSON). This adds significant 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 starts with a clear, specific statement: '将特征集合合并为复合几何图形' (Combine feature collections into composite geometries). It distinguishes from siblings like 'feature_conversion_explode' (which does the opposite) and 'feature_conversion_flatten' by specifying it creates MultiPoint, MultiLineString, or MultiPolygon geometries from corresponding feature types. The purpose is unambiguous 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 Guidelines4/5

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

The description implies when to use it: for converting collections of points, lines, or polygons into their multi-geometry counterparts. It doesn't explicitly state when not to use it or name alternatives, but the context is clear from the tool's name and the sibling list (e.g., use 'feature_conversion_explode' for the reverse operation). This provides adequate guidance without being exhaustive.

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