Skip to main content
Glama

Convert units

convert_units
Read-onlyIdempotent

Convert one cooking amount between units: within volume or weight exactly, or between volume and weight using a built-in density for flour, sugar, brown sugar, butter, water, milk, rice, oats, cocoa or honey. Use for questions like 'how many grams is 2 cups of flour'. Do NOT use to change serving counts (use scale_recipe).

Input Schema

NameRequiredDescriptionDefault
toYesUnit to convert to, e.g. 'g'; same supported units as from
fromYesUnit to convert from, e.g. 'cup'. Supported: tsp, tbsp, cup, fl_oz, ml, l, pint, quart, gallon (volume); g, kg, oz, lb (weight); each (count). Common spellings like 'cups', 'grams', 'tablespoon' also work
valueYesAmount to convert, zero or positive, e.g. 2
ingredientNoIngredient name, required only for volume <-> weight; must contain one of flour, sugar, brown sugar, butter, water, milk, rice, oats, cocoa, honey (e.g. 'all-purpose flour')

Output Schema

NameRequiredDescriptionDefault
toYesCanonical target unit, e.g. 'g'
fromYesCanonical source unit, e.g. 'cup'
valueYesAmount that was converted
methodYes'linear' for same-dimension, 'density' for volume <-> weight
resultYesConverted amount (4 significant digits)
displayYesReadable conversion, e.g. '2 cups flour = 250 g (approx.)'
density_noteNoDensity used (density method only)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed19 schema fields changed
    • changedInput schema / properties / from / description
      Previous value: -"Unit to convert from, e.g. cup"New value: +"Unit to convert from, e.g. 'cup'. Supported: tsp, tbsp, cup, fl_oz, ml, l, pint, quart, gallon (volume); g, kg, oz, lb (weight); each (count). Common spellings like 'cups', 'grams', 'tablespoon' also work"
    • changedInput schema / properties / ingredient / description
      Previous value: -"Ingredient name, needed for volume <-> weight, e.g. flour"New value: +"Ingredient name, required only for volume <-> weight; must contain one of flour, sugar, brown sugar, butter, water, milk, rice, oats, cocoa, honey (e.g. 'all-purpose flour')"
    • changedInput schema / properties / to / description
      Previous value: -"Unit to convert to, e.g. g"New value: +"Unit to convert to, e.g. 'g'; same supported units as from"
    • changedInput schema / properties / value / description
      Previous value: -"Amount to convert"New value: +"Amount to convert, zero or positive, e.g. 2"
    • addedInput schema / properties / value / minimum
      Added value: +0
    • removedOutput schema / properties / conversionFactor
      Removed value: -{
      -  "description": "The factor used to convert between the units",
      -  "type": "number"
      -}
    • removedOutput schema / properties / convertedValue
      Removed value: -{
      -  "description": "The converted amount in the target unit",
      -  "type": "number"
      -}
    • addedOutput schema / properties / density_note
      Added value: +{
      +  "description": "Density used (density method only)",
      +  "type": "string"
      +}
    • addedOutput schema / properties / display
      Added value: +{
      +  "description": "Readable conversion, e.g. '2 cups flour = 250 g (approx.)'",
      +  "type": "string"
      +}
    • removedOutput schema / properties / error
      Removed value: -{
      -  "description": "Error message if the conversion failed, e.g. unknown unit or ingredient",
      -  "type": "string"
      -}
    • addedOutput schema / properties / from
      Added value: +{
      +  "description": "Canonical source unit, e.g. 'cup'",
      +  "type": "string"
      +}
    • removedOutput schema / properties / fromUnit
      Removed value: -{
      -  "description": "The unit that was converted from",
      -  "type": "string"
      -}
    • removedOutput schema / properties / ingredient
      Removed value: -{
      -  "description": "The ingredient name used for volume-to-weight conversion, if applicable",
      -  "type": "string"
      -}
    • addedOutput schema / properties / method
      Added value: +{
      +  "description": "'linear' for same-dimension, 'density' for volume <-> weight",
      +  "enum": [
      +    "linear",
      +    "density"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / result
      Added value: +{
      +  "description": "Converted amount (4 significant digits)",
      +  "type": "number"
      +}
    • addedOutput schema / properties / to
      Added value: +{
      +  "description": "Canonical target unit, e.g. 'g'",
      +  "type": "string"
      +}
    • removedOutput schema / properties / toUnit
      Removed value: -{
      -  "description": "The unit that was converted to",
      -  "type": "string"
      -}
    • addedOutput schema / properties / value
      Added value: +{
      +  "description": "Amount that was converted",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "convertedValue",
      -  "fromUnit",
      -  "toUnit"
      -]New value: +[
      +  "value",
      +  "from",
      +  "to",
      +  "result",
      +  "display",
      +  "method"
      +]
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "conversionFactor": {
      +      "description": "The factor used to convert between the units",
      +      "type": "number"
      +    },
      +    "convertedValue": {
      +      "description": "The converted amount in the target unit",
      +      "type": "number"
      +    },
      +    "error": {
      +      "description": "Error message if the conversion failed, e.g. unknown unit or ingredient",
      +      "type": "string"
      +    },
      +    "fromUnit": {
      +      "description": "The unit that was converted from",
      +      "type": "string"
      +    },
      +    "ingredient": {
      +      "description": "The ingredient name used for volume-to-weight conversion, if applicable",
      +      "type": "string"
      +    },
      +    "toUnit": {
      +      "description": "The unit that was converted to",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "convertedValue",
      +    "fromUnit",
      +    "toUnit"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so safety is covered. The description adds genuinely useful behavioral context beyond that: cross-dimension conversion relies on a built-in density and is limited to a fixed ingredient list. It does not mention edge cases like unsupported ingredients or zero values, keeping it just short of a 5.

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?

Three tight sentences: purpose, an illustrative example, and a routing exclusion. Nothing is wasted and the core capability 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?

With annotations covering the safety profile, an output schema handling return values, and full param coverage in the schema, the description provides everything needed to select and invoke correctly. No material gaps remain.

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?

Schema description coverage is 100%, so the schema already documents all four parameters, including the ingredient list and supported units. The description restates the ingredient list and density behavior but adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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?

States a specific verb (convert) plus the resource (one cooking amount between units) and the exact scope (within volume/weight, or across via built-in density). It also names the sibling it is not (scale_recipe), so an agent can distinguish it without opening a schema.

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?

Gives an explicit positive trigger ('how many grams is 2 cups of flour') and an explicit exclusion with the alternative ('Do NOT use to change serving counts (use scale_recipe)'). The when/when-not/alternative triad is fully covered.

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