Skip to main content
Glama
longbridge

longbridge

Official

Profit Analysis (Realized, US)

profit_analysis_realized
Read-onlyIdempotent

Get realized P&L for US accounts, broken down by stock, option, or crypto categories and reporting currency.

Instructions

Get realized P&L for a US account, broken down by category (stock/option/crypto) and period. US accounts only; errors with DcRegionRestricted for AP accounts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
_jqNoOptional jq filter (jaq syntax) applied to this tool's JSON response before it is returned; it never changes the upstream request. One output is returned as-is, several as a JSON array, none as []. Module imports and the `env`/`debug`/`stderr` builtins are unavailable. Example: .data | map({symbol}). Omit for the full response.
categoryNoFilter by category: "STOCK", "OPTION", "CRYPTO", or omit for all.
currencyNoCurrency to report in, e.g. "USD" (default: "USD"). US accounts only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.0
    • addedInput schema / properties / _jq / description
      Added value: +"Optional jq filter (jaq syntax) applied to this tool's JSON response before it is returned; it never changes the upstream request. One output is returned as-is, several as a JSON array, none as []. Module imports and the `env`/`debug`/`stderr` builtins are unavailable. Example: .data | map({symbol}). Omit for the full response."
  2. Changed2 schema fields changedv0.10.6
    • addedInput schema / properties / _jq
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "$defs": {
      -    "RealizedPlCategory": {
      -      "properties": {
      -        "category": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "currency": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "metrics": {
      -          "items": {
      -            "$ref": "#/$defs/RealizedPlMetric"
      -          },
      -          "type": [
      -            "array",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "RealizedPlMetric": {
      -      "properties": {
      -        "amount": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "period": {
      -          "format": "int32",
      -          "type": [
      -            "integer",
      -            "null"
      -          ]
      -        },
      -        "rate": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "rate_unit": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": "object"
      -    }
      -  },
      -  "properties": {
      -    "realized_pl_list": {
      -      "items": {
      -        "$ref": "#/$defs/RealizedPlCategory"
      -      },
      -      "type": [
      -        "array",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  3. Addedv0.8.4

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds valuable behavioral context beyond annotations: the region restriction and the specific error code 'DcRegionRestricted', plus the output breakdown by category. This is useful and does not contradict annotations.

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 compact: two sentences that front-load the purpose and add a key restriction. However, the phrase 'and period' is slightly misleading because there is no period parameter in the schema, so it introduces ambiguity without earning its place. Otherwise, it is well-structured and free of fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only tool with no output schema, the description gives a good high-level summary and a useful error condition, but it references 'period' without explaining how period is specified, and it does not hint at the response shape (e.g., categories/periods in the output). This is a moderate gap that could leave an agent uncertain about what the result will look like.

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?

Schema description coverage is 100%, and the schema already documents 'category' with the exact enum values and 'currency' with the US-only note. The description's mention of 'stock/option/crypto' and 'US accounts only' largely duplicates schema content. It adds no new parameter-level meaning, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Get realized P&L for a US account', and adds scope ('US accounts only') and breakdown ('by category'). It is clear, but it does not explicitly name sibling alternatives like profit_analysis or profit_analysis_detail, so differentiation relies on the tool name and context rather than explicit contrast.

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?

The description provides clear contextual guidance: it is for realized P&L, US accounts only, and it warns about the DcRegionRestricted error for AP accounts. This effectively tells the agent when not to use it, but it does not explicitly point to alternatives for unrealized P&L or non-US accounts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools