Skip to main content
Glama

MaCalculatriceEnLigne

Calculate Impermanent Loss

calculate_impermanent_loss
Read-onlyIdempotent

Calculate impermanent loss for a DeFi liquidity pool position when price ratio changes. Returns: {value_in_pool_ratio}. See list_bundles for related 'crypto' calculators.

Input Schema

NameRequiredDescriptionDefault
price_ratio_changeYesPrice ratio change multiplier (e.g. 2.0 if token doubled in price, 0.5 if halved)

Output Schema

NameRequiredDescriptionDefault
resultNoComputed result. Object whose fields depend on the tool (e.g. {tax, marginal_rate, brackets} for tax tools, {volume_l, gallons} for volume tools).
sourceNoAuthoritative source for the rule or formula (e.g. "Article 197 CGI", "NF DTU 21").
formulaNoHuman-readable formula or method used (e.g. "I=P·r·t", "Magnus formula").
reference_urlNoLink to a calcul2 page documenting the calculation in detail.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds the shape of the returned field (value_in_pool_ratio), but that largely duplicates the output schema and it says nothing about assumptions of the model (e.g. constant-product pools) or input boundaries beyond the schema minimum.

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?

Three short sentences, front-loaded with the core purpose and the triggering condition. The trailing cross-reference to list_bundles is the least load-bearing sentence but is not wasteful enough to drag it below 4.

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?

With one fully documented required parameter, an output schema that covers the return value, and annotations covering side effects, the description only needs the purpose sentence and the comparison note. The missing piece is differentiation from the other crypto calculators in the sibling set.

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%: the single parameter is documented with an example ('2.0 if token doubled in price, 0.5 if halved') and a minimum of 0.01. The description adds no syntax or interpretation beyond that, so the baseline 3 applies.

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?

States a specific verb and resource: calculate impermanent loss for a DeFi liquidity pool position, triggered by a price ratio change. That is far clearer than the tautological siblings, but it does not distinguish itself from closely related siblings such as calculate_crypto_profit_loss or calculate_staking_rewards.

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?

It never states when to use this tool versus alternatives. The pointer to list_bundles routes to a bundle-listing tool, not to the near-identical crypto calculators an agent would actually weigh against it, so no selection guidance is provided.

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.