Skip to main content
Glama

Decision Tree Regressor

decision_tree_regressor

Train an interpretable decision tree regression model on numerical, complete data from a prepared split, with optional depth limits, and return train/test metrics, top features, and warnings.

Instructions

Train a decision tree regressor. Easy to interpret, captures non-linear effects, but overfits easily when max_depth is not limited. The split must have only numerical, complete features (no scaling is needed). Args: split_id (str): ID of a split made by train_test_split. max_depth (int, optional): Maximum tree depth. Default is None (unlimited); 3-10 is a common range. min_samples_split (int): Minimum rows needed to split a node. Default is 2. min_samples_leaf (int): Minimum rows in a leaf. Default is 1. random_state (int): Seed. Default is 42. Returns: dict: model_id, train/test metrics (R2, MAE, MSE, RMSE, MAPE), top features and warnings.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "split_id": "<split_id>"
    },
    "name": "decision_tree_regressor"
  }
}

Input Schema

NameRequiredDescriptionDefault
split_idYes
max_depthNo
random_stateNo
min_samples_leafNo
min_samples_splitNo

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 it does disclose real behavior: hard data preconditions (numerical, no missing values, no scaling), an overfitting caveat, per-parameter defaults, and a concrete return shape including warnings. Gaps remain around training cost, whether returned warnings signal failure, and whether the model persists server-side for later use.

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?

Front-loaded purpose sentence followed by a caveat, a data precondition, a clean Args block, and a Returns line. Every sentence carries information an agent needs; nothing is redundant filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

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

With no output schema and no annotations, the description supplies parameter meaning, prerequisites, the return dict contents, and model limits. That is enough for an agent to invoke it correctly and interpret the result.

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 description coverage is 0%, yet the description documents all five parameters with types, defaults, and practical meaning - max_depth explaining None means unlimited plus a recommended 3-10 range, min_samples_split/leaf node semantics, and random_state as seed. This fully compensates for the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Train a decision tree regressor') and immediately characterizes the model's trade-offs (interpretable, non-linear, overfit-prone). It does not name or contrast itself with the many sibling regressors (random_forest_regressor, gradient_boosting_regressor, xgboost_regressor), so an agent must infer that differentiation itself.

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?

Clear context is given: it needs a split_id produced by train_test_split, requires numerical and complete features, and warns that unlimited depth overfits (3-10 typical). There is no explicit exclusion or 'prefer X tool when accuracy matters' routing, so the agent gets context but not alternatives.

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