Skip to main content
Glama

Xgboost Regressor

xgboost_regressor

Train a regularised gradient-boosting regression model on a prepared numeric split to get train/test R2, MAE, MSE, RMSE, MAPE, top features, and warnings.

Instructions

Train an XGBoost regressor: fast, regularised gradient boosting. Requires the optional xgboost package. 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. n_estimators (int): Number of boosting rounds. Default is 100. learning_rate (float): Shrinkage per round, greater than 0. Default is 0.1. max_depth (int): Depth of each tree. Default is 6. subsample (float): Fraction of rows used per tree, in (0, 1]. Default is 1.0. colsample_bytree (float): Fraction of features used per tree, in (0, 1]. Default is 1.0. 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": "xgboost_regressor"
  }
}

Input Schema

NameRequiredDescriptionDefault
split_idYes
max_depthNo
subsampleNo
n_estimatorsNo
random_stateNo
learning_rateNo
colsample_bytreeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses the optional dependency, the input data constraints, sensible defaults for all hyperparameters, and what the training run produces (metrics, top features, warnings). It does not mention training cost, failure modes on non-numeric data, or whether a model is persisted for later reuse.

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?

Front-loaded purpose sentence, then constraints, then an Args/Returns block — easy to scan. Slightly verbose in repeating defaults that also live in the schema, but no sentence is wasted.

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 7-parameter training tool with no output schema and no annotations, the definition supplies prerequisites, per-parameter semantics, and an explicit list of return keys. Minor gaps remain around error behavior and model lifecycle, but an agent has enough to invoke it correctly.

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%, so the description must compensate and does: every one of the seven parameters is documented with type, meaning, valid range (e.g. subsample in (0, 1]), and default value. This is meaningfully more than the bare schema provides.

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 an XGBoost regressor") with a short qualifier on the algorithm's character (fast, regularised gradient boosting). The name itself distinguishes it from xgboost_classifier, but the description never explicitly contrasts it with other regressors such as gradient_boosting_regressor or random_forest_regressor.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Useful preconditions are given: the xgboost package must be installed, split_id must come from train_test_split, and features must be numerical and complete with no scaling required. However, there is no guidance on when to pick this over the sibling regressors, which is the main selection decision an agent faces.

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