Skip to main content
Glama

Build your claim

build_claim
Destructive

Build the UNSIGNED claim of the leg you receive (reveals the secret on-chain). Requires both legs funded. Acting for a person with no wallet here? Give them the swap's dealUrl to claim there instead. The initiator claims with its own secret; the counterparty, with the revealed one — swap_status shows it in secretCiphertext (plain hex, despite the name). secret = 32-byte hex preimage. This call sends the secret to Hashlock's server, even when it is refused (legs not both funded yet), so call it only when you are about to sign and send the claim. EVM returns txs to sign and send; TRON returns a transaction whose txID you sign; Solana returns sign="solana-tx" with transactionBase64 — only the leg's payout key can sign it (it is also the fee payer), then broadcast it; Bitcoin returns sign="btc-sighash" with sighashHexes — one per escrow input: sign EACH with secp256k1 and pass them back through broadcast_tx as { psbtBase64, signaturesHex: [...], preimageHex }, and the witness is assembled for you.

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": {
      "id": "<id>",
      "leg": "<leg>",
      "secret": "<secret>"
    },
    "name": "build_claim"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesSwap id
legYesThe leg that pays YOU: a if you are the taker, b if you are the maker
secretYes32-byte hex preimage of the swap hashlock

Output Schema

NameRequiredDescriptionDefault
txsNoEVM txs
signNoSigning scheme
payToNoBitcoin escrow address
feePayToNo
amountSatsNo
psbtBase64No
sighashHexesNoOne per input
transactionsNoTRON txs
feeAmountSatsNo
transactionBase64NoSolana tx

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / id / description
      Added value: +"Swap id"
    • addedInput schema / properties / id / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    • addedInput schema / properties / leg / description
      Added value: +"The leg that pays YOU: a if you are the taker, b if you are the maker"
    • addedInput schema / properties / secret / description
      Added value: +"32-byte hex preimage of the swap hashlock"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "amountSats": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "feeAmountSats": {
      +      "type": [
      +        "string",
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "feePayTo": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "payTo": {
      +      "description": "Bitcoin escrow address",
      +      "type": "string"
      +    },
      +    "psbtBase64": {
      +      "type": "string"
      +    },
      +    "sighashHexes": {
      +      "description": "One per input",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "sign": {
      +      "description": "Signing scheme",
      +      "type": "string"
      +    },
      +    "transactionBase64": {
      +      "description": "Solana tx",
      +      "type": "string"
      +    },
      +    "transactions": {
      +      "description": "TRON txs",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "txs": {
      +      "description": "EVM txs",
      +      "items": {},
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond annotations by disclosing that the secret is transmitted to Hashlock's server even if the call is refused, and by detailing per-chain return shapes and signing/broadcast follow-ups. The only minor gap is that it does not spell out irreversible consequences of an on-chain reveal beyond the parenthetical.

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 key action and precondition, but the chain-specific paragraph is dense and run-on, packing four protocol variants into one sentence. Each fact is useful, yet the structure could be broken into clearer per-chain statements.

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?

Given a mutation tool with an output schema, the description covers prerequisites, secret sourcing, cross-chain signing expectations, and the follow-up broadcast_tx call shape. Nothing essential for correct invocation appears missing.

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 already covers all three parameters, but the description adds real meaning: it clarifies the secret is a 32-byte hex preimage, explains which secret each party uses and that swap_status surfaces it as plain hex despite the `secretCiphertext` name. These are non-obvious semantics not present in 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 resource — 'Build the UNSIGNED claim of the leg you receive' — and immediately clarifies the on-chain effect (reveals the secret). It is clearly distinguishable from build_fund, build_refund, and broadcast_tx by naming the claim step and the unsigned output.

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?

Gives explicit preconditions ('Requires both legs funded'), routes no-wallet users to the dealUrl path instead, explains who supplies the secret (initiator vs counterparty) and where to find it via swap_status, and warns to call only when about to sign and send. Both when-to-use and when-not are present.

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.