Skip to main content
Glama

Rank Models

rank_models

Ranks trained machine-learning models by stored metrics without retraining, helping compare candidates and flag mixed splits or overfitting.

Instructions

Rank models that are already trained (by any training tool or compare_models) using their stored metrics. Nothing is retrained. Models are only comparable when they predict the same target; models trained on different splits are ranked too, but flagged because their test rows differ. Args: model_ids (list[str], optional): Models to rank. Default: every trained model (narrowed by split_id / task). split_id (str, optional): Only rank models trained on this split. task (str): "auto", "regression" or "classification". With "auto" all chosen models must be of one task. sort_by (str, optional): Metric to rank by. Regression: r2 (default), mae, mse, rmse, mape_percent. Classification: f1 (default), accuracy, balanced_accuracy, precision, recall, roc_auc, f1_macro. dataset (str): "test" (default) or "train". Ranking by train rewards overfitting; use it for diagnosis only. top_n (int, optional): Only list the best n models (ranks are still computed over all of them). Returns: dict: ranking (rank, model_id, algorithm, score, train and test metrics, generalisation gap), best_model_id, models skipped (no stored metrics) and notes (ties, mixed splits, overfitting).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "rank_models"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskNoauto
top_nNo
datasetNotest
sort_byNo
split_idNo
model_idsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and does well: it discloses that no retraining occurs, that models trained on different splits are still ranked but flagged, that models without stored metrics are skipped and reported, and that ties/overfitting appear in notes. Still missing are cost/scale expectations for large model sets and any failure modes for empty selections.

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?

Front-loaded with the core sentence and the no-retraining constraint before the parameter list. The Args/Returns block is dense but nearly every line adds information an agent needs; a few details (metric lists, notes contents) could be compressed but remain useful given zero schema coverage.

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?

Complete enough for a 6-parameter, all-optional analysis tool with no output schema: it documents every parameter and describes the return dict's fields, including generalisation gap, best_model_id, skipped models, and notes. Minor gap is the absence of guidance on expected input volume or behavior when no model has metrics.

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?

Schema coverage is 0%, and the description fully compensates: it enumerates task values, lists the exact sort_by metrics per task type with defaults (r2, f1), gives dataset options with a warning about the train option, and clarifies that top_n restricts output while ranks are still computed over all models. model_ids and split_id defaults and narrowing behavior are also explained.

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?

Specific verb+resource ("Rank models that are already trained") plus the key scope qualifier "Nothing is retrained", which distinguishes it from compare_models and training tools in the sibling list. It also states the data source (stored metrics), so an agent knows no new computation is triggered.

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?

Gives explicit conditions: models are only comparable on the same target, train-dataset ranking is "for diagnosis only" because it rewards overfitting, and with task="auto" all chosen models must share one task. It stops short of naming compare_models as the preceding step or telling the agent when to prefer this over benchmark_models.

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

Deploy Server

Other Tools