Skip to main content
Glama

Backtest a StockCharts scan

backtest_stockcharts_scan
Idempotent

Answers 'backtest my StockCharts scan on real history.' Give a scan and a start date; optionally end, symbols (e.g. a ChartList) to restrict the universe, top_n (default 50) and rebalance (D/W/M/Q, default W). Each rebalance holds the stocks that pass the scan, equally weighted up to top_n, at 10 bps costs, on point-in-time US stocks since 2000 with delisted names included. Returns the translation plus the same stats, benchmark and equity curve as run_backtest. Costs one backtest; free keys cover the last 12 months.

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": {
      "scan": "<scan>",
      "start": "<start>"
    },
    "name": "backtest_stockcharts_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNo
scanYesStockCharts scan text.
as_ofNoPoint-in-time cutoff (YYYY-MM-DD). Nothing dated after this is returned, preventing look-ahead bias. Defaults to today (UTC).
startYes
top_nNoMax names held (default 50).
symbolsNoOptional universe, e.g. a ChartList.
rebalanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations (which only declare non-readonly, idempotent, non-destructive, closed-world), it discloses the portfolio construction rule (equal weight up to top_n), 10 bps costs, the point-in-time US universe since 2000 with delisted names included, and the credit cost ('costs one backtest'). Those are exactly the behavioral facts an agent needs before committing a paid, non-idempotent-looking call.

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?

It is front-loaded with the one-line purpose and then packs parameters, mechanics and limits into two dense sentences with no filler. The middle sentence is long and slightly run-on, stacking costs, universe and weighting, but every clause carries information.

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 a 7-parameter tool with no output schema, it covers universe, weighting, cost model, point-in-time handling, credit cost and the shape of the return (translation plus stats, benchmark and equity curve as in run_backtest). The main gap is as_of, which is undocumented in the description despite materially affecting results via look-ahead prevention.

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?

With 57% schema coverage it adds meaning the schema lacks: rebalance accepts D/W/M/Q with a default of W (the enum has no description in the schema), symbols is framed as restricting the universe (e.g. a ChartList), and top_n's default of 50 is reinforced alongside the equal-weighting rule. It does not mention as_of, which is documented only in the schema, so it does not fully compensate for the coverage gap.

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 opening sentence states a specific verb and resource ('backtest my StockCharts scan on real history') and the closing sentence distinguishes it from siblings by saying it returns the translation plus the same stats as run_backtest, implicitly separating it from translate_stockcharts_scan and run_backtest. An agent can pick this over its siblings without opening a schema.

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?

It gives clear entry conditions: supply a scan and a start date, with end, symbols, top_n and rebalance as optional refinements, and notes free keys cover only the last 12 months. It stops short of explicit exclusions such as 'use translate_stockcharts_scan if you only want the translation' or 'use run_backtest for native strategies', so routing to alternatives is left partly to inference.

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.