Accounts and identifiers¶
A user links brokerage accounts to OHLCX. The MCP server identifies each of them the same way in every tool: by an account id and a masked label.
| Term | What it is | Example |
|---|---|---|
| Account id | OHLCX's own number for a linked account. A positive whole number. This is what you pass as account_id and in account_ids |
4 |
| Masked label | The account's number with all but the end hidden. This is what you show the user | *****678 |
What is never shown¶
- A full account number. Wherever the broker or OHLCX stores one, the server returns the masked label in its place.
- The broker's own key for an account (its account hash). The server removes it from every answer. When a tool has to name an account to the broker, the server looks the key up itself from the account id you gave, among the caller's own accounts only, and never returns it.
This holds for every tool whose answer can hold an account: the account tools, the order tools, list-credit-holds, list-activities, list-strategy-accounts, set-strategy-accounts and, for admins, get-user-billing.
Free text is relayed as written
The server hides account numbers and keys by field, at any depth of an answer. Text written by the broker or by a person, such as an order's status description or an activity's description, is passed on as it is.
The masked label¶
A masked label is five asterisks followed by the end of the stored number:
| Stored | Shown |
|---|---|
| A number of four or more characters | ***** and its last three characters, for example *****678 |
| A number that was stored already masked | ***** and the digits it kept (one to four), for example *****289 |
| Anything shorter | ***** |
| Nothing | null in the account tools. Account 4 (the word and the account id) in the order routing tools |
The same account has the same masked label in every tool, so a client can match the account_number of list-accounts with the label of list-strategy-accounts.
Passing an account: account_id¶
Start with list-accounts and use the id of an account wherever a tool asks for account_id.
account_id accepts:
- the account id as a number:
4 - the account id in digits:
"4" - the caller's own broker key for the account, for clients that stored one before this release. New clients should not rely on this. See Changes.
Anything else is refused. An account that is not one of the caller's linked accounts answers:
No linked account of yours has that id.
The same sentence is given for another user's account and for an account nobody has, so the answer does not tell them apart. Every account and order tool checks this itself, and nothing is asked about the account in that case. Do not retry: call list-accounts and use an id from it.
| Tool | account_id |
An id or key that is not yours |
|---|---|---|
get-account-balance, get-account-growth, get-account-pnl |
Required | No linked account of yours has that id. |
get-order |
Required | No linked account of yours has that id. An account of yours that is not linked with the broker for orders answers That account of yours is not linked with the broker for orders. Link it again in OHLCX. |
list-orders |
Optional. Left out, null or empty lists every linked account |
No linked account of yours has that id. |
get-account-pnl-history, get-account-pnl-symbols, list-account-cash-transfers |
Required | No linked account of yours has that id. |
set-strategy-accounts is stricter: its account_ids are whole numbers only. A string is not read as an id there, and a key is never accepted. See Strategies and order routing.
The shape of each answer¶
The examples use made-up values. Fields the examples do not show are relayed as the accounts API or the broker gives them.
list-accounts¶
Optional limit (1 to 100). Returns the user's linked accounts, at most 100, the most recently linked first. account_number is the masked label.
{
"accounts": {
"accounts": [
{
"id": 4,
"account_number": "*****678",
"type": "MARGIN",
"current_balances": { "liquidationValue": 25000.5 }
},
{
"id": 5,
"account_number": "*****289",
"type": "CASH"
}
]
}
}
Each account also carries its flags, its balances and, where the API sends them, its balance histories.
get-accounts-balances¶
Optional days: how many of the most recent days to return per account, 1 to 365 (default 30). Optional limit (1 to 200, default 50) and offset for the accounts. Returns one entry per account. account is the masked label; history is oldest first.
{
"accounts": [
{
"account_id": 4,
"account": "*****678",
"history": [
{
"account_id": 4,
"account_display": "*****678",
"date": "2026-10-01",
"initial_balance": 24800.0,
"current_balance": 25000.5,
"change": 200.5
}
]
}
]
}
With no linked account the answer is { "accounts": [] }.
get-account-balance¶
Required account_id. Optional limit (1 to 360). Returns the daily balance history of one account, oldest first.
{
"account_id": 4,
"account": "*****678",
"history": [
{ "date": "2026-10-01 09:30AM", "balance": 25000.5, "change": "200.50" }
]
}
get-account-growth and get-account-pnl¶
Required account_id. Optional limit (1 to 120). Both answer an object with the account and its rows, oldest first:
{
"account_id": 4,
"account": "*****678",
"growth": [
{ "date": "2026-10-01", "initial_balance": 24800.0, "final_balance": 25000.5, "growth_percentage": 0.81 }
]
}
get-account-pnl has the same shape with pnl in place of growth. The API reads the 120 most recent balance rows of an account.
get-account-pnl-history, get-account-pnl-symbols, list-account-cash-transfers¶
Required account_id. Optional period, or from and to dates (YYYY-MM-DD) that replace it. The default period is month for get-account-pnl-history and ytd for the other two. The answer is the accounts API's own. In it, account_display is the masked label. How many rows each returns, and how to read on, is on Limits and paging.
The two profit and loss tools need the user's consent to P&L sync, given in the app.
Orders¶
list-orders and get-order relay the broker's order objects. In them:
accountNumberis the masked label, a string such as"*****678", at every depth;- no account key appears.
list-orders needs start_date and end_date (YYYY-MM-DD; the end date covers the whole of that day). status filters by the broker's status, for example FILLED, WORKING or CANCELED. max_results is up to 500 (default 100).
get-order needs account_id and order_id, the broker's order id in digits.
Both tools are read-only. No tool places, changes or cancels an order.
list-credit-holds, list-activities, get-user-billing¶
These answers can mention an account. No account key appears in them, and any account number is the masked label. list-activities returns count, activities and meta.
Order routing accounts¶
list-strategy-accounts and set-strategy-accounts return accounts as id and label (the masked label), with whether each can receive orders. Their shapes are on Strategies and order routing.
Checklist for a client¶
- Call
list-accountsonce and keep the account ids. - Show the user masked labels, never ids alone.
- Pass account ids as numbers.
- Do not store or expect a broker key or a full account number: the server does not return either.
- On
No linked account of yours has that id., refresh your list withlist-accounts.