Skip to main content
Glama

convert_amount

Convert token amounts between human-readable and smallest-unit values such as wei, lamports, or satoshis. Use before bridge and swap tools that require precise smallest-unit amounts.

Instructions

Convert between human-readable token amounts and smallest-unit values (wei, lamports, satoshis).

Use this before calling quote/bridge/swap tools which require amounts in smallest units.

Examples:

  • 1.5 ETH (18 decimals) → "1500000000000000000"

  • 100 USDC (6 decimals) → "100000000"

  • 0.001 BTC (8 decimals) → "100000"

  • "1000000000000000000" → 1.0 (18 decimals)

Common decimals: ETH/WETH = 18, USDC/USDT = 6, BTC = 8, SOL = 9. Use get_supported_tokens or get_token_details to look up decimals for other tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesThe amount to convert. Can be human-readable ("1.5") or smallest-unit ("1500000000000000000").
decimalsYesToken decimals. Common values: ETH=18, USDC=6, BTC=8, SOL=9.
directionYes"toSmallestUnit": human → wei/lamports/satoshis. "toHuman": wei/lamports/satoshis → human-readable.
Behavior4/5

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

While no annotations are provided, the description implies a pure conversion without side effects through examples and context. It doesn't explicitly state it's read-only or local, but the nature is clear.

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?

Description is concise, front-loaded with purpose, then usage guidelines, examples, and common decimals. Every sentence is informative and necessary.

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

Completeness3/5

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

Without an output schema, the description does not explicitly define the return format or structure. Examples imply the output format, but lacking explicit specification for a tool this simple is acceptable but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers all parameters with 100% description coverage. The tool description adds value by showing example formats and common decimals, enhancing understanding beyond the schema.

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 clearly states the tool converts between human-readable token amounts and smallest-unit values, with specific examples and common decimals. It distinguishes itself from sibling tools, none of which perform conversion.

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 says to use this before quote/bridge/swap tools that require smallest units, providing clear when-to-use guidance. No alternatives needed given its unique purpose.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pedromcunha/relay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server