Skip to main content
Glama
es3154

Turf-MCP

by es3154

unit_conversion_convertLength

Convert length values between units like meters, kilometers, miles, feet, and inches using standard conversion factors.

Instructions

转换长度单位。

此功能将长度值从一种单位转换为另一种单位。

Args: length: 长度值 - 类型: float - 描述: 要转换的长度数值 - 示例: 1000.0

original_unit: 原始单位
    - 类型: str
    - 描述: 输入长度的单位
    - 有效值: 'meters', 'metres', 'millimeters', 'millimetres', 'centimeters', 'centimetres', 'kilometers', 'kilometres', 'miles', 'nauticalmiles', 'inches', 'yards', 'feet'
    - 示例: 'meters'

final_unit: 目标单位
    - 类型: str
    - 描述: 输出长度的单位
    - 有效值: 'meters', 'metres', 'millimeters', 'millimetres', 'centimeters', 'centimetres', 'kilometers', 'kilometres', 'miles', 'nauticalmiles', 'inches', 'yards', 'feet'
    - 示例: 'kilometers'

Returns: str: JSON 字符串格式的长度结果 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 长度数值, "units": "目标单位"} - 示例: '{"value": 1.0, "units": "kilometers"}'

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

Example: >>> import asyncio >>> result = asyncio.run(convertLength(1000.0, 'meters', 'kilometers')) >>> print(result) '{"value": 1.0, "units": "kilometers"}'

Notes: - 支持多种长度单位之间的转换 - 输入和输出单位必须是有效的单位标识符 - 转换基于标准单位换算系数 - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lengthYes
original_unitYes
final_unitYes
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 and adds valuable behavioral context: it specifies the return format (JSON string with value and units), notes dependencies on Turf.js and Node.js, and mentions error cases (JavaScript execution failures, timeouts, input errors). However, it does not detail rate limits or authentication needs, which could be relevant for completeness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with sections (Args, Returns, Raises, Example, Notes), which aids readability, but it is verbose with redundant information (e.g., repeating unit lists). Some sentences could be condensed without losing clarity, making it less front-loaded and efficient than optimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, no annotations, no output schema, and 0% schema coverage, the description is quite complete: it covers purpose, parameters, return format, errors, examples, and dependencies. It lacks only minor details like exact error messages or performance limits, but overall provides sufficient context for effective use.

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 compensate fully. It does so by clearly explaining each parameter (length, original_unit, final_unit), including types, descriptions, valid values with enums, and examples. This adds significant meaning beyond the bare schema, making parameter usage unambiguous.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 as converting length units, specifying the action (convert) and resource (length values). It distinguishes itself from siblings like unit_conversion_convertArea by focusing on length, but does not explicitly differentiate from other length-related tools (e.g., measurement_length) beyond the title, which is slightly less specific than ideal for a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions valid units and dependencies but lacks explicit context, prerequisites, or comparisons to siblings like measurement_length or other unit conversion tools, leaving the agent without usage direction.

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