Skip to main content
Glama
es3154

Turf-MCP

by es3154

unit_conversion_toMercator

Convert geographic coordinates to Web Mercator projection coordinates for web mapping applications. Transforms WGS84 latitude/longitude coordinates into EPSG:3857 format used by Google Maps and OpenStreetMap.

Instructions

将地理坐标转换为墨卡托投影坐标。

此功能将WGS84地理坐标转换为Web墨卡托投影坐标(EPSG:3857)。

Args: geojson: GeoJSON对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}'

Returns: str: JSON 字符串格式的墨卡托投影 GeoJSON - 类型: 相同的 GeoJSON 类型,但坐标为墨卡托投影 - 格式: {"type": "Point", "coordinates": [x, y]} - 示例: '{"type": "Point", "coordinates": [-8385846.33, 4852834.51]}'

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

Example: >>> import asyncio >>> geojson = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> result = asyncio.run(toMercator(geojson)) >>> print(result) '{"type": "Point", "coordinates": [-8385846.33, 4852834.51]}'

Notes: - 输入坐标必须是WGS84地理坐标(经度/纬度) - 输出坐标为Web墨卡托投影坐标(EPSG:3857) - 常用于Web地图显示(如Google Maps、OpenStreetMap) - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geojsonYes
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 the tool's behavior: it converts coordinates, specifies input/output formats with examples, notes dependencies (Turf.js and Node.js), and lists error conditions (JavaScript execution failure, timeout, or bad input data). This covers key aspects like transformation logic, dependencies, and error handling.

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 parse. It is appropriately sized with no wasted sentences, though the inclusion of a Python code example might be slightly verbose for a general tool description, but it adds practical value.

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 (coordinate transformation), no annotations, and no output schema, the description is complete. It covers purpose, usage, parameters, return values, errors, examples, and technical notes (dependencies, coordinate systems). This provides all necessary context for an AI agent to use the tool correctly without relying on external structured data.

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 input schema has 0% description coverage, but the description fully compensates by detailing the 'geojson' parameter: it explains the type (string in JSON format), format (any valid GeoJSON object), and provides an example. This adds significant meaning beyond the bare schema, ensuring the agent understands the parameter's purpose and constraints.

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: converting geographic coordinates to Mercator projection coordinates. It specifies the input (WGS84 geographic coordinates) and output (Web Mercator projection coordinates, EPSG:3857), and distinguishes itself from sibling tools like 'unit_conversion_toWgs84' by focusing on projection conversion rather than coordinate system conversion.

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: for Web map display (e.g., Google Maps, OpenStreetMap). It implies usage by stating the tool's application, but does not explicitly mention when not to use it or name specific alternatives among siblings, such as other unit conversion tools like 'unit_conversion_convertLength'.

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