Skip to main content
Glama

Prepare P2P Atomic OTC Swap

prepare_atomic_swap
Read-only

Prepares a trustless, zero-fee Radix P2P Atomic Swap manifest (single or multi-resource and single or multi-account on each side): either a Subintent V2 pre-authorization manifest for the Maker to sign and share, or a Direct V1 single-transaction atomic swap manifest between accounts.

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": {
      "mode": "<mode>",
      "makerAccount": "<makerAccount>",
      "offer": "<offer>",
      "want": "<want>"
    },
    "name": "prepare_atomic_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYessubintent
wantYes
offerYes
byAccountNoOptional per-account holdings map for splitting withdrawals across multiple accounts (auto-queried from Gateway on mainnet/stokenet when omitted).
makerAccountYesMaker account address or array of Maker account addresses (primary first; received assets deposit to the first account).
takerAccountNoTaker account address or array of Taker account addresses (required when mode is "direct").

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • addedInput schema / properties / byAccount
      Added value: +{
      +  "additionalProperties": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "fungibles": {
      +        "default": [],
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "amount": {
      +              "type": "string"
      +            },
      +            "resourceAddress": {
      +              "format": "starts_with",
      +              "pattern": "^resource_.*",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "resourceAddress",
      +            "amount"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "nonFungibles": {
      +        "default": [],
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "ids": {
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "resourceAddress": {
      +              "format": "starts_with",
      +              "pattern": "^resource_.*",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "resourceAddress",
      +            "ids"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "fungibles",
      +      "nonFungibles"
      +    ],
      +    "type": "object"
      +  },
      +  "description": "Optional per-account holdings map for splitting withdrawals across multiple accounts (auto-queried from Gateway on mainnet/stokenet when omitted).",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / makerAccount / anyOf
      Added value: +[
      +  {
      +    "format": "starts_with",
      +    "pattern": "^account_.*",
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "format": "starts_with",
      +      "pattern": "^account_.*",
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • addedInput schema / properties / makerAccount / description
      Added value: +"Maker account address or array of Maker account addresses (primary first; received assets deposit to the first account)."
    • removedInput schema / properties / makerAccount / format
      Removed value: -"starts_with"
    • removedInput schema / properties / makerAccount / pattern
      Removed value: -"^account_.*"
    • removedInput schema / properties / makerAccount / type
      Removed value: -"string"
    • addedInput schema / properties / takerAccount / anyOf
      Added value: +[
      +  {
      +    "format": "starts_with",
      +    "pattern": "^account_.*",
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "format": "starts_with",
      +      "pattern": "^account_.*",
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / takerAccount / description
      Previous value: -"Required when mode is \"direct\""New value: +"Taker account address or array of Taker account addresses (required when mode is \"direct\")."
    • removedInput schema / properties / takerAccount / format
      Removed value: -"starts_with"
    • removedInput schema / properties / takerAccount / pattern
      Removed value: -"^account_.*"
    • removedInput schema / properties / takerAccount / type
      Removed value: -"string"
  2. Added

TDQS

A4.3/5.0
Behavior4/5

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

readOnlyHint=true is consistent with the description, which makes clear the tool only produces an unsigned manifest rather than executing a swap. It adds useful context beyond the annotation: the artifact is a manifest the Maker signs and shares, and the direct mode requires a taker side. It does not state that the Gateway holdings auto-query or submission steps happen elsewhere (that detail lives only in the schema).

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?

A single front-loaded sentence that leads with the artifact and then the mode fork, with no filler. The nested parenthetical about multi-resource/multi-account makes it dense to parse, but every clause carries scoping information.

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?

For a six-parameter tool with deeply nested schemas and no output schema, the description identifies the two possible returned artifacts and the signing flow behind them. Remaining gaps are the concrete shape of the returned manifest, the omission of the byAccount splitting behavior, and no mention of network/preconditions, though the latter is partially covered by schema property descriptions.

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 only 50%, but the description compensates for the biggest ambiguity in the schema's anyOf shapes by explaining that offer/want and each side's accounts may be single or array-valued. The mode enum values are given operational meaning (subintent = Maker signs and shares, direct = single transaction) and the direct-mode requirement for a taker is called out. The byAccount splitting map is left entirely to the schema.

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?

States a specific verb and artifact ('Prepares a trustless, zero-fee Radix P2P Atomic Swap manifest') and immediately enumerates the two output variants (Subintent V2 pre-authorization vs Direct V1 single-transaction). It also scopes cardinality ('single or multi-resource and single or multi-account on each side'), which separates it from the generic build_* manifest siblings.

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?

Gives clear in-tool routing: choose subintent when the Maker must sign and share a pre-authorization, choose direct for a single-transaction swap between accounts. It stops short of stating when to prefer this over neighboring tools such as build_dex_manifest, so there is no explicit exclusion 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.

Resources