Skip to main content
Glama
aibtcdev
by aibtcdev

ordinals_p2p_psbt_swap

Record a completed PSBT atomic swap on the trade ledger once both parties sign and broadcast the transaction.

Instructions

Record a completed PSBT atomic swap on the trade ledger.

After both parties have signed a PSBT and the transaction is broadcast, use this tool to record the completed swap. The active wallet signs the record with BIP-137.

To construct and sign the PSBT itself, use psbt_create_ordinal_buy, psbt_sign, and psbt_broadcast first, then call this tool with the resulting txid.

Requires an unlocked wallet with Bitcoin keys.

Tip: call earning_opportunities to see how to put your assets to work.

Input Schema

NameRequiredDescriptionDefault
tx_hashYesBroadcast atomic swap transaction hash
metadataNoOptional freeform metadata
to_agentYesCounterparty BTC address (new owner of the inscription)
amount_satsYesSwap amount in satoshis
inscription_idYesInscription ID swapped
parent_trade_idNoParent trade ID being fulfilled (if closing an existing offer)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.77.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two real behaviors: the active wallet signs the ledger record with BIP-137, and an unlocked wallet with Bitcoin keys is required. It does not say whether recording is idempotent for a repeated tx_hash, whether it verifies the on-chain transaction, or what happens if the txid is invalid or already recorded.

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 operational content is front-loaded and reasonably tight, but the closing tip ("call earning_opportunities to see how to put your assets to work") is unrelated promotional filler that dilutes an otherwise focused procedural description.

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

Completeness3/5

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

The workflow prerequisites and signing mechanism are covered, which is the core need, but there is no output schema, and the description never says what the call returns (e.g. a trade ID) or how failures surface. For a ledger-recording mutation with no annotations, that leaves a meaningful gap.

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 description coverage is 100%, so all six parameters including parent_trade_id already carry documentation. The description only mentions the txid in passing ("the resulting txid"); it adds no meaning about parent_trade_id vs a standalone swap, or about the optional metadata field.

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 first sentence gives a specific verb and resource: "Record a completed PSBT atomic swap on the trade ledger." That distinguishes it from creation/negotiation siblings like ordinals_p2p_create_offer or ordinals_p2p_counter, which construct offers rather than ledger-completing a swap. It stops short of explicitly naming the sibling it contrasts with, which keeps it off a 5.

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?

The description clearly states the precondition (both parties signed, transaction broadcast) and the preceding tool sequence psbt_create_ordinal_buy -> psbt_sign -> psbt_broadcast -> this tool. It does not state when NOT to use it, e.g. whether an unbroadcast or partially signed swap should be routed to ordinals_p2p_counter or ordinals_p2p_cancel instead.

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

Deploy Server

Other Tools