Response Reference

Shared response conventions for AgentX MCP tools — minor units, status fields, OTC trade codes, re-authentication shape, and OTC two-step error model.

This page documents the response conventions shared across all AgentX tools. For tool-specific return shapes, see MCP Tools. For status code and error-handling reference, see also Status & Errors.


Minor units in history lists

The get_deposit_list and get_withdrawal_list tools return monetary amounts as integers in minor units, not as decimal strings.

Rule: divide by 10^decimals before displaying.

FieldToolUnits
totalAmountget_deposit_list, get_withdrawal_listMinor units (integer)
receiveAmountget_deposit_list, get_withdrawal_listMinor units (integer)
chargeAmountget_deposit_list, get_withdrawal_listMinor units (integer)
totalChargeAmountget_withdrawal_listMinor units (integer)
deductibleAmountget_withdrawal_listMinor units (integer)

Example: totalAmount: 150025 for USD = $1,500.25 (USD has 2 decimal places).

All other tools — account detail, execute tools, quote tools — use decimal strings (e.g. "1500.25") and require no conversion.


Deposit records — key status fields

Each record in get_deposit_list carries:

FieldTypeDescription
paymentCodestringUnique deposit reference (e.g. "DP2026040110300001")
statusnumberDeposit status code
statusDescstring or nullHuman-readable status; may be null while the status-code mapping is pending — display the raw status with a note when null
currencystringDeposit currency code
detailstring or nullAdditional deposit detail; usually null for fiat deposits

Withdrawal records — key status fields

Each record in get_withdrawal_list carries:

FieldTypeDescription
paymentCodestringUnique withdrawal reference (e.g. "WD2026042709550001")
statusnumberWithdrawal status code
statusDescstring or nullHuman-readable status; may be null — display raw status with a note when null
currencystringWithdrawal currency code
paymentTypenumber21 = first-party, 22 = third-party
purposeOfTransactionstring or nullPurpose field; meaningful for paymentType = 22 (third-party) only
pathTostring or nullDestination route, e.g. "BANK"

Execute withdrawal response

execute_fiat_withdrawal returns:

FieldTypeDescription
txCodestringUnique transaction tracking code (e.g. "WD2026041121000001")
currencystringCurrency code of the withdrawal
statusnumberInitial withdrawal status (e.g. 13 = fiat pending)
withdrawalAmountstring (optional)Original amount requested
chargeAmountstring (optional)Service fee charged
totalChargeAmountstring (optional)Total charges including service fee
amountReceivedstring (optional)Net amount the beneficiary receives after fees
tostring (optional)Destination bank account number
createAtstring (optional)Creation timestamp
updateAtstring (optional)Last status update timestamp

OTC trade codes

The OTC two-step flow returns identifiers at each step:

FieldSource toolDescription
quoteCodeget_otc_quoteIdentifies the locked quote; pass unchanged to confirm_otc_trade
tradeCodeconfirm_otc_tradeUnique trade reference (e.g. "OT2026043015320000"); use as the user-facing transaction ID

After confirming, use get_otc_trade_detail with the tradeCode to retrieve full settlement details (final rate, settlement timestamps, buyer/seller codes).


Re-authentication error shape

When a session has expired or authentication is required, tools return this object instead of the normal success payload:

{
  "error": true,
  "message": "Session expired",
  "authUrl": "https://www.alphaladder.hk/auth/..."
}
FieldTypeDescription
errortrue (literal)Always present on error responses
messagestringHuman-readable description of the error
authUrlstring (optional)Re-authentication URL; present when the user must log in again

When authUrl is present, redirect the user to that URL. After successful authentication, retry the original tool call.


OTC two-step error model

The confirm_otc_trade tool surfaces OTC failures as HTTP errors, not as { success: false } payloads:

HTTP statusMeaningAction
410 GoneQuote context expired — the 5-minute server window elapsedInform the user; call get_otc_quote again to obtain a fresh quote
409 ConflictLive rate drifted beyond the system drift tolerance from the originally quoted rateInform the user of the rate change; call get_otc_quote again so they can review the new rate before confirming

Do not auto-retry on either error. The user must explicitly review the new quote before proceeding.

The get_otc_quote response may also indicate rate unavailability: if exchangeRate or finalAmount is an empty string (""), the downstream pricing service cannot price this pair at that moment. Do not proceed to confirm_otc_trade — inform the user and let them retry or pick a different pair.

For general status code and error handling, see Status & Errors.

Was this page helpful?
© 2026 Alpha Ladder