Skip to main content
Glama

crypto_dex-slippage

Read-onlyIdempotent

Estimate slippage on a DEX trade using constant-product AMM math. Input trade amount and pool reserves to get effective price, price impact, and output after fees.

Instructions

DEX slippage estimator for constant-product AMM (x*y=k).

Use when estimating slippage on a DEX trade using constant-product AMM math. Provide trade size and pool reserves. Returns: effective price, price impact percentage, and output amount after slippage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fee_bpsNoDEX fee in basis points (e.g. 30 = 0.3%)
reserve_aYesPool reserve of token A
reserve_bYesPool reserve of token B
trade_amountYesAmount of input token to swap
trade_directionNoSwap directiona_to_b
Behavior4/5

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

The description discloses that the tool returns effective price, price impact percentage, and output amount after slippage. Annotations already indicate read-only and idempotent behavior, and the description adds no contradictions. It could mention that the estimate is based on the constant-product formula and does not account for real-time market effects.

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 three sentences: the first defines the tool, the second gives usage guidance, and the third lists outputs. It is concise, front-loaded, and contains no extraneous information.

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?

Given the tool's simplicity (5 parameters, no output schema), the description adequately covers inputs and outputs. It could be improved by clarifying that results are estimates based on the constant-product formula, but it is still fairly complete.

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 covers 100% of parameters with descriptions. The description adds context like 'trade size and pool reserves' and the return values, which slightly supplements the schema. However, the benefit is minimal given the schema already describes each parameter.

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 clearly states it is a DEX slippage estimator for constant-product AMM (x*y=k), with a specific verb and resource. It is distinct from sibling tools like crypto_impermanent-loss or risk_transaction-cost.

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 advises using it when estimating slippage on a DEX trade with constant-product AMM math, which provides clear context. It does not explicitly exclude non-constant-product AMMs or mention alternatives, but the usage is well-defined.

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/QuantOracledev/quantoracle'

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