Skip to main content
Glama

Fraction Calculator

calculate_fraction_arithmetic
Read-onlyIdempotent

Use this when you need an exact result of an operation on two fractions (e.g. 3/4 + 1/6), including mixed numbers such as 1 1/2, rather than a rounded decimal. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.

Do not use this when you only want to reduce a single fraction or convert it to a decimal or percent (use fraction-simplifier), or you need the least common denominator of several denominators (use gcd-lcm). What it computes: Adds, subtracts, multiplies or divides two fractions, mixed numbers, whole numbers or decimals with exact integer arithmetic, returning the result in lowest terms, as a mixed number and as a decimal, with the intermediate steps. Inputs: fraction_a (string); fraction_b (string); operation (enum, optional). Complete JSON argument examples: {"fraction_a":"3/4","fraction_b":"1/6","operation":"add"} | {"fraction_a":"2 1/3","fraction_b":"5/6","operation":"subtract"} Outputs: result, mixed_number, numerator, denominator, decimal, working. Formula: a/b + c/d = (a·(L/b) + c·(L/d)) / L with L = lcm(b, d), a/b − c/d likewise; a/b × c/d = (a·c) / (b·d); a/b ÷ c/d = (a·d) / (b·c); the result is divided by gcd(numerator, denominator) Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/fraction-arithmetic with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/math/fraction-arithmetic.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationNoOperation applied as fraction_a (operation) fraction_b.add
fraction_aYesFirst operand: a fraction '3/4', a mixed number '1 1/2' or '-1 1/2', a whole number '5' or a decimal '0.75'.
fraction_bYesSecond operand in the same formats.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "fraction_a": "3/4",
      +    "fraction_b": "1/6",
      +    "operation": "add"
      +  },
      +  {
      +    "fraction_a": "2 1/3",
      +    "fraction_b": "5/6",
      +    "operation": "subtract"
      +  }
      +]
  2. Added
  3. Removed
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, it discloses exact integer arithmetic, lowest-term reduction, mixed-number and decimal outputs, intermediate steps, and a REST fallback. This materially helps the agent predict behavior and result format.

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

Conciseness4/5

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

The description is front-loaded and organized into labeled sections. It is slightly long because the formula and REST fallback go beyond what is required for basic invocation, though they are not irrelevant.

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?

With an output schema present, the description still covers usage boundaries, accepted operand forms, JSON examples, output fields, and a fallback path. No critical information needed to call the tool correctly is missing.

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?

The input schema already has 100% description coverage for all three parameters, including examples, defaults, and accepted formats. The description mostly restates the parameter names and adds a formula, which is useful context but not essential parameter semantics.

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?

The first sentence states a precise use case: exact arithmetic on two fractions or mixed numbers instead of a rounded decimal, and the description clarifies the four supported operations. This clearly distinguishes it from the many sibling calculator tools.

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

Usage Guidelines5/5

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

It gives explicit 'use this when' and 'do not use this when' conditions with named alternatives (fraction-simplifier, gcd-lcm) and instructs the agent to call the tool directly rather than compute from memory. This leaves little ambiguity about tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources