Skip to main content
Glama
FlawlessByte

quant-research-mcp

by FlawlessByte

quant_backtest_method

Read-onlyIdempotent

Backtest a quantitative trading method using its own live signal logic bar by bar, applying realistic costs and returning performance stats for parameter validation.

Instructions

Backtest a registered method by replaying its own analyze() over history.

The engines execute the method's live signal logic bar by bar (no separate backtest implementation that could drift). Daily methods replay daily bars with next-open fills and method-specific exits; intraday methods replay each available 5m session (provider-capped to ~60 days); xs_momentum runs a monthly-rebalance portfolio. Costs applied one-way on entry and exit.

Args: params (BacktestInput): method_key, tickers, period, costs_bps, risk_pct, top_n, response_format.

Returns: str: stats (n_trades, win_rate, avg_r/expectancy, profit_factor, max_drawdown_pct, total_return_pct), in-sample/out-of-sample halves, and the last 10 trades. Treat results as PARAMETER VALIDATION, not a forecast — yfinance data is survivorship-prone and costs are estimates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already indicate readOnlyHint=true and idempotentHint=true. The description adds significant behavioral context: no separate backtest implementation, costs applied one-way, and the warning about survivorship bias. This goes beyond the annotations and is highly transparent.

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 concise and well-structured: a one-line summary followed by behavioral details, then clear 'Args' and 'Returns' sections. Every sentence adds value without redundancy, and the structure aids quick scanning.

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

Completeness5/5

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

The description covers the tool's purpose, mechanics, parameters, return format, and important caveats (survivorship bias, cost estimates). Given the tool has a single complex parameter and an output schema, the description is complete and leaves no critical gaps.

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?

The input schema includes descriptions for all parameters, and the tool description's 'Args' section lists them. The body adds meaning for 'period' (intraday cap) and 'top_n' (xs_momentum only), enhancing understanding beyond schema defaults. Schema coverage is formally 0% but descriptions exist, so baseline is 3 and the added context raises it.

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 clearly states the tool's purpose: 'Backtest a registered method by replaying its own analyze() over history.' It uses a specific verb and resource, and the details (bar-by-bar replay, daily vs intraday) distinguish it from sibling tools like quant_describe_method or quant_list_methods.

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 description provides context on when to use the tool by explaining its mechanics (daily bar filling, intraday caps) and includes a caution to treat results as parameter validation. However, it does not explicitly state when not to use it or compare to alternatives, though the uniqueness of the tool makes it clear.

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/FlawlessByte/quant-research-mcp'

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