Skip to main content
Glama

Monto de token ↔ unidades base

token-units-convert
Read-onlyIdempotent

Convierte montos de tokens entre decimal y unidades base enteras de forma exacta (USDC 6 decimales, ETH 18…), como en x402. Cuándo: un flujo de agente necesita un resultado exacto y repetible para un paso auxiliar (tokens, costos, reintentos, fragmentos, ranking, limpieza de JSON). No para: estimar el costo de llamadas a un LLM a partir de tokens (llm-cost-estimate). 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: Converts a token amount between decimal and integer base units exactly (BigInt), e.g. USDC (6 decimals) 1.5 ↔ 1500000, ETH (18) or any decimals 0-36, as used in x402 payment requirements. When: an agent loop needs an exact, repeatable result for a bookkeeping step (tokens, costs, retries, chunking, ranking, JSON clean-up). [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
amountNoDecimal amount (to base units) (string; optional; up to 80 chars).
decimalsNoToken decimals (USDC = 6) (integer; optional; default 6; min 0; max 36).
base_unitsNoInteger base units (to decimal) (string; optional; pattern ^\d{1,80}$).

Output Schema

NameRequiredDescriptionDefault
amountNo
decimalsNo
base_unitsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Converts a token amount between decimal and integer base units exactly (BigInt), e.g. USDC (6 decimals) 1.5 ↔ 1500000, ETH (18) or any decimals 0-36, as used in x402 payment requirements. When: an agent loop needs an exact, repeatable result for a bookkeeping step (tokens, costs, retries, chunking, ranking, JSON clean-up). Not for: estimating LLM request cost from input/output token counts (llm-cost-estimate). 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."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the 'no side effects / deterministic' sentences largely restate them. The description does add genuinely new operational context, though: 64 KB input limit, 1 s per call, 1 MB result cap, and BigInt exactness — limits that annotations cannot express.

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

Conciseness3/5

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

Well organized with labeled clauses (Cuándo / No para / Efectos / Límites), but the full Spanish text followed by a near-verbatim full English text (and the same EN text again in inputSchema.description) triples the same content. The useful content could be half the length without losing 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?

Output schema exists and annotations are rich, so return values and safety need no explanation; the description covers purpose, the alternative, limits and determinism. It is only incomplete on direction selection between amount and base_units and on error behavior for invalid/mismatched input (e.g. decimals exceeding the amount's precision).

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 coverage is 100% and each parameter already carries a description, so the schema does the heavy lifting. The description's 1.5 ↔ 1500000 example adds directional intuition, but it never explains the key ambiguity: amount (to base units) and base_units (to decimal) are mutually exclusive directions and all three params are optional, so which one drives the operation is still unstated.

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 and resource with concrete examples: converts token amounts between decimal and integer base units exactly (BigInt), USDC 6 decimals 1.5 ↔ 1500000, ETH 18, any decimals 0-36, in x402 context. This also disambiguates 'token' from LLM tokens, which is the main confusion risk among the siblings.

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?

Explicitly structured as 'Cuándo' (exact, repeatable bookkeeping steps) and 'No para' (estimating LLM call cost), naming the alternative tool llm-cost-estimate. The when/when-not split is exactly what an agent needs to route correctly.

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