{
    "slug": "fraction-calculator",
    "name": "Fraction Calculator",
    "url": "https://directory.milunir.com/math-calculators/basic-math/fraction-calculator/",
    "description": "Add, subtract, multiply, divide or compare fractions and mixed numbers like 1 1/2, then see each step, the lowest-terms answer and its decimal.",
    "inputs": {
        "type": "object",
        "properties": {
            "mode": {
                "type": "string",
                "enum": [
                    "two",
                    "one"
                ],
                "description": "Mode",
                "default": "two"
            },
            "a": {
                "type": "string",
                "description": "First fraction. Type 3/4, a mixed number like 2 1/3, or a whole number.",
                "default": "1/2"
            },
            "op": {
                "type": "string",
                "enum": [
                    "add",
                    "sub",
                    "mul",
                    "div",
                    "cmp"
                ],
                "description": "Operation",
                "default": "add"
            },
            "b": {
                "type": "string",
                "description": "Second fraction",
                "default": "1/3"
            },
            "x": {
                "type": "string",
                "description": "Fraction. Type 8/12, a mixed number like 1 3/4, or a whole number.",
                "default": "8/12"
            },
            "action": {
                "type": "string",
                "enum": [
                    "simplify",
                    "mixed",
                    "reciprocal",
                    "equivalent"
                ],
                "description": "Show it as",
                "default": "simplify"
            }
        },
        "additionalProperties": false
    },
    "outputs": [
        {
            "key": "primary",
            "label": "Result"
        },
        {
            "key": "mixed",
            "label": "Other form"
        },
        {
            "key": "decimal",
            "label": "Decimal"
        }
    ],
    "modes": [
        {
            "id": "two",
            "label": "Two fractions",
            "inputs": [
                "a",
                "op",
                "b"
            ]
        },
        {
            "id": "one",
            "label": "One fraction",
            "inputs": [
                "x",
                "action"
            ]
        }
    ],
    "feed": null,
    "endpoint": "https://api.tools-directory.workers.dev/v1/tools/fraction-calculator",
    "mcp_tool": "fraction_calculator",
    "example": {
        "inputs": {
            "mode": "two",
            "a": "1/2",
            "op": "add",
            "b": "1/3"
        },
        "output": "Result: 5/6\nOther form: 5/6\nDecimal: 0.833333"
    }
}