Skip to main content
Glama

backtest

Evaluate one forecasting plan across cross-validation folds using a create_cv ID, saving fold predictions and metrics to uniquely named CSV files and returning an ID for comparison.

Instructions

Backtest one plan with a cv id of create_cv: metrics over the folds, with the predictions and metrics in CSV files named by the new id, so no run overwrites another. To rank several configurations, use compare. Returns a backtest id.

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": {
      "cv_id": "<cv_id>"
    },
    "name": "backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
cv_idYesId returned by `create_cv`.
plan_idNoPlan to backtest, built from the same profile. Null for the plan the cross-validation strategy was built for.
confirm_costNoConfirms an expensive run (above 50 estimator fits, or 2000 inference windows of a foundation model), only once the user chose it: the number of its cost that `create_cv` or the error of a call without it gives (its estimator fits; its inference windows when only those are above). Without it, or with another number, such a run is an error and nothing runs. Ignored below the thresholds.

Output Schema

NameRequiredDescriptionDefault
idYes
costNo
kindYes
filesNo
linksNo
noticesNo
summaryYes
changeableNo
notices_omittedNo
values_includedNo
summary_truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / confirm_cost
      Added value: +{
      +  "anyOf": [
      +    {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Confirms an expensive run (above 50 estimator fits, or 2000 inference windows of a foundation model), only once the user chose it: the number of its cost that `create_cv` or the error of a call without it gives (its estimator fits; its inference windows when only those are above). Without it, or with another number, such a run is an error and nothing runs. Ignored below the thresholds."
      +}
    • changedOutput schema / description
      Previous value: -"Envelope returned by the tools that create an object, and by\n`describe_object`.\n\nAttributes\n----------\nid : str\n    Id of the object, to pass to the tools that take it.\nkind : str\n    Kind of the object: `'profile'`, `'plan'`, `'cv'`, `'backtest'`,\n    `'comparison'` or `'forecast'`.\nlinks : dict\n    Ids of related objects: those it was built from (`profile_id`,\n    `plan_id`, `cv_id`, and `parent_plan_id` for a refined plan), the\n    plan of the winner of a comparison (`best_plan_id`), and the\n    comparison a winning plan comes from (`comparison_id`).\nsummary : str\n    Plain-text description of the object (`describe()` of the core),\n    cut to 20,000 characters.\nsummary_truncated : bool\n    Whether `summary` was cut; the full text is then in\n    `files['summary']`.\nnotices : list of ToolNotice\n    Warnings the call emitted, the first 20 distinct ones. Deprecation\n    warnings go to the log of the server instead, and the failures of\n    the candidates of a comparison are in its result.\nnotices_omitted : int\n    Number of distinct warnings left out of `notices`.\nfiles : dict\n    Absolute paths of the files written for the object, by role:\n    `predictions` and `metrics` (CSV with the index) of a backtest or a\n    forecast, `leaderboard`, `best_predictions` and `best_metrics` of a\n    comparison, and `summary` when the summary was cut.\nvalues_included : bool\n    Always False: the response holds no rows of the data or of the\n    predictions. The summary carries statistics of the predictions, the\n    metrics and the leaderboard of a comparison; the rows are in\n    `files`.\ncost : dict, None\n    Cost of a cross-validation strategy, a backtest or a comparison:\n    `n_folds`, `n_fits` (trainings of the forecaster in the shared\n    strategy), `estimator_fits` (fits of an estimator, which a direct\n    forecaster multiplies by `steps`) and `inference_windows` (the\n    cost of a foundation model, never trained: one forecast per series\n    and fold; 0 for the other forecasters); for a comparison, the last\n    two are sums over its candidates. A cross-validation strategy also\n    has `compare_estimator_fits` and `compare_inference_windows`, those\n    of a comparison without candidates with it. None for the other\n    kinds.\nchangeable : list of str\n    Arguments of `refine_plan` (for a plan) or of `create_cv` (for a\n    cross-validation strategy) that build a variant of the object.\n    Empty for the other kinds."New value: +"Envelope returned by the tools that create an object, and by\n`describe_object`.\n\nAttributes\n----------\nid : str\n    Id of the object, to pass to the tools that take it.\nkind : str\n    Kind of the object: `'profile'`, `'plan'`, `'cv'`, `'backtest'`,\n    `'comparison'` or `'forecast'`.\nlinks : dict\n    Ids of related objects: those it was built from (`profile_id`,\n    `plan_id`, `cv_id`, and `parent_plan_id` for a refined plan), the\n    plan of the winner of a comparison (`best_plan_id`), and the\n    comparison a winning plan comes from (`comparison_id`).\nsummary : str\n    Plain-text description of the object (`describe()` of the core),\n    cut to 20,000 characters.\nsummary_truncated : bool\n    Whether `summary` was cut; the full text is then in\n    `files['summary']`.\nnotices : list of ToolNotice\n    Warnings the call emitted, the first 20 distinct ones. Deprecation\n    warnings go to the log of the server instead, and the failures of\n    the candidates of a comparison are in its result.\nnotices_omitted : int\n    Number of distinct warnings left out of `notices`.\nfiles : dict\n    Absolute paths of the files written for the object, by role:\n    `predictions` and `metrics` (CSV with the index) of a backtest or a\n    forecast, `leaderboard`, `best_predictions` and `best_metrics` of a\n    comparison, and `summary` when the summary was cut.\nvalues_included : bool\n    Always False: the response holds no rows of the data or of the\n    predictions. The summary carries statistics of the predictions, the\n    metrics and the leaderboard of a comparison; the rows are in\n    `files`.\ncost : dict, None\n    Cost of a cross-validation strategy, a backtest or a comparison:\n    `n_folds`, `n_fits` (trainings of the forecaster),\n    `estimator_fits` (fits of an estimator, which a direct forecaster\n    multiplies by `steps`) and `inference_windows` (the cost of a\n    foundation model, never trained: one forecast per series and fold;\n    0 for the other forecasters). For a comparison, `n_folds` is that\n    of the shared strategy and the other three are totals over all its\n    candidates, the baseline included, counted before they run (a\n    candidate that fails while it runs counts too; one whose plan\n    cannot be built, or that fails the checks of `backtest`, runs\n    nothing and does not). A cross-validation\n    strategy also has `compare_estimator_fits` and\n    `compare_inference_windows`, those of a comparison without\n    candidates with it. Above 50 estimator fits, or 2000 inference\n    windows, `backtest` and `compare` run only with `confirm_cost` set\n    to the estimator fits (the inference windows, when only those are\n    above). None for the other kinds.\nchangeable : list of str\n    Arguments of `refine_plan` (for a plan) or of `create_cv` (for a\n    cross-validation strategy) that build a variant of the object.\n    Empty for the other kinds."
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare that this is a non-readOnly, closed-world, non-destructive operation. The description goes beyond that by disclosing the side effects — CSV files are written and named by the new id, so concurrent runs do not overwrite each other — and that an id is returned. It does not discuss file locations, storage growth, or cost gating, but the last is covered by the schema.

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?

Three tight sentences, front-loaded with the action and scope, then the alternative, then the return value. The only minor waste is the repeated mention that the cv id comes from `create_cv`, which the schema already states.

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?

An output schema exists, so return values need no elaboration, and the intricate cost-confirmation workflow is fully described in the schema. The description covers purpose, alternative, and file-emission side effects adequately for a three-parameter tool, with only the cost-gating precondition left implicit.

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

Parameters3/5

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

Schema coverage is 100%, so all three parameters are already documented, including the detailed `confirm_cost` contract. The description only reinforces that `cv_id` comes from `create_cv` and that a single plan is backtested, adding little meaning beyond the schema. Baseline 3 applies.

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?

States a specific verb and resource ('Backtest one plan with a cv id of `create_cv`') and adds concrete scope: metrics over the folds, predictions and metrics written to CSV files, and a returned backtest id. It also names the sibling it is not ('To rank several configurations, use `compare`'), so an agent can separate it from the ranking tool without opening either 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?

Explicitly routes multi-configuration ranking to `compare` and implies the prerequisite of holding a cv id from `create_cv`. There is no statement about what to do when the run trips the cost threshold, but that condition is fully specified in the schema's `confirm_cost` parameter.

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