Skip to main content
Glama

Build your funding

build_fund
Idempotent

Build the UNSIGNED transaction(s) to fund your leg. Returns chain-specific signing material (EVM txs / BTC pay-to / TRON txs). Sign with your own key/HSM/wallet, then submit via broadcast_tx. The server never holds your keys. Acting for a person with no wallet here? Give them the swap's dealUrl to fund there instead. A 409 is a state, not a failure: "already funded" / "escrow is already paid" (never pay the escrow again — on Bitcoin the second one may carry feePayTo/feeAmountSats when only the protocol fee is not seen yet), "cannot fund yet" / a missing address (wait or set it, then retry). On Bitcoin after a short payment amountSats is only the remainder (topUp: true). 503 = could not check — retry.

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>"
    },
    "name": "build_fund"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesSwap id
legYesThe leg YOU fund: a if you are the maker, b if you are the taker

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. Changed5 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 YOU fund: a if you are the maker, b if you are the taker"
    • 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.6/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true, openWorldHint=true, destructiveHint=false), it discloses that keys never touch the server, that output is unsigned signing material, and it decodes 409 and 503 outcomes including the Bitcoin topUp remainder case. That is substantive behavioral context the annotations cannot express.

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 sign-then-broadcast sequence are front-loaded, and every sentence carries information. The 409/503 block is dense and heavily nested in quotes, which slows parsing, but it is not filler.

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 two-parameter build tool with an output schema, the definition covers purpose, next step, fallback path, and error-state handling thoroughly. An agent has everything needed to call it and interpret the common failure modes.

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% and both fields are already documented, including the leg enum semantics. The phrase 'your leg' echoes the schema without adding format or constraint detail, so baseline 3 applies.

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?

The description states a specific verb and resource ('Build the UNSIGNED transaction(s) to fund your leg') and immediately names the chain-specific return material, so an agent knows exactly what the call produces. It also distinguishes itself from the downstream sibling by routing submission to broadcast_tx.

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 gives explicit sequencing ('Sign with your own key/HSM/wallet, then submit via broadcast_tx') and an explicit alternative path for agents acting for someone without a wallet (hand over the swap's dealUrl). Usage is conditioned clearly rather than implied.

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.