Skip to main content
Glama

Fraction calculator

hopi_fraction_calculator
Read-onlyIdempotent

Add, subtract, multiply or divide two fractions, giving the simplified result, a mixed number where relevant, and the decimal value. Each fraction is a numerator over a denominator, all whole numbers (numerators may be negative). Source: https://hopi.co.uk/fraction-calculator/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
d1YesFirst denominator (not zero)
d2YesSecond denominator (not zero)
n1YesFirst numerator
n2YesSecond numerator
opYesOperation: add, sub (subtract), mul (multiply) or div (divide)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYes
mixedYes
resultYes
decimalYes
summaryYes
numeratorYes
source_urlYesThe tool's page on hopi.co.uk (cite or open to check the figure)
denominatorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / mixed / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / required
      Added value: +[
      +  "decimal",
      +  "denominator",
      +  "mixed",
      +  "numerator",
      +  "op",
      +  "result",
      +  "source_url",
      +  "summary"
      +]
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the description adds value by detailing the result composition: simplified fraction, mixed number where relevant, and decimal value. It also clarifies input constraints like whole numbers and negative numerators, which is useful context beyond the annotations.

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 two sentences with no filler. The first sentence front-loads the operations and outputs, the second states the input format and source. Every clause earns its place.

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

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a calculator with an output schema and safe, read-only annotations, the description covers the operations, expected outputs, and input constraints. The phrase 'where relevant' leaves the mixed-number condition slightly vague, but overall the tool is sufficiently described for correct invocation.

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 covers all five parameters with descriptions, including the op enum and non-zero denominators, so the baseline is 3. The description adds only minor extra meaning (whole numbers, negative numerators) that is largely implied by the integer types, and does not significantly compensate for any gap.

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 description states a specific verb and resource: add, subtract, multiply or divide two fractions, and specifies the results (simplified, mixed number, decimal). This clearly distinguishes it from sibling tools like hopi_fraction_to_decimal, which performs conversion rather than arithmetic.

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

Usage Guidelines3/5

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

The description implies use for fraction arithmetic by stating the exact operations, but it does not explicitly mention when to choose this tool over alternatives such as hopi_fraction_to_decimal or hopi_scientific_calculator. No exclusions or alternative routing are provided, leaving the agent to infer the appropriate context.

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