Skip to main content
Glama

FILTRIX.net

run_backtest

Read-onlyIdempotent

Statistics of what happened on the day of every historical event matching the filters (AND-joined, max 20): sample size n, mean/median/percentiles of the outcome, long/short/flat shares with the rule that defines them (direction_rule), share of up closes, monthly buckets, and up to sample_limit (max 20) example events. Outcomes: day_close_position (0 = closed at the low, 1 = at the high; default), day_return (fraction), reg_pct / hi_to_cl_pct / lo_to_cl_pct (percent). threshold is in the outcome's unit (0.05 = 5% for day_return, 5 = 5% for reg_pct); prob_le_threshold = share of events with outcome <= threshold. Dates are YYYY-MM-DD. Use for "how do setups like this usually resolve?". For the list of matching events use screen_events; for one ticker's own gap history use get_ticker_gap_stats.

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": {
      "filters": "<filters>"
    },
    "name": "run_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
filtersYesConditions that must all hold (AND-joined, max 20). Column names come from search_filters.
outcomeNoOutcome to measure: day_close_position (default), day_return, reg_pct, hi_to_cl_pct or lo_to_cl_pct. Units and definitions: get_meta.day_close_position
pos_maxNoday_close_position only: a close above this (0..1) counts as long (default 0.8).
pos_minNoday_close_position only: a close below this (0..1) counts as short (default 0.5).
end_dateNoLast event date to include, YYYY-MM-DD (default: latest).
thresholdNoCut-off in the outcome's unit (0.05 = 5% for day_return, 5 = 5% for reg_pct, 0..1 for day_close_position); prob_le_threshold is the share of events at or below it.
start_dateNoFirst event date to include, YYYY-MM-DD (default: start of history).
sample_limitNoAlso return up to this many example events (0..20).
flat_thresholdNoHalf-width of the 'flat' zone for the long/short/flat split, as a fraction (0.002 = 0.2%). Ignored for day_close_position.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already establish that this is a read-only, idempotent, non-destructive operation. The description adds substantial behavioral context beyond that: filters are AND-joined and capped at 20, sample_limit is capped at 20, outcomes have defined units, and threshold semantics are explained. It does not discuss empty-result behavior or performance limits, but the added context is strong.

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 dense but well front-loaded: it leads with what the backtest returns, then explains outcomes and thresholds, then gives usage guidance and alternatives. The first sentence is long and parenthetical-heavy, but nearly every clause carries useful information for calling the tool correctly.

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?

For a nine-parameter analytical tool with an output schema, the description covers the key inputs, output contents, unit conventions, date format, filter limits, and sibling alternatives. An agent has enough context to select and invoke the tool correctly without needing to inspect other documentation.

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 100%, so the schema already documents every parameter. The description still adds meaningful interpretation: threshold is in the outcome's unit with concrete examples, day_close_position is bounded 0..1, dates are YYYY-MM-DD, and outcome choices are enumerated with their units. This goes beyond simply restating the 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?

The description states a specific verb and resource: it computes statistics of historical events matching filters, including sample size, percentiles, long/short/flat shares, and example events. It clearly distinguishes itself from screen_events (listing events) and get_ticker_gap_stats (one ticker's gap history).

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?

It gives an explicit use case, "how do setups like this usually resolve?", and names the alternatives for adjacent needs: screen_events for the list of matching events and get_ticker_gap_stats for one ticker's own gap history. This leaves little ambiguity about when to select this tool.

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.

Resources