Skip to main content
Glama

Agent Financial Advisor

Strategy audit and overfitting check

strategy_audit

An independent performance auditor for a trading strategy or backtest. From a trade list and/or periodic returns it computes win rate, expectancy, profit factor, streaks, Sharpe/Sortino/drawdown, and tests whether the edge is real: t-stat, Probabilistic Sharpe Ratio and the Deflated Sharpe Ratio that corrects for how many variants you tried. Returns a verdict and red flags. Price: $0.1.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "trades": [
        {
          "pnl": 120
        },
        {
          "pnl": -60
        },
        {
          "pnl": 45
        },
        {
          "pnl": -30
        },
        {
          "pnl": 90
        }
      ],
      "n_trials": 20
    },
    "name": "strategy_audit"
  }
}

Input Schema

NameRequiredDescriptionDefault
tradesNoClosed trades.
api_keyNoOptional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial.
returnsNoPeriodic strategy returns as decimals.
n_trialsNoHow many strategy/parameter variants were tested before picking this one. Default 1.
starting_equityNoFor risk-of-ruin and drawdown in dollars from trades.
periods_per_yearNo
avg_trial_correlationNoAverage pairwise correlation (0 to 1) between the returns of the variants you tested. Near-duplicate variants (a 20-day vs. 21-day lookback) are not independent trials; with this the audit deflates by an effective trial count instead of the raw n_trials.
trial_sharpe_varianceNoVariance of per-period Sharpe across trials, if known.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / avg_trial_correlation
      Added value: +{
      +  "description": "Average pairwise correlation (0 to 1) between the returns of the variants you tested. Near-duplicate variants (a 20-day vs. 21-day lookback) are not independent trials; with this the audit deflates by an effective trial count instead of the raw n_trials.",
      +  "type": "number"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / api_key
      Added value: +{
      +  "description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "n_trials": 20,
      +    "trades": [
      +      {
      +        "pnl": 120
      +      },
      +      {
      +        "pnl": -60
      +      },
      +      {
      +        "pnl": 45
      +      },
      +      {
      +        "pnl": -30
      +      },
      +      {
      +        "pnl": 90
      +      }
      +    ]
      +  }
      +]
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it states the outputs ("Returns a verdict and red flags"), the analytical methods applied, and the cost ("Price: $0.1"). It does not state whether the operation is read-only/non-mutating or what happens on insufficient data, but the analytical, non-destructive nature is strongly implied by the audit framing.

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 core purpose and computational scope are front-loaded in the first sentence, with the significance-testing rationale second and the price last. It is dense but every clause carries information; the price sentence is short and separable.

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 8-parameter, zero-required tool with no annotations and no output schema, the description compensates well by enumerating the returned metrics and verdict/red-flag structure and by explaining the flexible input combination. Minor gaps remain around error conditions and what a verdict actually looks like, but an agent has enough to call it correctly.

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 already 88%, so the baseline is 3; the description earns above that by clarifying that trades and returns are alternatives that can be combined ("and/or") and by explaining the Deflated Sharpe's purpose as correcting "for how many variants you tried", which gives n_trials meaning beyond its schema text.

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?

"An independent performance auditor for a trading strategy or backtest" gives a specific role plus a concrete computation list (win rate, expectancy, profit factor, streaks, Sharpe/Sortino/drawdown) and significance tests (t-stat, PSR, Deflated Sharpe). This is clearly distinguishable from sibling checks like options_risk_check or suitability_check, which assess risk/fit rather than statistical edge validity.

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?

"From a trade list and/or periodic returns" implies the calling context and that inputs are flexible, which is real usage guidance for a tool with zero required parameters. However, there is no explicit when-to-use/when-not statement and no routing to alternatives such as portfolio_review or position_size; the agent must infer the boundary itself.

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.