Skip to main content
Glama

cross_validate

Evaluates model performance with k-fold cross-validation, returning mean and std of scores. Detects overfitting when train scores exceed test scores, more reliable than a single split.

Instructions

K-fold cross-validation. Returns mean and std of scores across folds. More reliable than a single train/test split. Detects overfitting when train >> test scores. Example: cross_validate(target_column="Revenue", model_type="random_forest", n_folds=5)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
df_nameNo
n_foldsNo
model_typeNorandom_forest
hyperparamsNo
target_columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of transparency. It discloses the return values (mean and std) and the overfitting detection behavior, but it omits details about side effects, prerequisites, or how the output is structured. The example helps but does not cover all behavioral aspects.

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: it starts with the core function, then states the output, gives an advantage, and 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.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 5 parameters, no annotations, and an output schema, but the description leaves df_name and hyperparams undefined, making invocation potentially ambiguous. While the core purpose and benefits are covered, the lack of parameter details and edge-case behavior reduces completeness relative to the tool's complexity.

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?

The input schema has 0% coverage, and the description compensates partially by showing an example with target_column, model_type, and n_folds. However, it does not explain df_name or hyperparams, leaving their meaning unclear. Given the low schema coverage, more parameter clarification would be expected.

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 performs 'K-fold cross-validation' and returns mean and std of scores, making its purpose explicit. It also distinguishes itself from sibling tools by saying it is 'More reliable than a single train/test split', which differentiates it from train_test_split.

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 provides clear usage context, noting it is more reliable than a single split and that it detects overfitting when train scores exceed test scores. It does not explicitly name alternatives or state when not to use it, but the guidance is sufficient for selecting this tool over simpler validation methods.

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