Skip to main content
Glama

Record a swap you sent through the swap door (step 1 of 2)

prepare_net_swap_record
Read-onlyIdempotent

SWAP RECORD: say that you sent a swap you were quoted, so the swap door can show it routed. You give the transaction hash you sent, the quoteHash, validUntil and pair the quote showed. FREE, a signed statement, no fee, no gas. It is recorded once per wallet and transaction, as your own statement: nothing here checks the transaction onchain, so it reads unverified, and no reward is paid or promised for it. The door refuses a record while it is not switched on or the kill switch is on, for a house wallet, and for a quote that ended more than 15 minutes ago. Returns MESSAGE_TO_SIGN and BODY_JSON; sign with the wallet that sent the swap using personal_sign, then call submit_net_swap_record within 5 minutes. Cost and signer: free, no gas; the person signs the result with their own wallet or passkey, and the house never holds a key.

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": {
      "principal": "<principal>",
      "txHash": "<txHash>",
      "quoteHash": "<quoteHash>",
      "pair": "<pair>",
      "validUntil": "<validUntil>"
    },
    "name": "prepare_net_swap_record"
  }
}

Input Schema

NameRequiredDescriptionDefault
pairYesThe pair the quote showed: the token you sent, then >, then the token you received (written TOKEN_A>TOKEN_B).
txHashYesThe hash of the transaction you sent: 0x and 64 hex digits.
principalYesThe 0x… address that signs: the wallet that sent the swap. Address only, never a private key.
quoteHashYesThe quoteHash the quote showed: 64 hex digits.
validUntilYesThe validUntil time the quote showed, as an ISO time.

Output Schema

NameRequiredDescriptionDefault
okNo
toolNo
fundedNo
payUsdNo
workIdNo
claimIdNo
claimableNo
next_callNo
proofRuleNo
fulfillableByNo
definitionOfDoneNo
needs_from_callerNo
notClaimableReasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Far beyond the annotations, it discloses cost (free, no gas, no fee), that the record is a signed statement taken as the user's own claim, that nothing is verified onchain so it reads unverified, that no reward is paid or promised, the refusal conditions, one-record-per-wallet-and-transaction semantics, and the exact return keys plus signing window. With readOnlyHint=true already declared, this adds substantial context and does not contradict it.

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?

The core action and the follow-up call are front-loaded, and every block carries real information. It loses a point for repeating the free/no-gas claim at both the start and the end and for long run-on sentences that mix cost, refusals, and return values.

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 signing-flow step in a crowded prepare/submit tool family, it covers the origin of every input, refusal cases, cost, signer identity, return keys, and the next tool with its deadline. The presence of an output schema doesn't leave a gap the description needed to fill.

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 already documents all five parameters including formats. The description only restates which values come from the quote (tx hash, quoteHash, validUntil, pair) without adding syntax or constraints beyond that source hint. Baseline 3 applies when the schema does the heavy lifting.

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?

"Say that you sent a swap you were quoted, so the swap door can show it routed" names a specific verb (record a statement) and resource (a sent swap), and the title plus the "then call submit_net_swap_record" line make clear this is the prepare half of a two-step flow. An agent can tell it apart from the submit sibling without opening either schema.

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 states exactly when to use it (after you sent a swap you were quoted) and names the follow-up tool and its 5-minute deadline. It also lists explicit when-not conditions: the door is switched off, the kill switch is on, the wallet is a house wallet, or the quote ended more than 15 minutes ago.

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