Skip to main content
Glama
es3154

Turf-MCP

by es3154

misc_line_split

Split GeoJSON line segments into multiple parts using a splitter geometry for spatial analysis and data processing in WGS84 coordinate system.

Instructions

用分割器将线段分割为多段。

此功能使用分割器几何图形将线段分割为多个部分,返回分割后的线段集合。

Args: line: 线 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[120, -25], [145, -25]]}'

splitter: 分割器 GeoJSON 特征
    - 类型: str (JSON 字符串格式的 GeoJSON)
    - 格式: 任何有效的 GeoJSON 特征
    - 坐标系: WGS84 (经度在前,纬度在后)
    - 示例: '{"type": "LineString", "coordinates": [[130, -15], [130, -35]]}'

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

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

Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[120, -25], [145, -25]]}' >>> splitter = '{"type": "LineString", "coordinates": [[130, -15], [130, -35]]}' >>> result = asyncio.run(line_split(line, splitter)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[120, -25], [130, -25]]}}, {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[130, -25], [145, -25]]}}]}'

Notes: - 输入参数 line 和 splitter 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 使用分割器将线段分割为多个部分 - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYes
splitterYes

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 behaviors: the tool performs a geometric operation (splitting), returns a FeatureCollection of LineString features, specifies coordinate system (WGS84), and notes dependencies (Turf.js and Node.js). It also mentions error conditions (JavaScript execution failures, timeouts, input format errors). While comprehensive, it could improve by detailing performance aspects or side effects 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 clear sections (Args, Returns, Raises, Example, Notes), making it easy to parse. It is appropriately sized, with each sentence adding necessary information (e.g., coordinate order, dependencies). However, some redundancy exists (e.g., repeating coordinate system info), and it could be slightly more front-loaded by emphasizing the core purpose earlier without sacrificing clarity.

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 geometric splitting operation with no annotations, 0% schema coverage, and an output schema present, the description is highly complete. It covers purpose, parameters, return values, error handling, examples, and technical notes (e.g., JSON format, coordinate system, dependencies). The output schema handles return structure, so the description focuses on operational context, leaving no significant gaps for the agent to understand and use the tool effectively.

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: 'line' and 'splitter'. For each, it specifies the type (JSON string), format (GeoJSON LineString for line, any valid GeoJSON feature for splitter), coordinate system (WGS84 with longitude-first), and includes examples. This adds significant value beyond the minimal schema, ensuring the agent understands parameter requirements thoroughly.

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: '用分割器将线段分割为多段' (split a line segment into multiple parts using a splitter). It specifies the exact operation (splitting), the resource (line segment), and the method (using a splitter geometry). Among siblings like misc_line_slice or misc_line_segment, this tool is distinguished by its focus on geometric splitting with a separate splitter feature.

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: when you need to split a line segment into multiple parts using a geometric splitter. However, it does not explicitly state when not to use it or name specific alternatives among siblings (e.g., misc_line_slice for slicing along a line, misc_line_segment for creating segments). The usage is implied but lacks explicit exclusions or comparisons.

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