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 wrapped in a Cobalt validity transaction: Base holds your signed tx dormant until your conditions hold, then includes it — a good-till-block/conditional order, no limit-order contract, nobody holding the trade. We never hold funds or keys; you sign and submit to Base's sequencer. Conditions: beforeBlock (a deadline), fromBlock, flashblockIndex, minNativeBalanceWei, or a caller-supplied storage predicate for price. At least one required. 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 wallet or API key required.

Input Schema

TableJSON 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: before this block (recommended)
storageMaskNoAdvanced: mask (hex, optional)
storageSlotNoAdvanced: storage slot (hex)
storageValueNoAdvanced: compare value (hex)
storageAddressNoAdvanced: pool/token for a storage condition
flashblockIndexNoFlashblock index (optional)
minNativeBalanceWeiNoMin taker ETH balance in wei (optional)

Output Schema

TableJSON 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. Added

TDQS

A4.2/5.0
Behavior5/5

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

Far beyond what the annotations carry: custody model ('we never hold funds or keys'), the signing/submission flow, the dormancy-until-conditions lifecycle, payment terms ($0.02 per call over x402), rate limit (1 free call/day), and auth mechanism (x-credit-token header, no API key). This is exactly the operational detail an agent needs and cannot derive from readOnlyHint/openWorldHint.

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?

Front-loaded with the core purpose, but delivered as one dense em-dash-laden paragraph with jargon ('Cobalt validity tx', 'flashblockIndex') and mild redundancy between 'no limit-order contract, nobody holding the trade' and 'We never hold funds or keys'. The pricing/credit sentences earn their place; the opening sentence does not parse cleanly on first read.

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?

For a 14-parameter conditional-transaction tool this is very complete: mechanism, condition set, required inputs, custody, auth and payment are all covered, and an output schema exists so return values need not be described. Little is left for the agent to guess before calling.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real cross-parameter meaning: it groups beforeBlock/fromBlock/flashblockIndex/minNativeBalanceWei/storage predicate as the condition set, calls out beforeBlock as a deadline, and states the 'at least one required' constraint that the schema does not express. It adds more than the schema alone.

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 with unusual precision: a swap that only lands when caller conditions hold, wrapped in a Cobalt validity transaction, contrasted against a 'good-till-block/conditional order' and explicitly distinguished from a limit-order contract. It does not, however, name the obvious sibling it replaces (base_swap) or any other alternative, so an agent must infer the boundary.

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?

Usage context is strong: it explains the conditional-order mechanic, states that at least one condition is required, lists which parameters count as conditions, and gives practical calling guidance (no wallet or API key required, per-call pricing, prepaid x-credit-token, 1 free call/day). What is missing is an explicit when-not-to-use statement or a named alternative such as base_swap for unconditional swaps.

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