Skip to main content
Glama

train_model

Train a predictive model to forecast a target column using numeric features. Supports linear regression, logistic regression, random forest, gradient boosting, and decision tree, saving the model for later evaluation and prediction.

Instructions

Train a model. Types: 'linear_regression', 'logistic_regression', 'random_forest', 'gradient_boosting', 'decision_tree'. The model is stored for later predict/evaluate. Start with simple model (linear/logistic) as baseline. Only move to complex models (random_forest, gradient_boosting) if baseline is insufficient. Uses ALL numeric columns as features. Example: train_model(target_column="Revenue", model_type="random_forest")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_nameNo
model_typeNorandom_forest
hyperparamsNo
target_columnYes
train_df_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that the model is stored for later predict/evaluate and that ALL numeric columns are used as features. However, it does not mention potential side effects like overwriting existing models, handling of missing values, or data requirements beyond that.

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?

The description is well-structured: it opens with the core purpose, lists options, gives strategic guidance, and ends with a concrete example. Every sentence adds value, though the list of model types could be considered somewhat lengthy.

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?

Given the tool has 5 parameters, no annotations, and an output schema, the description covers the core purpose and usage strategy but misses key details about parameters and data expectations. It is adequate for an initial understanding but incomplete for safe and effective invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides zero description coverage, so the description must compensate. It explains the values for 'model_type' and gives an example using 'target_column', but completely neglects 'model_name', 'hyperparams', and 'train_df_name'. This leaves three parameters semantically unexplained.

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 begins with the specific verb 'Train' and resource 'a model', followed by a clear list of model types. It distinguishes itself from sibling tools like predict and evaluate_model by explicitly stating that the trained model is stored for later use.

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 explicit guidance: start with a simple baseline model and only move to complex models if the baseline is insufficient. This is clear when-to-use advice, though it does not explicitly mention alternatives or when not to use this tool.

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