Skip to main content
Glama

compare_models

Compare multiple model types using cross-validation and get a ranked table to select the best model before hyperparameter tuning.

Instructions

Compare multiple model types using cross-validation. Returns a ranked table. Quick way to find the best model type before fine-tuning hyperparameters. Default models: linear_regression, random_forest, gradient_boosting (or classifiers if target is categorical). Example: compare_models(target_column="Revenue", model_types=["linear_regression","random_forest","gradient_boosting"])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
df_nameNo
n_foldsNo
model_typesNo
target_columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It transparently states that it uses cross-validation, returns a ranked table, and adapts default models based on target type. It does not disclose potential computational cost or side effects, but for a read-only comparison tool, this is sufficient. No contradiction with annotations (none provided).

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 concise and well-structured. The first sentence states the core action, the second gives the value proposition, the third explains defaults, and the fourth provides a concrete example. Every sentence adds value without redundancy.

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 model comparison tool with an output schema, the description covers the main aspects: purpose, return value, defaults, and an example. It does not explain df_name or n_folds parameters in the text, but these are common across sibling tools and have sensible defaults. The presence of an output schema reduces the need to describe return format in detail.

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 description coverage is 0%, so the description must compensate. It explains model_types by giving defaults and conditional behavior ('or classifiers if target is categorical') and shows an example with target_column. However, n_folds and df_name are not explicitly explained, though their names and schema defaults provide some context. Partial compensation warrants a 3.

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 clearly states the tool's purpose: 'Compare multiple model types using cross-validation. Returns a ranked table.' It uses a specific verb (compare) and resource (model types), and distinguishes itself from sibling tools like train_model and evaluate_model by focusing on comparison before hyperparameter tuning.

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?

The description gives a clear context for when to use the tool: 'Quick way to find the best model type before fine-tuning hyperparameters.' This implies the tool is for initial model selection, but it does not explicitly mention alternatives or when not to use it. It also notes the default behavior, adding practical guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AstyanM/mcp-data-science'

If you have feedback or need assistance with the MCP directory API, please join our Discord server