Skip to main content
Glama

Profit and loss, daily value history, results per pair

get_performance
Read-onlyIdempotent

Measure how the portfolio performed, in one of three views. pnl: TRUE profit and loss over period with the user's own deposits and withdrawals stripped out: realized vs unrealized, net flows, income, fees, top gainers and losers, and a plain-English explanation. history: the daily series over period, oldest first: total value, net capital in, cost basis and cash in and out per UTC day. realized_by_pair: all-time realized FIFO profit ranked by trading pair, best first. Arguments apply per view, and a call that sets one its view does not take is refused: period (pnl, history; omit for all time); slim (history: true drops the per-asset breakdown, recommended unless composition is needed); limit and quote (realized_by_pair: the limit best AND limit worst pairs quoted in quote, defaults 20 and USDT, never summed across quote currencies). All values are USD end-of-day marks, not live quotes: never report pnl.endValue as the current value (get_portfolio has it). A history longer than 200 days is sampled evenly, always keeping the first and the latest day, and says so in truncated; pick a shorter period for every day. For buy and sell totals use get_trading_activity; for single trades use get_movements.

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": {
      "view": "<view>"
    },
    "name": "get_performance"
  }
}

Input Schema

NameRequiredDescriptionDefault
slimNohistory only. true returns the daily totals alone; false or omitted adds a USD value and a quantity for every asset on every day.
viewYesWhich view to read: pnl (true profit and loss over period); history (daily value series over period); realized_by_pair (all-time realized profit per trading pair). Each view takes only the arguments the description lists for it.
limitNorealized_by_pair only. How many best AND how many worst pairs to return, 1-100; up to twice this many rows come back. Defaults to 20.
quoteNorealized_by_pair only. Quote currency whose pairs to rank, e.g. "USDT" for BTCUSDT. Defaults to USDT.
periodNoTime window ending now: last_24h, last_7d, last_30d, last_90d, ytd (since 1 January UTC) or all. Omit for all time.
profileNoWhich portfolio to read, for accounts with more than one: its id, or its name (exact, case-insensitive, e.g. "Trading"). Omit to read this connection's default portfolio; every answer names the portfolio it read in `profile`. An unknown or shared name returns profile_not_found or profile_ambiguous listing the real ones, and list_profiles shows them up front.

Output Schema

NameRequiredDescriptionDefault
pnlNoPresent when view = "pnl".
viewNoWhich view answered; its data is under the key of the same name.
errorNoPresent ONLY when the call was refused instead of answered: upgrade_required (Pro plan needed), not_found, profile_not_found, profile_ambiguous, invalid_arguments, write_not_permitted, rate_limited, limit_reached, view_unavailable. No data fields come with it; read `message` to the user rather than retrying the same call.
historyNoPresent when view = "history".
messageNoPlain-language explanation that accompanies `error`, `data_status` or a proposed change. Read it to the user.
profileNoThe portfolio these figures belong to (absent on list_profiles).
next_stepNoWhat the user should do about data_status.
source_urlNoLink to the page in the WhereItGoes app that shows this data.
data_statusNoPresent only when the portfolio has no data yet. nothing_connected: no exchange and no wallet is connected, so empty lists and zeros mean "no data", NOT a $0 portfolio, and no data fields come with it (except on get_connections, get_alerts, get_target_allocation and list_profiles, which also answer). Send the user to next_step. syncing: a source is connected but its first sync is still running, so figures are partial and not final.
upgrade_urlNoWhere the user can upgrade, on an upgrade_required refusal.
stock_assetsNoPresent when the answer mentions Binance Stocks shares (EQ_<ticker>): they are US stocks, not crypto.
realized_by_pairNoPresent when view = "realized_by_pair".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / error / description
      Previous value: -"Present ONLY when the call was refused instead of answered: upgrade_required (Pro plan needed), not_found, profile_not_found, profile_ambiguous, invalid_arguments, write_not_permitted. No data fields come with it; read `message` to the user rather than retrying the same call."New value: +"Present ONLY when the call was refused instead of answered: upgrade_required (Pro plan needed), not_found, profile_not_found, profile_ambiguous, invalid_arguments, write_not_permitted, rate_limited, limit_reached, view_unavailable. No data fields come with it; read `message` to the user rather than retrying the same call."
  2. Changed3 schema fields changed
    • addedOutput schema / properties / data_status
      Added value: +{
      +  "description": "Present only when the portfolio has no data yet. nothing_connected: no exchange and no wallet is connected, so empty lists and zeros mean \"no data\", NOT a $0 portfolio, and no data fields come with it (except on get_connections, get_alerts, get_target_allocation and list_profiles, which also answer). Send the user to next_step. syncing: a source is connected but its first sync is still running, so figures are partial and not final.",
      +  "enum": [
      +    "nothing_connected",
      +    "syncing"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / message / description
      Previous value: -"Plain-language explanation that accompanies `error` or a proposed change."New value: +"Plain-language explanation that accompanies `error`, `data_status` or a proposed change. Read it to the user."
    • addedOutput schema / properties / next_step
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "What the user should do about data_status.",
      +  "properties": {
      +    "action": {
      +      "enum": [
      +        "connect_a_source",
      +        "wait_for_first_sync"
      +      ],
      +      "type": "string"
      +    },
      +    "add_exchange_url": {
      +      "description": "App page to connect an exchange with a read-only API key.",
      +      "type": "string"
      +    },
      +    "add_wallet_url": {
      +      "description": "App page to add a wallet address to watch.",
      +      "type": "string"
      +    },
      +    "settings_url": {
      +      "type": "string"
      +    },
      +    "sync_status_url": {
      +      "description": "App page showing sync progress.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "action"
      +  ],
      +  "type": "object"
      +}
  3. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the read-only and idempotent annotations, the description discloses critical behavior: PnL strips out user deposits and withdrawals, values are end-of-day USD marks rather than live quotes, invalid per-view arguments are refused, and long histories are evenly sampled with a `truncated` signal. These are exactly the non-obvious traits an agent needs before calling the tool.

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 description is dense and front-loads the three-view structure before drilling into per-view arguments and caveats. Most sentences carry operational value, but the length and packed punctuation make it slightly harder to scan than an ideal definition.

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?

With an output schema present and annotations covering safety behavior, the description supplies the remaining context: view semantics, per-view argument constraints, sampling behavior, and Mark-to-market caveats. An agent has enough information to select a view and avoid common misinterpretations.

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 schema already carries parameter documentation. The description still adds meaningful cross-parameter semantics—which arguments apply to which view, that invalid combinations are refused, that omitted period means all time, and that quote rankings are never summed across quote currencies—though it does not discuss the schema-documented `profile` parameter.

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 and resource ('Measure how the portfolio performed') and then names all three views with the exact contents returned by each. An agent can distinguish pnl, history, and realized_by_pair 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 Guidelines5/5

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

It explicitly routes each use case: pnl for true profit and loss, history for daily series, and realized_by_pair for all-time pair ranking. It also names alternatives for adjacent needs, telling the agent to use get_portfolio for current value, get_trading_activity for buy/sell totals, and get_movements for single trades.

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.