Skip to main content
Glama

compare

Backtests several forecasting configurations on cross-validation folds, ranks them by a chosen metric, and returns the winning plan for forecasting.

Instructions

Backtest several configurations on the folds of a cv id of create_cv and rank them by metric; for one plan, use backtest. Reports progress per candidate and can be cancelled between candidates. Returns a comparison id and the plan of the winner in links.best_plan_id, which forecast takes.

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": "compare"
  }
}

Input Schema

NameRequiredDescriptionDefault
cv_idYesId returned by `create_cv`: every candidate is backtested on its folds.
metricNoMetric of every candidate. Metric, or list of metrics whose first one is the primary metric (the one that ranks); only the ones given are computed. Null for the metric chosen for the plan the strategy was built for, if one was chosen, else the one selected from the data.
baselineNoWhether to add a seasonal naive baseline (ForecasterEquivalentDate) to the ranking.
intervalNoPrediction interval computed for every candidate. Prediction interval as two quantiles [lower, upper] with 0 < lower < upper < 1, e.g. [0.1, 0.9] for 80 %. The baseline and ForecasterStats only take symmetric ones (lower + upper = 1). Null for the interval of the plan the strategy was built for.
candidatesNoConfigurations to compare, each {'name': ..., 'config': {...}}, e.g. [{'name': 'ridge', 'config': {'estimator': 'Ridge'}}]. Null for the candidates recommended by the profile: the forecasters of its family (with several series, ForecasterRecursiveMultiSeries and ForecasterFoundation), or the estimators of the recommended forecaster when that leaves one, without those above 500 estimator fits; plus the plan the strategy was built for, in the row 'Strategy plan', when it is none of them. A list runs only those candidates. The summary names the row of that plan, if any. A candidate that fails is ranked last with its error.
confirm_costNoConfirms an expensive run (all the candidates together above 50 estimator fits, or 2000 inference windows of foundation models), only once the user chose it: the number of its cost that `create_cv` (without `candidates`) or the error of a call without it gives (the estimator fits; the 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. Changed9 schema fields changedv0.1.1
    • changedInput schema / $defs / CandidateArg / properties / name / description
      Previous value: -"Unique name of the candidate, which labels its row of the leaderboard. 'Baseline (seasonal naive)' and 'Baseline (naive)' are reserved for the baseline."New value: +"Unique name of the candidate, which labels its row of the leaderboard. 'Baseline (seasonal naive)' and 'Baseline (naive)' are reserved for the baseline, and 'Strategy plan' for the plan of the strategy."
    • changedInput schema / $defs / CandidateArgs / properties / differentiation / description
      Previous value: -"Order of differencing of the target before training (an integer of at least 1, usually 1 for a trend); predictions are integrated back. Machine learning forecasters only. The candidate runs on a copy of the strategy with this order."New value: +"Order of differencing of the target before training (an integer of at least 1, usually 1 for a trend); predictions are integrated back. Machine learning forecasters only. Candidates with different orders share the strategy."
    • changedInput schema / $defs / CandidateArgs / properties / estimator / description
      Previous value: -"Estimator: one of ['CatBoostRegressor', 'HistGradientBoostingRegressor', 'LGBMRegressor', 'RandomForestRegressor', 'Ridge', 'XGBRegressor'] for the machine learning forecasters, 'Arima' for ForecasterStats, or the Hugging Face model id of a foundation model for ForecasterFoundation (default 'autogluon/chronos-2-small'; model id prefixes: ['amazon/chronos-2', 'autogluon/chronos-2', 'google/timesfm-2.5', 'google/timesfm-3.0', 'Salesforce/moirai-2', 'soda-inria/tabicl', 'priorlabs/tabpfn', 'theforecastingcompany/t0', 'Synthefy/Nori', 'taharnbl/TS-ICL']). ForecasterEquivalentDate takes none."New value: +"Estimator: one of ['CatBoostRegressor', 'HistGradientBoostingRegressor', 'LGBMRegressor', 'RandomForestRegressor', 'Ridge', 'XGBRegressor'] for the machine learning forecasters, 'Arima' for ForecasterStats, or the Hugging Face model id of a foundation model for ForecasterFoundation (default 'autogluon/chronos-2-small'; model id prefixes: ['amazon/chronos-2', 'autogluon/chronos-2', 'google/timesfm-2.5', 'google/timesfm-3.0', 'NX-AI/TiRex-2', 'Salesforce/moirai-2', 'soda-inria/tabicl', 'priorlabs/tabpfn', 'theforecastingcompany/t0', 'Synthefy/Nori', 'taharnbl/TS-ICL', 'mistralai/Timestral']). ForecasterEquivalentDate takes none."
    • changedInput schema / $defs / CandidateArgs / properties / window_features / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "integer"
      -          }
      -        ]
      -      },
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "$ref": "#/$defs/WindowFeatureArgs"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / $defs / Metric / enum
      Previous value: -[
      -  "mean_squared_error",
      -  "mean_absolute_error",
      -  "mean_absolute_percentage_error",
      -  "mean_squared_log_error",
      -  "mean_absolute_scaled_error",
      -  "root_mean_squared_scaled_error",
      -  "median_absolute_error",
      -  "symmetric_mean_absolute_percentage_error"
      -]New value: +[
      +  "mean_squared_error",
      +  "root_mean_squared_error",
      +  "mean_absolute_error",
      +  "mean_absolute_percentage_error",
      +  "mean_squared_log_error",
      +  "mean_absolute_scaled_error",
      +  "root_mean_squared_scaled_error",
      +  "median_absolute_error",
      +  "symmetric_mean_absolute_percentage_error"
      +]
    • addedInput schema / $defs / WindowFeatureArgs
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "One window size and the statistics computed over it; no other key is accepted.",
      +  "properties": {
      +    "stats": {
      +      "description": "Statistics computed over the window.",
      +      "items": {
      +        "enum": [
      +          "mean",
      +          "std",
      +          "min",
      +          "max",
      +          "sum",
      +          "median",
      +          "ratio_min_max",
      +          "coef_variation",
      +          "ewm"
      +        ],
      +        "type": "string"
      +      },
      +      "minItems": 1,
      +      "type": "array"
      +    },
      +    "window_size": {
      +      "description": "Number of observations of the window.",
      +      "minimum": 1,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "stats",
      +    "window_size"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / candidates / description
      Previous value: -"Configurations to compare, each {'name': ..., 'config': {...}}, e.g. [{'name': 'ridge', 'config': {'estimator': 'Ridge'}}]. Null for the candidates recommended by the profile: the forecasters of its family (with several series, ForecasterRecursiveMultiSeries and ForecasterFoundation), or the estimators of the recommended forecaster when that leaves one, without those above 500 estimator fits; plus the plan the strategy was built for, in the row 'Strategy plan', when it is none of them. The summary names the row of that plan. A candidate that fails is ranked last with its error."New value: +"Configurations to compare, each {'name': ..., 'config': {...}}, e.g. [{'name': 'ridge', 'config': {'estimator': 'Ridge'}}]. Null for the candidates recommended by the profile: the forecasters of its family (with several series, ForecasterRecursiveMultiSeries and ForecasterFoundation), or the estimators of the recommended forecaster when that leaves one, without those above 500 estimator fits; plus the plan the strategy was built for, in the row 'Strategy plan', when it is none of them. A list runs only those candidates. The summary names the row of that plan, if any. A candidate that fails is ranked last with its error."
    • addedInput schema / properties / confirm_cost
      Added value: +{
      +  "anyOf": [
      +    {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Confirms an expensive run (all the candidates together above 50 estimator fits, or 2000 inference windows of foundation models), only once the user chose it: the number of its cost that `create_cv` (without `candidates`) or the error of a call without it gives (the estimator fits; the 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.4/5.0
Behavior4/5

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

Beyond the annotations, the description discloses that progress is reported per candidate, the operation can be cancelled between candidates, and it returns a comparison id plus the winner in `links.best_plan_id`. It does not mention the expensive-run confirmation behavior covered by `confirm_cost`, but the annotations and schema carry that safety and cost detail.

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 three tight sentences, front-loaded with the primary action and followed by operational behavior and return information. Every sentence adds useful information without repetition.

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 complex comparison tool, it covers the main workflow, the single-plan alternative, cancellation behavior, and the key return value. The remaining gap is that expensive-run confirmation and candidate defaulting are left entirely to the detailed schema, which is acceptable but leaves the description slightly less complete than it could be.

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 the schema already documents the six parameters in detail. The description reinforces that configurations are compared on cv folds and ranked by `metric`, but it adds little parameter-level meaning beyond 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 uses a specific verb and resource: backtest several configurations on the folds of a cv id from `create_cv`, then rank them by `metric`. It clearly distinguishes itself from the sibling `backtest` by saying that tool should be used for one plan.

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 explicitly says when to use this tool versus the alternative: several configurations here, one plan with `backtest`. It also ties the required `cv_id` to `create_cv`, giving the prerequisite context an agent needs.

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