Skip to main content
Glama

convert

Read-onlyIdempotent

Run before putting any token amount into a transaction. "5 USDC" is 5,000,000 raw units; wrong decimals send 1,000x too much or too little. Converts between normal amounts and raw units using the token's real on-chain decimals. Inputs: token: The token, or "SOL" for SOL (9 decimals). amount: The amount to convert, as a string, e.g. "5" or "0.25". to (optional): Which way to convert. "raw" turns 5 into 5000000 (for transactions). "readable" turns raw units back into a normal amount. Default "raw". network (optional): Which Solana network to read. Default "mainnet-beta" (real money). Cost: 25 free calls a day, then $0.01 USDC per call (x402). Full field-by-field docs: GET /api/tools/convert.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoWhich way to convert. "raw" turns 5 into 5000000 (for transactions). "readable" turns raw units back into a normal amount. Default "raw". "raw" before building a transaction, "readable" when reading raw amounts.raw
tokenYesThe token, or "SOL" for SOL (9 decimals). From find_token or tokens.
amountYesThe amount to convert, as a string, e.g. "5" or "0.25". The amount the user asked for. A string avoids rounding errors.
networkNoWhich Solana network to read. Default "mainnet-beta" (real money). Leave it out for mainnet. Use "devnet" only for test wallets.mainnet-beta

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / amount / description
      Added value: +"The amount to convert, as a string, e.g. \"5\" or \"0.25\". The amount the user asked for. A string avoids rounding errors."
    • addedInput schema / properties / network / description
      Added value: +"Which Solana network to read. Default \"mainnet-beta\" (real money). Leave it out for mainnet. Use \"devnet\" only for test wallets."
    • addedInput schema / properties / to / description
      Added value: +"Which way to convert. \"raw\" turns 5 into 5000000 (for transactions). \"readable\" turns raw units back into a normal amount. Default \"raw\". \"raw\" before building a transaction, \"readable\" when reading raw amounts."
    • addedInput schema / properties / token / description
      Added value: +"The token, or \"SOL\" for SOL (9 decimals). From find_token or tokens."
  2. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds genuinely new behavioral context: a rate limit and price model (25 free calls/day, then $0.01 USDC per call via x402), which network is read by default ('mainnet-beta (real money)'), and the concrete consequence of misuse. None of that is derivable from the structured fields.

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?

Well front-loaded: the safety warning and the decimal-scaling example lead, with inputs and cost trailing. It is efficient for the amount of information conveyed, though the Inputs block duplicates schema text and the trailing full-docs URL is marginal.

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?

No output schema exists, and the description only implicitly conveys the return value via the '5 turns into 5000000' example rather than stating the shape explicitly. Everything else an agent needs — direction, defaults, network selection, quota/cost — is present for a 4-parameter read-only tool.

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 baseline is 3. The Inputs section largely restates the schema descriptions, and it omits the two enum aliases the schema accepts ('to_base_units', 'to_ui'), so it adds no meaning beyond what the schema already provides.

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: converts between normal token amounts and raw on-chain units using the token's real decimals. It also distinguishes itself from the sibling set by pointing at find_token as the source of the token identifier, so an agent can tell this apart from balance/tokens lookups.

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?

The first sentence gives an explicit trigger condition ('Run before putting any token amount into a transaction'), and the 'to' guidance pins each branch to a situation: 'raw' before building a transaction, 'readable' when reading raw amounts. The failure mode (1,000x too much or too little from wrong decimals) makes the when-not implicit but vivid.

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.