Skip to main content
Glama

Negotiate a deal

negotiate
Destructive

Manage cross-chain OTC deal threads: message counterparties, propose counter prices, accept pending or current prices, or reject offers before an HTLC swap is created.

Instructions

Act in a deal thread. Actions:

  • message: free-text chat (body required)

  • propose: counter with a new TOTAL price (price required). Proposing a price is agreeing to it: when the counterparty takes it, the deal is agreed.

  • accept_proposal: take the price the counterparty proposed (price required: the pendingPrice shown by deal_status or my_deals) — they agreed to it by proposing, so this agrees the deal. As with accept, the initiator's secret is generated locally and only its hashlock is sent.

  • accept: accept the price on the table (price required: the currentPrice shown by deal_status or my_deals) — needed only when youAccepted is false — your own quote or proposal normally already counts (except an initiator's on an older server). When both sides have accepted, the HTLC swap is created. If you are the initiator (fund the long leg), a swap secret is generated LOCALLY on this machine and only its sha256 hashlock is sent — retrieve it later with get_deal_secret.

  • reject: decline and close the deal Accepting names the price on purpose: if it changed since you read the deal, the accept is refused — read it again and decide.

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": {
      "thread_id": "<thread_id>",
      "action": "<action>"
    },
    "name": "negotiate"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNomessage text (action=message)
priceNototal price: the new one (propose; at most 8 decimals of its asset (fewer if the asset has fewer); the API refuses more) or the one you are accepting (accept_proposal, accept)
actionYesWhat to do in the thread — see the list above
thread_idYesDeal thread id (threadId) from respond_to_rfq or my_deals

Output Schema

NameRequiredDescriptionDefault
okNo
errorNoSet instead when the call failed
agreedNo
statusNo
swapIdNoSet once agreed
threadIdNoDeal thread id
next_stepsNo
waiting_forNo
youAcceptedNoThis side accepted currentPrice
currentPriceNoTotal price on the table
pendingPriceNoCounter awaiting acceptance

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.11.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / action / description
      Added value: +"What to do in the thread — see the list above"
    • changedInput schema / properties / price / description
      Previous value: -"total price: the new one (propose) or the one you are accepting (accept_proposal, accept)"New value: +"total price: the new one (propose; at most 8 decimals of its asset (fewer if the asset has fewer); the API refuses more) or the one you are accepting (accept_proposal, accept)"
    • addedInput schema / properties / thread_id / description
      Added value: +"Deal thread id (threadId) from respond_to_rfq or my_deals"
    • addedInput schema / properties / thread_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)$"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "agreed": {
      +      "type": "boolean"
      +    },
      +    "currentPrice": {
      +      "description": "Total price on the table",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "additionalProperties": {},
      +      "description": "Set instead when the call failed",
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "is_retryable": {
      +          "type": "boolean"
      +        },
      +        "message": {
      +          "type": "string"
      +        },
      +        "recovery_hint": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "next_steps": {
      +      "type": "string"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "pendingPrice": {
      +      "description": "Counter awaiting acceptance",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "swapId": {
      +      "description": "Set once agreed",
      +      "type": "string"
      +    },
      +    "threadId": {
      +      "description": "Deal thread id",
      +      "type": "string"
      +    },
      +    "waiting_for": {
      +      "type": "string"
      +    },
      +    "youAccepted": {
      +      "description": "This side accepted currentPrice",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Addedv0.10.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the destructive/openWorld/non-idempotent annotations, the description discloses the critical behaviors: proposing a price constitutes agreement, accepting names a price so a stale read is refused, and the initiator's swap secret is generated locally with only its hashlock transmitted. These are non-obvious, high-stakes traits that annotations alone could not convey.

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 action list is front-loaded and each bullet is scoped to one action, which makes scanning easy. It is dense and the accept/accept_proposal bullets are long, but nearly every clause carries operational information rather than 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 multi-action, destructive, open-world tool, the description covers all branches, the price-staleness guard, the HTLC swap trigger, and secret handling. An output schema exists, so return values need not be explained, and nothing an agent needs to invoke an action correctly is 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 coverage is 100%, so the baseline is 3, but the description adds real meaning: it ties 'price' to the specific value each action expects (new total vs pendingPrice vs currentPrice) and explains the 8-decimal constraint's consequence. It stops short of restating the thread_id format, which the schema already handles.

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 opens with a specific verb+resource ('Act in a deal thread') and then enumerates all five actions with their required inputs, so an agent knows exactly what the tool does. It also implicitly separates itself from siblings by pointing to deal_status and my_deals as the source of prices and thread ids.

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?

Each action carries explicit when-to-use guidance: 'accept' is 'needed only when youAccepted is false', 'accept_proposal' is for the counterparty's pendingPrice, 'propose' is a counter. It even explains the exception for an initiator on an older server, which is exactly the kind of conditional routing an agent needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.