Skip to main content
Glama

ValuEdge MCP — Stock Valuation, Screener & Portfolio Research

List matched historical trade sales

get_closed_trades
Read-onlyIdempotent

Review matched historical SELL events and allocated FIFO cost basis. Filter by exact ticker, currency and winning/losing/breakeven outcome after complete matching. Choose gross, after_recorded_fees (default), or verified_net P&L basis; unknown verified net is excluded explicitly. Sort by sale_date, realized_pnl or recorded calendar holding_days. A realized_pnl ranking requires one currency. Paginated; use next_offset because response budgeting may shorten a page. Coverage retains excluded transactions, including sales on/after an ambiguous recorded date. No execution-hour claims or live orders.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_closed_trades"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd date in YYYY-MM-DD format.
fromNoStart date in YYYY-MM-DD format.
limitNo
offsetNo
tickerNoOptional exact ticker. Applied after complete FIFO matching; prior purchases remain available.
outcomeNo
sort_byNo
currencyNoOptional currency code. Required when ranking realized P&L so currencies are never compared nominally.
pnl_basisNo
portfolio_nameNo
sort_directionNo

Output Schema

NameRequiredDescriptionDefault
dataNo
errorNo
metadataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / currency
      Added value: +{
      +  "description": "Optional currency code. Required when ranking realized P&L so currencies are never compared nominally.",
      +  "pattern": "^[A-Za-z]{3}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / outcome
      Added value: +{
      +  "enum": [
      +    "all",
      +    "winning",
      +    "losing",
      +    "breakeven"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / pnl_basis
      Added value: +{
      +  "enum": [
      +    "gross",
      +    "after_recorded_fees",
      +    "verified_net"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / sort_by
      Added value: +{
      +  "enum": [
      +    "sale_date",
      +    "realized_pnl",
      +    "holding_days"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / sort_direction
      Added value: +{
      +  "enum": [
      +    "asc",
      +    "desc"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / ticker
      Added value: +{
      +  "description": "Optional exact ticker. Applied after complete FIFO matching; prior purchases remain available.",
      +  "pattern": "^[A-Za-z0-9][A-Za-z0-9.\\-]{0,17}$",
      +  "type": "string"
      +}
  2. Added

TDQS

A4/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/closed-world annotations, the description discloses the default P&L basis, the explicit exclusion of unknown verified_net, the currency constraint on P&L ranking, page-shortening behavior that requires next_offset, and that excluded transactions are retained in coverage. These are substantive operational details an agent could not infer from annotations alone.

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?

Front-loaded with the core purpose, then filters, then basis/sort, then pagination caveats — a sensible order with little filler. It is dense and jargon-heavy in places ('ambiguous recorded date'), which costs a bit of readability but not accuracy.

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

Completeness4/5

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

For an 11-parameter read tool with an output schema, the description covers the ambiguous semantics (matching order, basis selection, currency constraint, pagination) that matter most. Gaps remain around pagination parameter defaults and portfolio_name scoping, which the schema does not document either.

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?

With only 36% schema description coverage across 11 parameters, the description does real work: it explains that ticker filtering is applied after complete FIFO matching, that outcome filtering is post-matching, the three pnl_basis modes and their default, and the sort keys. It leaves limit, offset, portfolio_name and sort_direction defaults unaddressed, so it does not fully close the coverage gap.

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 names a specific verb and resource plus scope: 'matched historical SELL events and allocated FIFO cost basis'. That immediately separates it from a generic transaction listing, but it never names the sibling it supersedes (list_my_portfolio_transactions), so sibling differentiation is left to inference.

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?

Usage is implied through conditional rules ('A realized_pnl ranking requires one currency', 'use next_offset because response budgeting may shorten a page'), and the closing line rules out live/execution-hour use. However, there is no explicit statement of when to pick this over alternatives or what preconditions must hold (e.g., whether matching must have completed before calling).

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.