Skip to main content
Glama

midasflow-mcp-quickstart

[LAB] Backtest a setup (historical P(TP1 before SL) + EV)

backtest
Read-onlyIdempotent

LAB / RESEARCH tool — replay an arbitrary {symbol, entry, tp, sl} setup over MidasFlow's 1m candle history and get its historical P(TP1-before-SL) + EV, in the canonical first-touch TP1 frame (same frame as get_accuracy). Historical market DATA, NOT a prediction or advice. Low-sample setups return a directional band (normal, not an error). NOTE: live results are gated behind ff:backtest_live — until that flips, EVERY tier gets a coming-soon envelope (no live numbers). Routes: POST /v1/backtest.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slYesStop-loss price. Direction (long/short) is inferred from tp/sl vs entry.
tpYesTake-profit price, or an ordered list of prices (nearest = TP1 banked first).
entryYesEntry price; defines the TP/SL offsets replayed over historical anchors.
symbolYesPerp symbol, e.g. 'BTCUSDT' (case/space-insensitive).
max_hold_minNoForward first-touch window per anchor in minutes (clamped 15-1440). Default 240. Timeout anchors are excluded from p, not losses.
lookback_daysNoHistorical window to sample anchors from, in days (clamped 7-90). Default 30.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already mark the tool as read-only, idempotent, and non-destructive. The description adds valuable context: it emphasizes the tool outputs historical data, not predictions; explains the first-touch TP1 frame; and clarifies that timeout anchors are excluded from probability calculations. This goes beyond the annotations to describe edge case handling and the nature of results.

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 5 sentences, front-loaded with the core purpose. It uses caps for emphasis ('DATA', 'NOT') which is slightly informal but not detrimental. The route hint is included but not essential. It could be trimmed slightly, but overall it's efficient and well-structured.

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?

Given the presence of an output schema (so return values need not be explained), the description covers key aspects: the historical frame, live gating, low-sample behavior, and timeout handling. It does not mention error conditions or symbol validation, but these are partially covered by the schema descriptions. Considering tool complexity, it is fairly complete.

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?

All 6 parameters have schema descriptions, but the description adds critical context beyond them: it explains that direction is inferred from tp/sl relative to entry, that tp can be an ordered list, and that max_hold_min clamping excludes timeouts from probability. This enriches the agent's understanding of how parameters interact and affect results.

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 replays a trading setup over historical candle data to compute P(TP1 before SL) and EV. The title reinforces this by labeling it 'Backtest a setup' and specifying the output metrics. It distinguishes from sibling tools like 'calc_ev' and 'get_accuracy' by focusing on historical replay rather than real-time or aggregated metrics.

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 labels the tool as 'LAB / RESEARCH', signaling experimental use, and warns that live results are gated behind a feature flag. It also notes that low-sample setups return a directional band instead of an error. However, it does not explicitly compare to sibling tools like 'calc_ev' or 'get_accuracy', leaving the agent to infer when to use this rather than those. Slight markdown for lacking explicit alternatives.

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.

TDQS

A4.2/5.0
Disambiguation5/5

Each tool targets a distinct aspect of market data and analytics: account info, analysis, backtesting, expected value, accuracy, candles, context, flow, heatmap, market overview, orderbook, signals, whales, and scoring. Despite some thematic overlap (e.g., get_accuracy and score_symbol both involve probabilities), descriptions clearly differentiate their purposes and usage contexts.

Naming Consistency2/5

Naming is inconsistent: some tools use the 'get_' prefix (get_accuracy, get_candles, etc.), while others are bare verbs or nouns (account, analyze, backtest, calc_ev, score_symbol). This mix of patterns (get_ vs verb vs noun) makes the naming convention unpredictable.

Tool Count5/5

With 14 tools, the server is well-scoped for a comprehensive market data and analytics API. Each tool serves a clear and distinct function, and the count is neither too few to cover the domain nor too many to be overwhelming.

Completeness5/5

The tool set covers all major aspects of the domain: account management, historical data (candles), market context (regime, flow, heatmap), order book, signals, accuracy/backtesting, and scoring. There are no obvious missing operations for an analytics-focused financial data server.