Skip to main content
Glama

Comparar precios por unidad

unit-price-compare
Read-onlyIdempotent

Ordena ofertas por precio por unidad (kg, litro o unidad), convirtiendo g/kg/lb/oz y ml/l/fl_oz. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: aplicar descuentos porcentuales o fijos a un precio (discount-calculate). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Ranks product offers by price per unit (per kg, per liter or per item), converting g/kg/lb/oz and ml/l/fl_oz, to find the best value. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: applying percentage or fixed discounts to a price (discount-calculate). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
offersYesOffers (array of object; required; at least 1 items; up to 500 items).

Output Schema

NameRequiredDescriptionDefault
bestNo
rankingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / offers / examples
      Added value: +[
      +  [
      +    {
      +      "name": "A",
      +      "price": 5000,
      +      "quantity": 500,
      +      "unit": "g"
      +    },
      +    {
      +      "name": "B",
      +      "price": 9000,
      +      "quantity": 1,
      +      "unit": "kg"
      +    }
      +  ]
      +]
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, and closed-world behavior. The description adds useful details beyond annotations: input/output size limits, a 1-second per-call limit, and determinism. It does not, however, explain rounding or tie-breaking behavior, which could matter for 'exact' financial math.

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 with the core purpose and uses clear labels for usage, exclusions, side effects, and limits. It is somewhat verbose due to bilingual repetition (Spanish and English say the same thing), but the structure is logical and every section carries useful information.

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?

Given the presence of an output schema and comprehensive annotations, the description provides the key missing context: usage conditions, an explicit alternative, side-effect confirmation, limits, and determinism. It leaves a small gap around sorting direction and tie-breaking, but overall it is complete enough for an agent to invoke the tool correctly.

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 the offers array and its properties. The description adds only marginal meaning, repeating unit types already in the enum and not explaining how the offers are ranked or how price-per-unit is computed. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Ranks') and resource ('product offers by price per unit'), including the conversion logic for different units. It explicitly distinguishes itself from the discount-calculate sibling in the 'Not for' clause, so an agent can tell them apart without checking schemas.

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

Usage Guidelines4/5

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

It provides a 'When' condition and a 'Not for' clause with a named alternative, which is strong. However, the 'When' description ('a money, tax or financial-math result has to be exact and reproducible') is somewhat generic and not specifically tailored to unit-price comparison, so an agent might not immediately see that the primary use case is ranking offers by unit price.

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