Skip to main content
Glama

Dinero en la Mesa — Perp DEX costs & funding

Split a large order across perp DEXs (Pro, 1 USDC)

execution_plan
Read-onlyIdempotent

PAID: 1 USDC on Base per plan that saves at least 20 USD (free otherwise), via x402 (no account; an x402-enabled client pays automatically). How to split one side of a large market order across perp DEXs so each live order book only absorbs what it can: the size, fee and slippage of every leg, against doing it all on the single cheapest venue. You only pay when the split saves you at least 20 USD; below that the plan comes back free, and the first call already tells you the saving.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pair": "<pair>",
      "size_usd": "<size_usd>",
      "side": "<side>"
    },
    "name": "execution_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
pairYesBase asset of the perpetual, e.g. BTC
sideYesbuy (open long / close short) or sell
size_usdYesOrder size in USD (notional), one side
max_venuesNoMost venues to split across: each needs an account and margin (default 3)
monthly_volume_usdNoYour 30-day volume in USD, to pick your fee tier (default 0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / max_venues
      Added value: +{
      +  "description": "Most venues to split across: each needs an account and margin (default 3)",
      +  "maximum": 10,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / monthly_volume_usd
      Added value: +{
      +  "description": "Your 30-day volume in USD, to pick your fee tier (default 0)",
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / pair
      Added value: +{
      +  "description": "Base asset of the perpetual, e.g. BTC",
      +  "enum": [
      +    "BTC",
      +    "ETH",
      +    "SOL",
      +    "XRP",
      +    "BNB",
      +    "DOGE",
      +    "HYPE",
      +    "SUI",
      +    "LINK",
      +    "AAVE",
      +    "ENA",
      +    "LTC"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / side
      Added value: +{
      +  "description": "buy (open long / close short) or sell",
      +  "enum": [
      +    "buy",
      +    "sell"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / size_usd
      Added value: +{
      +  "description": "Order size in USD (notional), one side",
      +  "minimum": 1000,
      +  "type": "number"
      +}
    • addedInput schema / required
      Added value: +[
      +  "pair",
      +  "size_usd",
      +  "side"
      +]
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, open-world), so the description's real contribution is the commercial model: 1 USDC on Base via x402, no account needed, charged only when the split saves at least 20 USD, and 'the first call already tells you the saving.' That is meaningful behavioral context an agent cannot infer from annotations, though order-book freshness and latency remain undisclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The pricing rule is stated three times ('saves at least 20 USD (free otherwise)', 'only pay when the split saves you at least 20 USD', 'below that the plan comes back free'), which is wasteful repetition in an already dense opening sentence. The mechanism sentence is otherwise well front-loaded and informative.

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?

For a read-only planning tool with no output schema and fully documented parameters, the definition is nearly complete: it says what the plan contains (size, fee and slippage of every leg), what it is compared against, and how billing works. Missing only operational details such as data freshness and whether accounts on each venue are strictly required at call time beyond the schema note.

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 schema already documents pair, side, size_usd, max_venues and monthly_volume_usd. The description adds only the framing that the size refers to one side of the order and that splitting is bounded by what each book absorbs; it says nothing about the fee-tier input or the venue cap beyond the schema.

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 names a concrete verb and resource – splitting one side of a large market order across perp DEXs – and makes the comparison explicit ('against doing it all on the single cheapest venue'), which distinguishes it from the sibling routing/cost tools. It stops short of naming those siblings, but an agent can tell what this produces (a per-leg size/fee/slippage plan).

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

Usage Guidelines3/5

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

Usage is implied rather than stated: it applies to large orders where one book can't absorb the size, and there's a clear pay/free threshold. There is no explicit when-not guidance (e.g. small orders, use best_venue instead) and no mention of the 1000 USD minimum, which the agent must discover in the schema.

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.

Resources