Skip to main content
Glama
talkincode

HyperLiquid MCP Server

by talkincode

calculate_token_amount_from_dollars

Calculate the number of tokens you can purchase for a given dollar amount on a specified trading pair like BTC, ETH, or SOL, and retrieve the current price.

Instructions

Calculate how many tokens can be bought with a given dollar amount

Args: coin: Trading pair (e.g., "BTC", "ETH", "SOL") dollar_amount: Dollar amount to spend (e.g., 20.0 for $20)

Returns: Dictionary with token amount and current price

Example: calculate_token_amount_from_dollars("SOL", 20.0) → {"token_amount": 0.133, "current_price": 150.0, "dollar_amount": 20.0}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYes
dollar_amountYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, so the description carries the full burden of disclosure. It explicitly describes the calculation and return format (dictionary with token amount, current price, and dollar amount). This is sufficient for a non-destructive calculation tool. It does not mention error cases or data source, but the behavior is straightforward.

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 concise and well-structured: a one-sentence purpose, labeled args, returns, and a worked example. Every line adds value, and the example is provided without redundancy. No filler or fluff is present.

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

Completeness5/5

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

For a simple calculation tool, the description is complete. It covers inputs, output structure, and a full example. Even though an output schema is claimed, the description already documents the return format. All necessary information for correct invocation is present, making the tool self-contained.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does exceptionally well. It explains both parameters ('coin' and 'dollar_amount') with examples ('BTC', 'ETH', 'SOL' and '20.0 for $20'), and the example output clarifies the meaning of each field. The schema provides only types, so the description is the sole source of semantic meaning.

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 starts with a clear verb and resource: 'Calculate how many tokens can be bought with a given dollar amount.' This unambiguously distinguishes it from all sibling tools, which are order management and market data operations. The example call further reinforces the specific behavior.

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?

The description clearly implies when to use this tool: whenever a user wants to convert a dollar amount into a token quantity. It does not explicitly exclude alternatives, but no sibling serves the same purpose, so the context is sufficient. The example call provides practical guidance on invocation.

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/talkincode/hyperliquid-mcp-python'

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