Skip to main content
Glama

Xgboost Classifier

xgboost_classifier

Train a regularised gradient boosting classifier on a prepared train/test split with numerical, complete features; get train/test metrics, top features, and warnings for classification evaluation.

Instructions

Train an XGBoost classifier: fast, regularised gradient boosting. Requires the optional xgboost package. Any class labels work (text labels are encoded internally). 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 (accuracy, precision, recall, F1, ROC-AUC), 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_classifier"
  }
}

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.3/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, internal label encoding, the data-completeness constraint, and that a model_id plus metrics and warnings come back. It doesn't say whether the fitted model is persisted server-side or how heavy training is, which keeps it from a 5.

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 single-sentence summary is front-loaded and the Args/Returns blocks are clearly delineated and scannable. It is slightly long because defaults are restated from the schema, but the added range constraints justify most lines.

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?

There is no output schema, and the description compensates by enumerating the return dict contents (model_id, accuracy, precision, recall, F1, ROC-AUC, top features, warnings). Combined with the documented preconditions, an agent has everything needed to call 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%, yet every one of the seven parameters is given meaning, type, default and where relevant a range constraint (learning_rate > 0, subsample in (0,1], fraction of rows/features per tree). This fully compensates for the bare 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?

The description opens with a specific verb and resource ("Train an XGBoost classifier") plus a one-line characterization of the algorithm, which is enough to separate it from siblings like gradient_boosting_classifier or random_forest_classifier. It doesn't explicitly name an alternative, so it stops short of a 5.

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?

It states real preconditions: the optional xgboost package is required, the split must come from train_test_split, features must be numerical and complete, and scaling is unnecessary. What's missing is any explicit guidance on when to prefer this over xgboost_regressor or the other classifier siblings.

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