Skip to main content
Glama
zazencodes

Unit Converter MCP

by zazencodes

convert_force

Convert force measurements between units like newtons, pounds force, kips, and dynes for engineering or physics calculations.

Instructions

Convert force between units.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesForce value to convert
from_unitYesSource unit
to_unitYesTarget unit

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that performs force unit conversion by converting input to Newtons as an intermediate unit and then to the target unit.
    def convert_force_tool(
        value: float,
        from_unit: FORCE_UNIT,
        to_unit: FORCE_UNIT,
    ) -> float:
        """Convert force between units."""
    
        # Convert to newtons first
        to_newtons = {
            "dynes": 1e-05,
            "kilograms force": 9.80665,
            "kilonewtons": 1_000.0,
            "kips": 4_448.222,
            "meganewtons": 1_000_000.0,
            "newtons": 1.0,
            "pounds force": 4.44822161526,
            "tonnes force": 9_806.65,
            "long tons force": 9_964.01641818352,
            "short tons force": 8_896.443230521,
        }
    
        newtons = value * to_newtons[from_unit]
        return newtons / to_newtons[to_unit]
  • Type definition for supported force units using Literal, used for input validation.
    FORCE_UNIT = Literal[
        "dynes",
        "kilograms force",
        "kilonewtons",
        "kips",
        "meganewtons",
        "newtons",
        "pounds force",
        "tonnes force",
        "long tons force",
        "short tons force",
    ]
  • MCP tool registration for 'convert_force' using FastMCP's @app.tool() decorator, which wraps the core handler and returns a formatted response dictionary.
    @app.tool()
    def convert_force(
        value: Annotated[float, Field(description="Force value to convert")],
        from_unit: Annotated[FORCE_UNIT, Field(description="Source unit")],
        to_unit: Annotated[FORCE_UNIT, Field(description="Target unit")],
    ) -> dict:
        """Convert force between units."""
        converted_value = convert_force_tool(value, from_unit, to_unit)
        return {
            "original_value": value,
            "original_unit": from_unit,
            "converted_value": converted_value,
            "converted_unit": to_unit,
            "conversion_type": "force",
        }
Behavior2/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 states the tool converts force between units but doesn't describe what happens during conversion (e.g., precision, rounding, error handling for invalid inputs), the output format, or any performance considerations. This leaves significant gaps in understanding how the tool behaves.

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

Conciseness5/5

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

The description is extremely concise—a single sentence that directly states the tool's purpose without any fluff. It's front-loaded and wastes no words, making it easy to parse quickly.

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

Completeness3/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 (unit conversion with multiple enum options) and the presence of an output schema (which handles return values), the description is minimally adequate. However, it lacks context about behavioral traits, usage guidelines, and error handling, which are important for a conversion tool. The high schema coverage helps but doesn't fully compensate for these gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters (value, from_unit, to_unit) with descriptions and enum values. The description adds no additional parameter semantics beyond what's in the schema, such as examples, constraints, or unit compatibility notes. This meets the baseline for high schema coverage.

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: converting force between units. It specifies the resource (force) and the action (convert between units), which distinguishes it from siblings that convert other physical quantities. However, it doesn't explicitly mention the specific unit options available, which are detailed in the schema.

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 doesn't mention sibling tools like convert_batch for batch conversions or list_supported_units for checking available units. There's no context about prerequisites, error handling, or typical use cases.

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/zazencodes/unit-converter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server