Skip to main content
Glama

grid_search

Finds optimal hyperparameters by testing all parameter combinations, returns best parameters and score, and saves the best model for later prediction and evaluation.

Instructions

Grid search for hyperparameter tuning. Tests all combinations and stores the best model. Returns the best parameters and score. The best model is saved for later predict/evaluate. Example: grid_search(target_column="Revenue", model_type="random_forest", param_grid={"n_estimators": [50,100,200], "max_depth": [5,10,20]})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
n_foldsNo
model_nameNo
model_typeYes
param_gridYes
target_columnYes
train_df_nameNo

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 discloses key side effects: it saves the best model for later predict/evaluate and returns the best parameters and score. This goes beyond a simple 'does grid search' by explaining the model persistence behavior, though it doesn't mention error conditions or parameter-specific effects.

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 with no wasted words, front-loading the purpose and using a compact example to clarify usage. Each sentence contributes unique information.

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?

The description covers the tool's core behavior, return value, and side effect, and the example clarifies common parameters. However, it omits explanations for the optional parameters and prerequisites, which would be needed for full completeness.

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 example adds meaning to the required parameters (target_column, model_type, param_grid) by showing concrete values and the structure of the param_grid dictionary. However, the description does not explain n_folds, model_name, or train_df_name, which is a gap given the schema has 0% coverage.

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 grid search for hyperparameter tuning, testing all combinations and saving the best model. This distinguishes it from sibling tools like train_model or cross_validate by emphasizing exhaustive search and model persistence.

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 context: it's for hyperparameter tuning, which tells an agent when to use it. However, it doesn't explicitly mention alternatives or when not to use it, so it falls short of a 5.

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