Skip to main content
Glama

AgentPay — trust routing + spend caps for x402 agents

pre_trade_check

One-call pre-trade sanity check: 'I want to long $X of SYMBOL — is now sane?' Combines live orderbook slippage at YOUR size, cross-exchange funding (carry cost), open-interest crowding, and contract security (GoPlus) into a single ok/caution/avoid verdict with a per-factor breakdown. Major ERC-20 addresses (LINK, UNI, ARB, OP, AAVE, PEPE, SHIB) resolve automatically; native assets (BTC, ETH, SOL, ...) report security n/a; an unrecognized token without token_address reads 'unknown' and caps the verdict at caution — an unscreened contract can never read 'ok'. Replaces four API integrations and the judgment layer on top of them. Raw component data embedded so you can apply your own thresholds.

Use when: An agent (or human) is about to enter a position and wants one verdict covering liquidity, carry, crowding, and security — instead of four raw feeds plus its own synthesis. Not for: you need a single raw factor — funding_rates, open_interest, orderbook_depth or token_security are free; you are not about to size a position. This call settles $0.01 on-chain. Returns: verdict (ok/caution/avoid), factors{liquidity,carry,crowding,security} each with level + reason, components{orderbook_depth,funding_rates,open_interest}, symbol, side, size_usd Example response: {"symbol":"ETH","side":"long","size_usd":50000,"verdict":"caution","factors":{"liquidity":{"level":"ok","slippage_pct":0.011,"bucket_usd":50000,"reason":"fills within 0.011% of best ask"},"carry":{"level":"caution","median_funding_pct":0.062,"annualized_pct":67.9,"reason":"longs paying elevated funding"},"crowding":{"level":"ok","long_short_ratio":1.4,"oi_change_24h_pct":3.2,"reason":"positioning unremarkable"},"security":{"level":"skipped","reason":"no token_address provided"}}}

Price: $0.01 USDC per call (x402 over MCP: an unpaid call returns PaymentRequired; pay via _meta x402/payment)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideNoTrade direction (funding carry is side-aware)long
symbolYesAsset to check, e.g. 'ETH', 'BTC', 'SOL'
size_usdNoIntended position size in USD (drives the slippage check)
token_addressNoOptional ERC-20 contract address for the GoPlus security scan. Auto-resolved for major tokens; required for a full verdict on tokens the resolver doesn't know (otherwise security reads 'unknown' and caps the verdict at caution)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, it discloses that the call settles $0.01 on-chain, that an unpaid call returns PaymentRequired, that major ERC-20s auto-resolve, that native assets report security n/a, and that an unrecognized token caps the verdict at caution. These are meaningful behavioral traits the annotations do not convey.

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 long but well front-loaded and segmented into Use when / Not for / Returns / Example. The example response and verdict logic justify their space, though a few clauses (e.g. listing individual token names) are slightly more than needed.

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

Completeness5/5

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

With no output schema, the description fully compensates by documenting the return shape (verdict, factors, components) and giving a concrete example response, plus the cost and payment model. An agent has everything needed to invoke and interpret the call.

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 coverage is 100%, so side/size_usd/token_address semantics are already documented in the schema. The description reinforces the token_address auto-resolution and verdict-capping behavior but adds little beyond what the schema fields already state, so baseline 3 applies.

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 function (a one-call pre-trade sanity check producing an ok/caution/avoid verdict) and names the four factor families it aggregates. It explicitly distinguishes itself from siblings by naming funding_rates, open_interest, orderbook_depth, and token_security as the raw alternatives.

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

Usage Guidelines5/5

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

It has explicit 'Use when' (about to enter a position, wants one verdict instead of four feeds) and 'Not for' (only need a single raw factor; not about to size a position) sections, and points to the free sibling tools that serve the excluded case. This is textbook when/when-not guidance.

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.