Skip to main content
Glama

trade_settlement

Read-only

YOUR OWN trade's settlement, as buyer or seller: every leg (payout, fees, refunds) with its role, amount, ledger status and on-chain anchor state, plus the escrow contract's legs when there is one. A 404 means you were not a party.

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": {
      "match_id": "<match_id>"
    },
    "name": "trade_settlement"
  }
}

Input Schema

NameRequiredDescriptionDefault
match_idYesThe marketplace match id (UUID). You must have been its buyer or seller.

Output Schema

NameRequiredDescriptionDefault
legsNo
disputeNo
settledNo
contractNo
match_idNo
leg_countNo
your_roleNo
all_anchoredNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed23 schema fields changed
    • removedInput schema / properties / match_id / title
      Removed value: -"Match Id"
    • removedInput schema / title
      Removed value: -"trade_settlementArguments"
    • removedOutput schema / description
      Removed value: -"trade_settlement — relayed verbatim from GET /api/v1/wallet/trade/{match_id}/settlement."
    • removedOutput schema / properties / all_anchored / default
      Removed value: -null
    • removedOutput schema / properties / all_anchored / description
      Removed value: -"true only when every leg's anchor is 'anchored'"
    • removedOutput schema / properties / all_anchored / title
      Removed value: -"All Anchored"
    • removedOutput schema / properties / contract / default
      Removed value: -null
    • removedOutput schema / properties / contract / description
      Removed value: -"the escrow CONTRACT's own chain legs {version, state, closed, closed_on_chain, closing_txid, legs[]}; null = no escrow contract was recorded (a ledger-lane trade)"
    • removedOutput schema / properties / contract / title
      Removed value: -"Contract"
    • removedOutput schema / properties / dispute / default
      Removed value: -null
    • removedOutput schema / properties / dispute / description
      Removed value: -"null = the trade was never disputed; else {open, opened_at, deadline (only while open: an unresolved dispute auto-refunds the buyer then), at_deadline, extended_until, extension_state (none | offer_pending | agreed | agreed_new_offer_pending), extension_offer ({by, until} | null), extend_route}"
    • removedOutput schema / properties / dispute / title
      Removed value: -"Dispute"
    • removedOutput schema / properties / leg_count / default
      Removed value: -null
    • removedOutput schema / properties / leg_count / title
      Removed value: -"Leg Count"
    • removedOutput schema / properties / legs / default
      Removed value: -null
    • removedOutput schema / properties / legs / title
      Removed value: -"Legs"
    • removedOutput schema / properties / match_id / default
      Removed value: -null
    • removedOutput schema / properties / match_id / title
      Removed value: -"Match Id"
    • removedOutput schema / properties / settled / default
      Removed value: -null
    • removedOutput schema / properties / settled / title
      Removed value: -"Settled"
    • removedOutput schema / properties / your_role / default
      Removed value: -null
    • removedOutput schema / properties / your_role / title
      Removed value: -"Your Role"
    • removedOutput schema / title
      Removed value: -"TradeSettlementOut"
  2. Changed1 schema field changed
    • addedOutput schema / properties / dispute
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "null = the trade was never disputed; else {open, opened_at, deadline (only while open: an unresolved dispute auto-refunds the buyer then), at_deadline, extended_until, extension_state (none | offer_pending | agreed | agreed_new_offer_pending), extension_offer ({by, until} | null), extend_route}",
      +  "title": "Dispute"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / match_id / description
      Added value: +"The marketplace match id (UUID). You must have been its buyer or seller."
  4. Changed1 schema field changed
    • addedOutput schema / properties / contract
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "the escrow CONTRACT's own chain legs {version, state, closed, closed_on_chain, closing_txid, legs[]}; null = no escrow contract was recorded (a ledger-lane trade)",
      +  "title": "Contract"
      +}
  5. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds real behavioral value beyond that: the shape of the returned legs and, importantly, the 404 semantics for non-parties, which an agent needs to interpret errors. It is silent on rate limits or any auth-policy nuance, so not a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero waste. The scope/ownership constraint is front-loaded with emphasis, the payload is enumerated compactly, and the 404 note is placed last where it belongs.

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?

The tool is simple (one required param) and has an output schema, so return-format explanation is not required — yet the description still summarizes the leg structure and covers the notable failure case. An agent has everything it needs to call this correctly.

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?

There is only one parameter and schema description coverage is 100% — the schema already explains that match_id is the marketplace match UUID and that you must have been its buyer or seller. The description reinforces the buyer/seller authorization condition but adds no format, syntax or edge-case detail beyond the schema, so the 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 names the exact resource (your own trade's settlement, as buyer or seller) and enumerates its contents: every leg — payout, fees, refunds — with role, amount, ledger status and on-chain anchor state, plus escrow legs. This is far more specific than the sibling tools (ledger_verify, balance_proof, receipts_me) and lets an agent distinguish it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear preconditions — you must be the match's buyer or seller, and a 404 means you were not a party — plus the implied context of inspecting settlement after a match. It does not name an alternative tool or state when NOT to use it (e.g., when to prefer ledger_verify or balance_proof), so it stops short of a 5.

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.

Resources