Skip to main content
Glama

base_swap_validity

Read-onlyIdempotent

A swap that lands only when your conditions hold (Cobalt validity tx) — The base-swap 0x trade as a Cobalt validity transaction: Base includes your signed tx only while your conditions hold — a conditional order with no limit-order contract and nobody holding the trade. We never hold funds or keys; you sign and submit. Every request carries the deadline Base requires (at most 60 s out; set for you if omitted). Optional conditions: fromBlock, flashblockIndex (1-10), minNativeBalanceWei, or a caller-supplied storage predicate for price. Required inputs: sell, buy, amount, taker. Priced $0.02 per call over x402 on Base; send a prepaid x-credit-token header for unlimited calls, or get 1 free call/day per tool. No API key required.

Input Schema

NameRequiredDescriptionDefault
buyYesToken you buy
sellYesToken you sell
takerYesYour wallet (signs the swap)
amountYesAmount you sell
slippageNoSlippage in bps (optional, default 100)
fromBlockNoEarliest block (optional)
storageOpNoAdvanced: operator (< <= = != > >=)
beforeBlockNoDeadline block (optional; at most 60 s out, set for you if omitted)
storageMaskNoAdvanced: mask (hex, optional)
storageSlotNoAdvanced: storage slot (hex)
storageValueNoAdvanced: compare value (hex)
storageAddressNoAdvanced: pool/token for a storage condition
flashblockIndexNoFlashblock index 1-10 (optional)
minNativeBalanceWeiNoMin taker ETH balance in wei (optional)

Output Schema

NameRequiredDescriptionDefault
dataNoThe result payload. Shape is service-specific; every field is documented in the tool description.
serviceNoThe service id that answered.
checkedAtNoISO-8601 timestamp of when the underlying reads were taken.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / beforeBlock / description
      Previous value: -"Deadline: before this block (recommended)"New value: +"Deadline block (optional; at most 60 s out, set for you if omitted)"
    • changedInput schema / properties / flashblockIndex / description
      Previous value: -"Flashblock index (optional)"New value: +"Flashblock index 1-10 (optional)"
  2. Added

TDQS

A3.6/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, but the description clarifies that the user signs and submits, and that the service never holds funds or keys, which is valuable context for a swap tool. It also explains the validity mechanism and deadline constraint (60s), adding meaning beyond annotations.

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 description is somewhat verbose and mixes multiple concepts (validity tx, no limit-order contract, pricing, free tier) in one paragraph. The core idea is front-loaded but could be more structured for readability.

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 annotations already cover safety profile and schema covers parameters, the description adds necessary context about deadline constraint, 60s window, and payment model, making it fairly complete for invoking the tool correctly. Minor gaps like return format are covered by output schema.

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 the schema documents all 14 parameters. The description reiterates required inputs (sell, buy, amount, taker) and optional conditions, but doesn't add syntax or format details beyond what the schema provides, so baseline 3 is appropriate.

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 states a specific verb+resource: 'The base-swap 0x trade as a Cobalt validity transaction' with conditional execution semantics. It distinguishes itself from sibling base_swap by emphasizing validity conditions, though the comparison is somewhat indirect rather than naming base_swap explicitly.

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 through 'a swap that lands only when your conditions hold' and listing optional conditions, giving context for when to use it. However, it doesn't explicitly state when to use this tool vs base_swap or swap_route, nor when not to use it.

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