Skip to main content
Glama

calculate_impermanent_loss

Calculate exact impermanent loss percentage and dollar shortfall from multi-asset price shifts, comparing against holding assets.

Instructions

Calculates exact percentage impermanent loss and dollar shortfall compared to holding assets based on multi-asset price ratio shifts. (0.01 USDC on Base L2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYesInput parameters or JSON string payload for the tool execution
paymentSignatureNoBase L2 USDC micropayment signature or transaction hash for x402 settlement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden. It does disclose what the tool computes and mentions the cost ('0.01 USDC on Base L2'), which is useful real-world behavior. However, it does not explain the output format, failure modes, or whether payment is mandatory before execution, leaving gaps for a paid calculator.

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, efficient sentence with the core behavior front-loaded and the cost note appended without fluff. Every word earns its place; no redundant qualifiers or restatements of the tool name.

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

Completeness2/5

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

The tool has no output schema, no annotations, and only a generic payload parameter. The description explains the high-level calculation and cost but omits the required payload format, how price ratio shifts should be expressed, and what the response contains. An agent would struggle to invoke this correctly without additional examples or structure.

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 schema's 'payload' description is generic ('Input parameters or JSON string payload'), giving no structure, and the tool description only loosely hints at the required inputs via 'multi-asset price ratio shifts'. This adds a bit of meaning but does not specify payload keys, units, or example shapes.

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 states a specific verb ('Calculates'), a clear resource (impermanent loss), and the precise outputs ('percentage impermanent loss and dollar shortfall compared to holding assets'). It also names the input basis ('multi-asset price ratio shifts'), which distinguishes it from sibling calculators like calculate_compound_yield or calculate_dex_slippage_bounds.

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?

There is no guidance on when to use this tool versus alternatives such as calculate_dex_slippage_bounds or calculate_compound_yield. The description implies its use for impermanent loss scenarios but provides no conditions, exclusions, or explicit routing hints.

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

Deploy Server

Other Tools