{"openapi":"3.1.0","info":{"title":"libre-mcp","version":"1.0.0","description":"Tools for the Libre blockchain (BTC/USDT lending and DEX). Read tools are free. Compose tools return unsigned actions plus an ESR link; sign with your own key (WharfKit) and call push_transaction, or hand the esr link to a human wallet (Bitcoin Libre / Anchor). This server never holds keys.\n\nEvery tool is also reachable over MCP (streamable HTTP) at POST /mcp; these REST routes\nare the same handlers for clients that do not speak MCP. Compose tools return an unsigned\n{actions, esr, expires} proposal — sign it yourself and relay it with push_transaction, or\nopen the esr link in a human wallet. The server holds no keys and signs nothing.\n\nRate limits are per source IP: read tools 300/min, compose tools 60/min, and\npush_transaction / request_account 10/min. Exceeding one returns 429."},"servers":[{"url":"https://mcp.libre.org","description":"Production"}],"paths":{"/v1/tools/get_chain_info":{"post":{"operationId":"get_chain_info","summary":"Chain id, head block and time for the selected network.","description":"Chain id, head block and time for the selected network.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]}}}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_account":{"post":{"operationId":"get_account","summary":"Balances (BTC, USDT, LIBRE, TPF, CBTC), permissions, resources, and whether the account key is on the Ill Bloom affected-set (compromised) list.","description":"Balances (BTC, USDT, LIBRE, TPF, CBTC), permissions, resources, and whether the account key is on the Ill Bloom affected-set (compromised) list. Refuse to operate from an account with affected_set=true; if affected_set_checked=false the gate was unavailable and affected_set=false means unknown, not safe.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_deposit_address":{"post":{"operationId":"get_deposit_address","summary":"The account's personal BTC deposit (bridge peg-in) address.","description":"The account's personal BTC deposit (bridge peg-in) address. BTC sent here arrives as BTC on Libre after confirmation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_table_rows":{"post":{"operationId":"get_table_rows","summary":"Raw get_table_rows escape hatch for any Libre contract table.","description":"Raw get_table_rows escape hatch for any Libre contract table.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"code":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"scope":{"type":"string"},"table":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":500},"lower_bound":{"type":["string","number"]},"upper_bound":{"type":["string","number"]},"index_position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"key_type":{"type":"string"},"reverse":{"type":"boolean"}},"required":["code","scope","table"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_orderbook":{"post":{"operationId":"get_orderbook","summary":"dex.libre orderbook for a pair: bids/asks sorted best-first, best prices and spread.","description":"dex.libre orderbook for a pair: bids/asks sorted best-first, best prices and spread. truncated:true means the book exceeded the 500-row page read and the depth shown is partial.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"pair":{"type":"string","enum":["btcusdt","librebtc"],"description":"btcusdt = BTC priced in USDT; librebtc = LIBRE priced in BTC"},"depth":{"default":20,"type":"integer","minimum":1,"maximum":200}},"required":["pair"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_orders":{"post":{"operationId":"get_orders","summary":"Open dex.libre orders for an account (optionally one pair).","description":"Open dex.libre orders for an account (optionally one pair). truncated:true means a book exceeded the 500-row page read and orders may be missing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"pair":{"type":"string","enum":["btcusdt","librebtc"],"description":"btcusdt = BTC priced in USDT; librebtc = LIBRE priced in BTC"}},"required":["account"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_trades":{"post":{"operationId":"get_trades","summary":"Recent dex.libre trades for a pair, newest first.","description":"Recent dex.libre trades for a pair, newest first. truncated:true means the history exceeded the 500-row page read, so older trades for this pair are not included.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"pair":{"type":"string","enum":["btcusdt","librebtc"],"description":"btcusdt = BTC priced in USDT; librebtc = LIBRE priced in BTC"},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200}},"required":["pair"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_pool_stats":{"post":{"operationId":"get_pool_stats","summary":"Lending pool state (available/outstanding USDT per pool), interest-rate curve config, and oracle BTC/USD.","description":"Lending pool state (available/outstanding USDT per pool), interest-rate curve config, and oracle BTC/USD.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]}}}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_loans":{"post":{"operationId":"get_loans","summary":"Active and queued loans (optionally one account); include_completed adds history.","description":"Active and queued loans (optionally one account); include_completed adds history.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"include_completed":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_vault":{"post":{"operationId":"get_vault","summary":"Collateral vault for an account: vault name, CBTC collateral balance, and the BTC address to fund it.","description":"Collateral vault for an account: vault name, CBTC collateral balance, and the BTC address to fund it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_redemption_queue":{"post":{"operationId":"get_redemption_queue","summary":"Queued lender redemptions (TPF → USDT waiting for liquidity), optionally one account.","description":"Queued lender redemptions (TPF → USDT waiting for liquidity), optionally one account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"}}}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_btc_price":{"post":{"operationId":"get_btc_price","summary":"Authoritative BTC/USD price from the on-chain oracle contract — the average of a round of independent feeders (at least 3, agreeing within 10%, or the round is skipped and the previous price stands), and the price the loan contract uses for LTV and liquidation.","description":"Authoritative BTC/USD price from the on-chain oracle contract — the average of a round of independent feeders (at least 3, agreeing within 10%, or the round is skipped and the previous price stands), and the price the loan contract uses for LTV and liquidation. Prefer this over any external exchange price. A feed older than 5 minutes is marked stale and must not be used for collateral math.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"pair":{"default":"btcusd","description":"Oracle feed pair. btcusd is the only feed on mainnet today.","type":"string"}}}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/setup_deposit_address":{"post":{"operationId":"setup_deposit_address","summary":"Compose registration with a bridge so the account is assigned its own Bitcoin address, which is how an agent funds itself.","description":"Compose registration with a bridge so the account is assigned its own Bitcoin address, which is how an agent funds itself. Sign this, then poll get_deposit_address: the bridge signers assign the address a short time later (about a minute on testnet), so it is NOT available immediately. bridge \"btc\" (x.libre, default) is the wallet balance used for trading; \"vault\" (v.libre) is loan collateral, and setup_vault already handles that path for borrowing. Fails if an address already exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"bridge":{"default":"btc","description":"btc = x.libre spendable balance; vault = v.libre loan collateral","type":"string","enum":["btc","vault"]},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/transfer":{"post":{"operationId":"transfer","summary":"Compose a token transfer on Libre (unsigned).","description":"Compose a token transfer on Libre (unsigned). Returns actions + esr.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"from":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"to":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"symbol":{"type":"string","enum":["BTC","USDT","LIBRE"]},"amount":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"memo":{"default":"","type":"string","maxLength":256},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["from","to","symbol","amount"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/place_order":{"post":{"operationId":"place_order","summary":"Compose a dex.libre limit order.","description":"Compose a dex.libre limit order. amount is in the base token (BTC for btcusdt), price in quote per base (USDT; BTC with 10 decimals for librebtc). Buys lock amount*price of quote; sells lock amount of base.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"pair":{"type":"string","enum":["btcusdt","librebtc"],"description":"btcusdt = BTC priced in USDT; librebtc = LIBRE priced in BTC"},"side":{"type":"string","enum":["buy","sell"]},"price":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"amount":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account","pair","side","price","amount"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/cancel_order":{"post":{"operationId":"cancel_order","summary":"Compose cancellation of an open dex.libre order (see get_orders for ids).","description":"Compose cancellation of an open dex.libre order (see get_orders for ids).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"pair":{"type":"string","enum":["btcusdt","librebtc"],"description":"btcusdt = BTC priced in USDT; librebtc = LIBRE priced in BTC"},"order_id":{"type":"integer","minimum":0,"maximum":9007199254740991},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account","pair","order_id"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/withdraw_btc":{"post":{"operationId":"withdraw_btc","summary":"Compose a BTC withdrawal (bridge peg-out) from Libre to a Bitcoin address.","description":"Compose a BTC withdrawal (bridge peg-out) from Libre to a Bitcoin address. Bridge fee applies (x.libre feeconfig table).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"btc_address":{"type":"string"},"amount":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account","btc_address","amount"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/setup_vault":{"post":{"operationId":"setup_vault","summary":"Compose collateral-vault creation (createvault + genaddr).","description":"Compose collateral-vault creation (createvault + genaddr). The vault sub-account name is generated here and returned as vault_name. Afterwards get_vault returns the BTC address to fund.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/borrow":{"post":{"operationId":"borrow","summary":"Compose a variable-rate USDT loan against vault collateral.","description":"Compose a variable-rate USDT loan against vault collateral. Minimum loan is 0.001 BTC worth of USDT (~$80 at current prices; the floor is BTC-denominated so the USDT figure moves). max_apr_bps is a slippage cap on the interest rate, compared against the APR AFTER this loan is disbursed — your own borrowing raises utilization, so the post-disbursement rate is higher than the one get_pool_stats shows now. A request over the cap is not rejected: it stays in the loan queue and opens if the rate later falls. Send the pool curve max (2000 bps) to accept any rate; cancel a queued request with cancel_loan_request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"},"amount_usdt":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"max_apr_bps":{"type":"integer","minimum":1,"maximum":65535},"pool_id":{"default":6,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["account","amount_usdt","max_apr_bps"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/cancel_loan_request":{"post":{"operationId":"cancel_loan_request","summary":"Compose cancellation of a queued (unfilled) loan request.","description":"Compose cancellation of a queued (unfilled) loan request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"}},"required":["account"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/repay":{"post":{"operationId":"repay","summary":"Compose a USDT repayment toward the account's loan.","description":"Compose a USDT repayment toward the account's loan.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"},"amount_usdt":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]}},"required":["account","amount_usdt"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/withdraw_collateral":{"post":{"operationId":"withdraw_collateral","summary":"Compose a collateral withdrawal (CBTC → BTC to an address).","description":"Compose a collateral withdrawal (CBTC → BTC to an address). Fails on-chain if it would breach LTV. The v.libre bridge charges 50 bps on the way out, capped at 0.005 CBTC, with a 0.0008 CBTC minimum withdrawal; funding a vault is free.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"},"amount_cbtc":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"btc_address":{"type":"string"}},"required":["account","amount_cbtc","btc_address"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/lend":{"post":{"operationId":"lend","summary":"Compose a USDT deposit into the lending pool (mints TPF shares).","description":"Compose a USDT deposit into the lending pool (mints TPF shares).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"},"amount_usdt":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"pool_id":{"default":6,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["account","amount_usdt"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/redeem":{"post":{"operationId":"redeem","summary":"Compose redemption of TPF shares for USDT (queued if liquidity is out on loan).","description":"Compose redemption of TPF shares for USDT (queued if liquidity is out on loan).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"},"amount_tpf":{"description":"Decimal amount, e.g. \"0.001\"","type":["string","number"]},"pool_id":{"default":6,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["account","amount_tpf"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/cancel_redeem":{"post":{"operationId":"cancel_redeem","summary":"Compose cancellation of a queued redemption by id (see get_redemption_queue).","description":"Compose cancellation of a queued redemption by id (see get_redemption_queue).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"account":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"permission":{"default":"active","description":"Permission to sign with (active, or your restricted agent permission)","type":"string","pattern":"^[a-z1-5.]{1,12}$"},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["account","id"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/push_transaction":{"post":{"operationId":"push_transaction","summary":"Broadcast a transaction you signed yourself (WharfKit packed format).","description":"Broadcast a transaction you signed yourself (WharfKit packed format). Only agent-whitelisted actions with ≤10 min expiry are relayed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"signed_tx":{"type":"object","properties":{"signatures":{"minItems":1,"type":"array","items":{"type":"string"}},"compression":{"default":0,"anyOf":[{"type":"number","const":0},{"type":"string","const":"none"}]},"packed_context_free_data":{"default":"","type":"string"},"packed_trx":{"type":"string","pattern":"^[0-9a-f]+$"}},"required":["signatures","packed_trx"]}},"required":["signed_tx"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/request_account":{"post":{"operationId":"request_account","summary":"Paid account creation.","description":"Paid account creation. NOT ENABLED — Libre accounts are free at https://accounts.libre.org, so this exists only as a proxy if a paid registrar is ever deployed. Calling it returns instructions, not an account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"name":{"type":"string","pattern":"^[a-z1-5.]{1,12}$"},"agent_key":{"type":"string"},"owner_key":{"type":"string"}},"required":["name","agent_key"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/tools/get_account_request":{"post":{"operationId":"get_account_request","summary":"Status of a request_account payment/creation.","description":"Status of a request_account payment/creation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"network":{"default":"mainnet","description":"Libre network. mainnet = real funds; testnet = free test chain.","type":"string","enum":["mainnet","testnet"]},"id":{"type":"string","minLength":1}},"required":["id"]}}}},"responses":{"200":{"description":"Tool result (shape varies per tool; see description).","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid arguments, or the tool failed (message in `error`).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such tool.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded for this tool bucket; retry in 60s.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/health":{"get":{"operationId":"health","summary":"Liveness check","description":"Returns {\"ok\": true} when the worker is serving.","responses":{"200":{"description":"Healthy.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}}}}