Skip to main content
Glama
es3154

Turf-MCP

by es3154

transformation_bboxClip

Clip GeoJSON features to a specified bounding box, retaining only portions within the defined geographic area for spatial data processing.

Instructions

将 GeoJSON 特征裁剪到指定的边界框内。

此功能将输入的 GeoJSON 特征(线或多边形)裁剪到给定的边界框范围内,只保留边界框内的部分。

Args: feature: GeoJSON 特征 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Feature 规范,支持 LineString、MultiLineString、Polygon、MultiPolygon - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]}}'

bbox: 边界框数组
    - 类型: str (JSON 字符串格式的数组)
    - 格式: [minX, minY, maxX, maxY]
    - 示例: '[0, 0, 10, 10]'

Returns: str: JSON 字符串格式的裁剪后的 GeoJSON 特征 - 类型: GeoJSON Feature with LineString, MultiLineString, Polygon, or MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [10, 8], [3, 7], [2, 2]]]}}'

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

Example: >>> import asyncio >>> feature = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]}}' >>> bbox = '[0, 0, 10, 10]' >>> result = asyncio.run(bboxClip(feature, bbox)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [10, 8], [3, 7], [2, 2]]]}}'

Notes: - 输入参数 feature 和 bbox 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 裁剪多边形时可能会产生退化边 - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureYes
bboxYes

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 does well: it discloses that the tool may produce degenerate edges when clipping polygons, depends on Turf.js and Node.js, and can raise exceptions for execution failures, timeouts, or input errors. It doesn't mention rate limits or auth needs, but covers key behavioral aspects adequately.

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), but could be more front-loaded; the core purpose is stated first, but details are extensive. Every sentence adds value, though it's slightly verbose due to comprehensive parameter documentation.

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 2 parameters, 0% schema coverage, no annotations, and an output schema exists, the description is highly complete. It covers input formats, output details, error conditions, dependencies, and examples, leaving no gaps for the agent to understand tool behavior and usage.

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 compensate fully. It adds extensive meaning: for 'feature', it specifies GeoJSON types, coordinate order, and provides an example; for 'bbox', it defines the array format and example. This goes far beyond the basic schema, making parameters clear and actionable.

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 'clip') and resources ('GeoJSON 特征' meaning 'GeoJSON feature'), specifying it works on lines or polygons. It distinguishes from siblings by focusing on bounding box clipping, unlike other transformation tools like buffer, simplify, or union.

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 usage context by specifying input types (GeoJSON features like LineString, Polygon) and coordinate system (WGS84), but does not explicitly state when to use this tool versus alternatives like 'transformation_mask' or 'transformation_intersect' from the sibling list. It provides prerequisites (valid JSON strings) but lacks explicit alternatives.

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