Skip to main content
Glama
longbridge

longbridge

Official

Profit Analysis

profit_analysis
Read-onlyIdempotent

Analyze portfolio profit and loss over a specified date range. Retrieve a summary of gains and losses to assess performance. Provide both start and end dates for accurate results.

Instructions

Get portfolio profit and loss analysis summary. start/end: optional date range in yyyy-mm-dd format. Both must be provided together — passing only one returns empty results.

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.
endNoEnd date (yyyy-mm-dd). Must be paired with `start`; passing only one returns empty results.
startNoStart date (yyyy-mm-dd). Must be paired with `end`; passing only one returns empty results.

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. Changed1 schema field changedv0.10.6
    • addedInput schema / properties / _jq
      Added value: +{
      +  "type": "string"
      +}
  3. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"ProfitAnalysisParam"
  4. Addedv0.4.5
  5. Removedv0.4.0
  6. Addedv0.3.2
  7. Removedv0.3.1
  8. First observedv0.1.12

TDQS

A3.5/5.0
Behavior3/5

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

The annotations already declare readOnlyHint, idempotentHint, and non-destructive, so the safety profile is covered. The description adds one behavioral quirk: passing only one of start/end returns empty results. This is useful and not redundant. However, it does not mention what happens with invalid date formats or whether the summary is aggregated or per-position. But the annotations carry most of the behavioral burden, so a 3 is appropriate.

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?

The description is compact (two sentences), front-loads the core purpose, and then adds the necessary parameter constraint. No redundant words. Every sentence earns its place.

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 tool that returns a summary, the description covers the purpose and the key parameter constraint. However, given the presence of closely related siblings (profit_analysis_detail, profit_analysis_realized), an agent might lack clarity on the exact output scope (e.g., realized vs unrealized P&L). The output schema is absent, but a summary tool might not need elaboration. Still, a brief clarification on what the summary includes would improve completeness.

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?

The schema already describes both 'start' and 'end' parameters and their pairing requirement, so coverage is 100%. The description repeats this pairing requirement, adding minimal extra value. The _jq parameter is fully documented in the schema, so no additional benefit. Baseline 3 is correct because the description adds little beyond the schema.

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 clearly states the tool returns a portfolio profit and loss analysis summary. It names the resource (portfolio) and the specific purpose (profit and loss). However, it doesn't differentiate from the closely related siblings like profit_analysis_detail and profit_analysis_realized, which could cause confusion for an agent choosing between them.

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

Usage Guidelines3/5

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

The description mentions the optional date range and explicitly warns about the pairing requirement. It does not provide guidance on when to use this tool instead of the similarly named siblings (profit_analysis_detail, profit_analysis_realized), nor does it state the typical use case or context. The usage is implied but not elaborated.

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