Skip to main content
Glama
IBM

Physics MCP Server

by IBM

list_unit_conversions

Retrieve all supported unit categories and their units for physics calculations, including velocity, distance, mass, force, energy, power, temperature, angle, pressure, area, and volume.

Instructions

List all supported unit conversions.

Returns a dictionary mapping category names to lists of supported units.

Returns:
    Dictionary with supported unit categories:
    - velocity: Speed units
    - distance: Length units
    - mass: Weight units
    - force: Force units
    - energy: Energy units
    - power: Power units
    - temperature: Temperature scales
    - angle: Angular units
    - pressure: Pressure units
    - area: Area units
    - volume: Volume units

Example:
    >>> list_unit_conversions()
    {
        "velocity": ["m/s", "km/h", "mph", "ft/s", "knots"],
        "distance": ["m", "km", "mi", "ft", "yd", "in"],
        "mass": ["kg", "g", "lb", "oz"],
        ...
    }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'list_unit_conversions' function that implements the tool logic. It is decorated with @tool(), calls get_supported_units() to get category data, adds example conversions, and returns a dict with 'categories', 'examples', and 'total_conversions'.
    @tool()
    def list_unit_conversions() -> dict:
        """
        List all supported unit conversions.
    
        Returns a dictionary mapping category names to lists of supported units.
    
        Returns:
            Dictionary with supported unit categories:
            - velocity: Speed units
            - distance: Length units
            - mass: Weight units
            - force: Force units
            - energy: Energy units
            - power: Power units
            - temperature: Temperature scales
            - angle: Angular units
            - pressure: Pressure units
            - area: Area units
            - volume: Volume units
    
        Example:
            >>> list_unit_conversions()
            {
                "velocity": ["m/s", "km/h", "mph", "ft/s", "knots"],
                "distance": ["m", "km", "mi", "ft", "yd", "in"],
                "mass": ["kg", "g", "lb", "oz"],
                ...
            }
        """
        units = get_supported_units()
    
        # Add examples for each category
        examples = {
            "velocity": "100 m/s = 223.69 mph",
            "distance": "1 km = 0.621 mi",
            "mass": "1 kg = 2.205 lb",
            "force": "100 N = 22.48 lbf",
            "energy": "1000 J = 1 kJ = 0.239 kcal",
            "power": "1000 W = 1 kW = 1.341 hp",
            "temperature": "0 C = 32 F = 273.15 K",
            "angle": "180 deg = π rad",
            "pressure": "101325 Pa = 1 atm = 14.7 psi",
            "area": "1 acre = 4046.86 m²",
            "volume": "1 m³ = 1000 L = 264.17 gal",
        }
    
        return {
            "categories": units,
            "examples": examples,
            "total_conversions": sum(len(v) for v in units.values()),
        }
  • The @tool() decorator from chuk_mcp_server that registers list_unit_conversions as an MCP tool. The tool module is imported in server.py (line 49) to register all @tool-decorated functions.
    from chuk_mcp_server import tool
    from ..units import convert_units, get_supported_units
  • The server imports the convert_units module (aliased as unit_conversion_tools) to trigger registration of all @tool-decorated functions, including list_unit_conversions.
    from .tools import (
        basic,
        rotational,
        oscillations,
        circular_motion,
        collisions,
        conservation,
        fluid as fluid_tools,
        kinematics_tools,
        statics,
        convert_units as unit_conversion_tools,
    )
  • The get_supported_units() helper function called by list_unit_conversions to retrieve the dictionary of unit categories and their supported units.
    def get_supported_units() -> dict[str, list[str]]:
        """
        Get a dictionary of supported unit categories and their units.
    
        Returns:
            Dictionary mapping category names to lists of supported units
        """
        return {
            "velocity": ["m/s", "km/h", "mph", "ft/s", "knots"],
            "distance": ["m", "km", "mi", "ft", "yd", "in"],
            "mass": ["kg", "g", "lb", "oz"],
            "force": ["N", "kN", "lbf"],
            "energy": ["J", "kJ", "cal", "BTU", "kWh"],
            "power": ["W", "kW", "hp"],
            "temperature": ["K", "C", "F"],
            "angle": ["rad", "deg"],
            "pressure": ["Pa", "kPa", "bar", "psi", "atm"],
            "area": ["m²", "km²", "ft²", "acre"],
            "volume": ["m³", "L", "gal", "ft³"],
            "time": ["s", "min", "hr", "day"],
            "acceleration": ["m/s²", "g", "ft/s²"],
            "torque": ["N·m", "lb·ft", "lb·in"],
            "frequency": ["Hz", "kHz", "MHz", "GHz"],
            "data_size": ["B", "KB", "MB", "GB"],
        }
  • Test for list_unit_conversions that validates the returned dict has the expected keys and all 16 category entries.
    def test_list_unit_conversions(self):
        from chuk_mcp_physics.tools.convert_units import list_unit_conversions
    
        result = list_unit_conversions()
        assert "categories" in result
        assert "examples" in result
        assert "total_conversions" in result
    
        # Check that all expected categories are present
        categories = result["categories"]
        assert "velocity" in categories
        assert "distance" in categories
        assert "mass" in categories
        assert "force" in categories
        assert "energy" in categories
        assert "power" in categories
        assert "temperature" in categories
        assert "angle" in categories
        assert "pressure" in categories
        assert "area" in categories
        assert "volume" in categories
        assert "time" in categories
        assert "acceleration" in categories
        assert "torque" in categories
        assert "frequency" in categories
        assert "data_size" in categories
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, but description fully discloses that it returns a dictionary mapping categories to unit lists. No side effects or destructive behavior is mentioned, which is acceptable for a read-only listing tool.

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?

Description is concise, well-structured with bullet points and an example. Every sentence earns its place, and the key information is front-loaded.

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 zero parameters and no output schema, the description completely explains the return format and content with an example. No gaps remain.

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

Parameters4/5

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

No parameters in schema; baseline score of 4 applies. Description adds value by detailing the return structure and example, which compensates for lack of parameters.

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?

Description clearly states 'List all supported unit conversions' with a specific verb and resource. It distinguishes itself from sibling tool 'convert_unit' by providing the list of available units.

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?

Description implies usage as a precursor to conversion, but does not explicitly state when to use it or when not to use it. It is clear that it serves as a reference for available units.

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/IBM/chuk-mcp-physics'

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