{
    "slug": "length-converter",
    "name": "Length Converter",
    "url": "https://directory.milunir.com/unit-converters/common-converters/length-converter/",
    "description": "Convert lengths between 12 metric, imperial and astronomical units, or turn a height in feet and inches into centimeters, with exact factors.",
    "inputs": {
        "type": "object",
        "properties": {
            "mode": {
                "type": "string",
                "enum": [
                    "units",
                    "height"
                ],
                "description": "Mode",
                "default": "units"
            },
            "value": {
                "type": "number",
                "minimum": 0,
                "description": "Length",
                "default": 1
            },
            "from": {
                "type": "string",
                "enum": [
                    "mm",
                    "cm",
                    "m",
                    "km",
                    "in",
                    "ft",
                    "yd",
                    "mi",
                    "nmi",
                    "um",
                    "mil",
                    "ly"
                ],
                "description": "From",
                "default": "m"
            },
            "to": {
                "type": "string",
                "enum": [
                    "mm",
                    "cm",
                    "m",
                    "km",
                    "in",
                    "ft",
                    "yd",
                    "mi",
                    "nmi",
                    "um",
                    "mil",
                    "ly"
                ],
                "description": "To",
                "default": "ft"
            },
            "feet": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9,
                "description": "Feet (ft)",
                "default": 5
            },
            "inches": {
                "type": "number",
                "minimum": 0,
                "maximum": 11.99,
                "description": "Inches (in)",
                "default": 9
            }
        },
        "additionalProperties": false
    },
    "outputs": [
        {
            "key": "primary",
            "label": "Converted length"
        },
        {
            "key": "meters",
            "label": "In meters"
        },
        {
            "key": "factor",
            "label": "Conversion factor"
        }
    ],
    "modes": [
        {
            "id": "units",
            "label": "Unit to unit",
            "inputs": [
                "value",
                "from",
                "to"
            ]
        },
        {
            "id": "height",
            "label": "Feet and inches",
            "inputs": [
                "feet",
                "inches"
            ]
        }
    ],
    "feed": null,
    "endpoint": "https://api.tools-directory.workers.dev/v1/tools/length-converter",
    "mcp_tool": "length_converter",
    "example": {
        "inputs": {
            "mode": "units",
            "value": 1,
            "from": "in",
            "to": "cm"
        },
        "output": "Converted length: 2.54 cm\nIn meters: 0.0254 m\nConversion factor: 1 in = 2.54 cm"
    }
}