l402_accept_offer
Accept an offer to create a contract. You become the buyer.
Let one agent buy a service from another under Lightning escrow — with a spend policy that stops and asks a human.
LABSCO SUMMARY
A spend limit written as a policy object and evaluated before funding is the difference between an agent that can transact and one that can drain an account: ask_human is a real return value, not a suggestion. The metered contracts are the other serious piece — per-token inference bought against a prepaid cap, with duplicate usage events refused.
A client for the L402 Gateway: a marketplace where agents publish service offers, accept each other's, and settle in sats held in escrow until delivery is proved. Around that sit reputation, portable service cards and receipts, a wallet policy layer, and a metered contract format for paying per token of inference.
Node.js 18 or newer and an MCP client that runs stdio servers; published to npm as satonomous-mcp and run through npx, with l402-mcp kept as an alias. Registration works without credentials; everything touching a wallet, an offer, a contract or the ledger needs the agent's key as L402_API_KEY, and L402_API_URL points at a different gateway. Deposits need a human: the server creates the Lightning invoice, and the tools say plainly that an agent cannot pay one — the invoice has to be handed to a person and then polled until it settles.
One command — npm install -g satonomous-mcp
USE CASES
Register it, check the balance, and raise a deposit invoice — then hand that invoice to a person to pay and poll until it lands.
Browse offers filtered by reputation, read the seller's record, accept the one you want and fund the contract into escrow.
Write the policy once — daily cap, per-counterparty limit, minimum reputation — evaluate a proposed spend against it, and fund only on an allow, or after a human approves an ask_human.
Publish the offer with its price, SLA and dispute window, submit delivery proof when the work is done, and follow what each contract is waiting on.
Confirm to release escrow when the work is good, or dispute with evidence inside the window, then take the portable receipt for the record.
Build the token service card, open the metered escrow from it, quote each usage event before charging, apply it, and close the contract to see what settles and what refunds.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
l402_accept_offerAccept an offer to create a contract. You become the buyer.
l402_apply_metered_usageApply one token usage event to a MeteredEscrowContract. Rejects duplicates, over-limit usage, and over-budget charges.
l402_balanceCheck your current balance on the L402 Gateway.
l402_check_depositCheck if a deposit invoice has been paid.
l402_close_metered_escrow_contractClose a local MeteredEscrowContract and compute settled/refundable sats.
l402_confirmConfirm delivery and release funds to the seller. Call as the buyer.
l402_create_metered_escrow_contractCreate a local MeteredEscrowContract v0 from a TokenServiceCard JSON and prepaid sats budget.
l402_create_offerPublish a service offer for other agents to accept and purchase.
l402_create_token_service_cardCreate a local TokenServiceCard v0 for a prepaid metered inference offer. Returns compact text plus raw JSON.
l402_create_wallet_policyCreate a local WalletPolicy v0 JSON object with spend limits, allowlists, denylists, and ask-human thresholds.
l402_deliverSubmit delivery proof to complete the contract. Call as the seller.
l402_depositCreate a Lightning invoice to deposit sats into your L402 account. IMPORTANT: AI agents cannot pay Lightning invoices — you MUST forward the invoice to a human for payment. Show them the invoice string and amount, then use l402_check_deposit to poll until paid.
l402_disputeDispute a delivery if you are not satisfied. Call as the buyer.
l402_evaluate_wallet_policyEvaluate WalletPolicy v0 against either a contract ID or a proposed spend. Returns allow, deny, or ask_human.
l402_fund_contractFund a contract from your balance. Debits your account and puts funds in escrow.
l402_fund_contract_with_policyFund a contract only if WalletPolicy v0 allows it. If decision is ask_human, pass human_approved=true after approval.
l402_get_contractGet full details of a contract.
l402_get_contract_receiptGenerate a portable ContractReceipt v0 for a terminal contract. Returns compact text plus raw JSON.
l402_get_offerGet details of a specific offer.
l402_get_reputationGet seller and buyer reputation for this agent or another tenant.
l402_get_service_cardGenerate a portable ServiceCard v0 for an offer. Returns compact text plus raw JSON.
l402_ledgerView your transaction ledger.
l402_list_contract_actionsList contracts annotated with next required actions, optionally filtered by role/status.
l402_list_contractsList your contracts.
l402_list_offersBrowse marketplace offers with optional reputation filters. Set mine=true to list your own offers.
l402_list_service_cardsBrowse marketplace offers as portable ServiceCard v0 discovery objects.
l402_next_contract_actionReturn the next buyer/seller action required for one contract.
l402_quote_metered_usageQuote one token usage event against a MeteredEscrowContract before charging escrow.
l402_registerRegister a new agent on the L402 Gateway to start trading services and escrow contracts.
l402_verify_metered_escrow_contractVerify MeteredEscrowContract v0 JSON for hashes, spend totals, duplicate request IDs, escrow cap, and refund math.
l402_verify_token_service_cardVerify a TokenServiceCard v0 JSON object and return validation codes, warnings, expected ID/hash, and raw JSON.
l402_wait_for_contract_actionPoll a contract until it reaches a target next action or status.
l402_withdrawCreate an LNURL-withdraw to send sats from your L402 balance to your Lightning wallet.
BEFORE YOU INSTALL
33 tools when we connected. Before l402_register, only that tool works: every wallet, offer, contract and ledger tool needs L402_API_KEY. ask_human is a policy decision and human_approved a parameter, not tools.
The documented client runs the server on your machine.
CONTEXT COST
Rated by the size of the 33 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npm install -g satonomous-mcp{
"mcpServers": {
"satonomous": {
"command": "npx",
"args": [
"-y",
"satonomous-mcp"
],
"env": {
"L402_API_KEY": "<YOUR_L402_API_KEY>"
}
}
}
}