Skip to main content
Glama

Pre-Trade Swap/Sell Tax Guardrail ($0.01 x402)

pre_trade_check

Checks HIFO vs FIFO tax savings, 366-day US short-to-long-term cliffs, and Aave v3 borrow-vs-sell before executing a swap.

Instructions

Checks HIFO vs FIFO savings, 366-day US ST->LT cliffs, and Aave v3 borrow-vs-sell before swapping ($0.01 USDC x402 on Base).

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": {
      "walletAddress": "<walletAddress>",
      "sellAsset": "<sellAsset>",
      "sellAmount": "<sellAmount>"
    },
    "name": "pre_trade_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNo
sellAssetYes
sellAmountYes
jurisdictionNo
walletAddressYes
referrerWalletNo
paymentSignatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose meaningful behavior beyond the schema by stating the tool is paid at $0.01 USDC via x402 on Base, which tells the agent this call has a cost and a payment gate. It does not explain how paymentSignature is supplied or what happens when it is missing, nor does it describe the response or whether the tool only advises versus blocks execution.

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?

It is a single dense sentence with the substantive checks front-loaded and the pricing detail trailing. Every clause carries information, though the ST->LT abbreviation and x402 jargon add parsing cost for an unfamiliar agent.

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?

For a paid, 7-parameter, annotation-free tool with no output schema, the description is thin. It omits the payment flow for paymentSignature, the meaning of the jurisdiction enum (only US behavior is described, yet BR is accepted), and any sense of what the check returns or how results should be acted on.

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

Parameters2/5

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

Schema description coverage is 0% across 7 parameters, so the description must compensate and largely does not. Nothing is said about walletAddress, sellAsset, sellAmount, chain, jurisdiction (US vs BR), referrerWallet, or paymentSignature. The mention of US short-term/long-term cliffs hints at jurisdiction semantics, but the BR enum value and the payment parameter remain entirely unexplained.

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 concrete checks: HIFO vs FIFO savings, 366-day US short-term-to-long-term cliffs, and Aave v3 borrow-vs-sell, all performed before a swap. That is a specific verb-plus-resource statement an agent can act on. It stops short of distinguishing this bundled guardrail from siblings such as check_tax_impact or compare_borrow_vs_sell, which appear to cover overlapping ground.

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?

The phrase 'before swapping' implies the usage context: a pre-execution gate rather than a post-hoc analysis. However, there is no explicit when-not guidance, no statement of what to do if the check fails, and no routing to the sibling tools that cover individual pieces of this analysis.

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