Skip to main content
Glama

Audit a trade log

audit_trade_log
Read-onlyIdempotent

Build daily PnL, returns, and turnover from a trade log, mark positions to market with optional prices, then audit returns and flag concentration and survivorship hints.

Instructions

Builds daily PnL, returns and turnover from a trade log (marked to market with your prices if given), then runs the full audit_returns review. Adds PnL concentration by ticker and heuristic survivorship hints (tickers traded before their symbol existed; no names ever leaving a multi-year universe). Heuristics are labeled as such.

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": {
      "trades": "<trades>"
    },
    "name": "audit_trade_log"
  }
}

Input Schema

NameRequiredDescriptionDefault
pricesNoOptional daily closes for marking positions: wide (date + one column per ticker) or long (date,ticker,close). Strongly recommended.
tradesYesTrade log as CSV or JSON with columns date, ticker, side (buy/sell/short/cover), qty, price, and optionally fee.
n_trialsNoTotal strategy variants tried before this one.
benchmarkNoOptional daily benchmark returns (CSV/JSON).
costs_bpsNoCost per unit of turnover in bps for the headline result (if the log has no fee column).
initial_capitalNoStarting capital. Default: the largest gross exposure in the log.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, so the bar is low. The description still adds real context: marking to market uses your prices 'if given,' survivorship output is heuristic and explicitly labeled as such. It doesn't say what happens when prices are omitted (the schema only calls them 'strongly recommended').

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?

Three compact sentences, front-loaded with the primary outputs before the add-on analyses. Dense but each clause carries information; the parenthetical about marking to market is well placed.

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?

An output schema exists, so return values needn't be explained, and the description covers inputs, the pipeline it runs, and the caveat that heuristic findings are labeled. A complex multi-step audit is described adequately, with only the price-omission fallback left implicit.

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%, so every parameter including prices, trades, n_trials, benchmark, costs_bps and initial_capital is already documented. The description reinforces that prices drive marking to market but adds no syntax or format detail beyond the schema. Baseline 3 is appropriate.

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 names specific verbs and outputs — daily PnL, returns, turnover — plus the extra layers it adds (PnL concentration by ticker, survivorship heuristics). It also distinguishes itself from the sibling audit_returns by framing itself as building inputs then running that review with additions on top.

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 opening clause implies the selection condition clearly: use this when you have a raw trade log rather than a returns series (which is what audit_returns would take). It doesn't state explicit exclusions or when-not-to-use cases, so it falls short of a 5.

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