Skip to main content
Glama

parse_units

Convert human-readable values like '1.5' to smallest units (e.g., wei) using configurable token decimals. Ensures precise blockchain amount handling for transactions.

Instructions

Convert a human-readable value to its smallest unit (e.g., ETH to wei)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesHuman-readable value (e.g., '1.5')
decimalsNoNumber of decimals (18 for ETH, 6 for USDC)
Behavior2/5

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

No annotations are provided, so the description must fully convey behavioral traits. It only states the conversion and gives an example, but it does not disclose the return format (e.g., string vs. number), rounding or precision handling, or error behavior for invalid inputs. This leaves critical operational details undocumented for an AI agent.

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?

The description is a single sentence that immediately states the action ('Convert a human-readable value to its smallest unit') and includes a clarifying example. It is concise, front-loaded, and contains no fluff or redundant content, making it easy to parse at a glance.

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?

Given the absence of an output schema and annotations, the description provides only the core purpose and an example. It does not specify the return format or any constraints (e.g., integer requirement for decimals, range limits). For a simple conversion tool this is partially sufficient, but an agent would benefit from additional details about the output representation and edge cases.

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?

The input schema already provides clear descriptions for both parameters: 'value' as a human-readable string and 'decimals' with examples (18 for ETH, 6 for USDC). The description adds only an illustrative example (ETH to wei) that reinforces the decimals concept but provides no additional syntax or edge-case detail. With 100% schema coverage, the schema carries the semantic weight, so a baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Convert' and identifies the resource as 'a human-readable value to its smallest unit,' with the clarifying example 'ETH to wei.' This clearly explains the tool's purpose and direction, distinguishing it from the reverse operation performed by the sibling tool 'format_units,' though it does not explicitly name that alternative.

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

Usage Guidelines2/5

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

The description does not provide explicit guidance on when to use this tool versus alternatives. It neither mentions the reverse operation (e.g., using 'format_units' for the opposite direction) nor any exclusions or prerequisites. The example 'ETH to wei' implies a use case, but there is no comparative guidance to help an agent decide between this and related conversion tools.

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/nirholas/universal-crypto-mcp'

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