Skip to main content
Glama

convert

Read-onlyIdempotent

Run before putting any token amount in 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 with the token's real on-chain decimals. Example: {"token": "SOL", "amount": "0.5"} gives 500000000. Cost: 25 free calls a day, then $0.01 USDC per call (x402). Outputs explained: GET /api/tools/convert.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "token": "<token>",
      "amount": "<amount>"
    },
    "name": "convert"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoDirection. "raw" turns 5 into 5000000 (for transactions); "readable" turns raw units back. Default "raw". "readable" for amounts read from chain data.raw
tokenYesThe token, or "SOL" for SOL (9 decimals). From find_token or tokens.
amountYesThe amount, as a string: "5" or "0.25". The user's amount. A string avoids rounding errors.
networkNoDefault "mainnet-beta" (real money). "devnet" only for test wallets.mainnet-beta

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / amount / description
      Previous 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."New value: +"The amount, as a string: \"5\" or \"0.25\". The user's amount. A string avoids rounding errors."
    • changedInput schema / properties / network / description
      Previous value: -"Which Solana network to read. Default \"mainnet-beta\" (real money). Leave it out for mainnet. Use \"devnet\" only for test wallets."New value: +"Default \"mainnet-beta\" (real money). \"devnet\" only for test wallets."
    • changedInput schema / properties / to / description
      Previous 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."New value: +"Direction. \"raw\" turns 5 into 5000000 (for transactions); \"readable\" turns raw units back. Default \"raw\". \"readable\" for amounts read from chain data."
  2. 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."
  3. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so safety is covered. The description adds genuinely new operational context: rate limits ('25 free calls a day') and a paid fallback ('$0.01 USDC per call (x402)'), which an agent must know before calling in a loop.

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?

Front-loads the trigger ('Run before...') and the failure mode before details, then packs example, cost, and doc pointer. Dense but nearly every sentence earns its place; the trailing 'Outputs explained: GET /api/tools/convert' is a bare pointer rather than prose.

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, but the description partially compensates with a concrete output example and a doc pointer for output details. Combined with full schema coverage, an agent has enough to call it correctly, though return-shape specifics remain external.

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 coverage is 100%, so the baseline is 3, but the description adds real interpretive value beyond the schema: a worked example ('{"token": "SOL", "amount": "0.5"} gives 500000000') and the concrete 5 USDC = 5,000,000 raw units mapping that clarifies the raw/readable direction.

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 amounts and raw units with the token's real on-chain decimals') and frames the concrete risk it addresses ('wrong decimals send 1,000x too much or too little'). An agent can distinguish this from siblings like find_token or balance 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 Guidelines4/5

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

Gives an explicit when: 'Run before putting any token amount in a transaction,' plus direction guidance implying readable mode for chain-read amounts. It doesn't name an alternative tool or state when NOT to use it, but the triggering context is unambiguous.

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.