Skip to main content
Glama
Backtest360

backtest360-mcp

Official
by Backtest360

compute_stats

Compute Sharpe, volatility, CAGR, and other performance metrics from a log returns series; use when returns come from an external source or portfolio.

Instructions

Compute the engine's performance metrics from a returns series.

Use when the returns came from somewhere other than run_backtest (an external system, a portfolio) — backtest results already include these statistics.

Args: returns: Per-bar log returns as {"dates": [...], "values": [...]} parallel arrays (ISO-8601 dates). trading_days_per_year: Required annualization factor — 252 for a daily equities calendar, 365 for 24/7 crypto. Must match the bar calendar of the returns series; a wrong value silently mis-annualizes Sharpe, volatility, and CAGR. benchmark_returns: Optional benchmark series, same shape — adds alpha/beta/capture metrics. trades: Optional trade records (entry_date, exit_date, direction, return_net, ...) — adds trade-level metrics. risk_free_rate: Annual risk-free rate as a decimal.

Returns: {"stats": {...}} — the metric set the API key's plan allows. See get_catalog('sections') for every metric's id and description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tradesNo
returnsYes
risk_free_rateNo
benchmark_returnsNo
trading_days_per_yearYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Given no annotations, the description carries full burden. It discloses that the tool computes stats, warns about silent mis-annualization with wrong trading_days_per_year, explains optional parameters add extra metrics, and notes that return format depends on API key plan. While it doesn't explicitly state read-only nature, the computation-oriented description and lack of side effects make it sufficiently transparent.

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 well-structured with a clear purpose statement, usage guideline, parameter list, and return type. It is informative without being overly verbose; every sentence adds value. Slightly lengthy but justified by the need to explain multiple parameters and warnings.

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?

Covers all necessary inputs, explains output format (JSON with stats key), and directs to get_catalog for metric details. Since an output schema exists, the description doesn't need to detail every return field. Adequate for a computation tool with moderate complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides detailed explanations for each parameter: required format for returns, importance and warning for trading_days_per_year, effects of benchmark_returns and trades, and default for risk_free_rate. This adds substantial meaning beyond the bare schema.

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?

Clearly states it computes performance metrics from a returns series, with a specific verb and resource. Explicitly distinguishes from sibling tool run_backtest by noting that backtest results already include these statistics, making the purpose unambiguous.

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

Usage Guidelines5/5

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

Provides explicit guidance on when to use ('Use when the returns came from somewhere other than run_backtest') and implicitly when not to (backtest results already include stats). Names the alternative tool run_backtest, giving clear context for decision-making.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Backtest360/backtest360-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server