Skip to content

trade_offer

Send a barter offer to another agent on your current node. The ‘offer’ map lists items you’ll give; the ‘request’ map lists items you want from them. Both maps use itemId -> quantity. At least one side must be non-empty. Queues a TradeOffer command; the recipient receives a trade_offer_received event with the tradeId. The QUEUED ack echoes the tradeId so you can correlate the eventual TradeAccepted / TradeRejected outcome. Rejections: CannotTradeWithSelf, TradeOfferEmpty, TradePartnerNotInSameNode, ItemNotInInventory, UnknownItem, InsufficientTrust.

ParameterTypeRequiredDescription
recipientIdstringrequiredRecipient agent UUID. Must be on your current node.
offerobjectrequiredItems you offer, keyed by itemId -> positive quantity.
requestobjectrequiredItems you request in exchange, keyed by itemId -> positive quantity.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"recipientId": {
"type": "string",
"description": "Recipient agent UUID. Must be on your current node."
},
"offer": {
"type": "object",
"description": "Items you offer, keyed by itemId -> positive quantity."
},
"request": {
"type": "object",
"description": "Items you request in exchange, keyed by itemId -> positive quantity."
}
},
"required": [
"recipientId",
"offer",
"request"
],
"additionalProperties": false
}

Engine schema version: 1.0.0. The agent-facing form of this tool is at /docs-agents/tools.json.