Skip to main content
Glama

Select Features

select_features

Ranks numerical features by model importance and drops weak ones, with options to keep top k or above a threshold and optionally only report the ranking.

Instructions

Model-based feature selection: fit a model on the training rows, rank the numerical features by importance and drop the weak ones. (feature_selection in preprocessing uses simple statistical filters instead.) Only numerical features are scored; other columns are kept untouched. Missing values must be imputed first. Args: dataset_id (str): ID of a dataset or of a split. With a split the target is known already. target_column (str, optional): Required when dataset_id is a dataset. method (str): "random_forest" (importance from a random forest) or "lasso" (L1 regularisation, regression only). Default is "random_forest". k (int, optional): Keep the k most important features. threshold (float, optional): Keep features whose normalised importance (importances sum to 1) is at least this value. If neither k nor threshold is given: random_forest keeps features above the average importance, lasso keeps non-zero ones. apply (bool): Drop the unselected features. If False, only report the ranking. Default is True. random_state (int): Seed. Default is 42. Returns: dict: Ranked importances, the selected and dropped features, and whether the data was changed.

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": {
      "dataset_id": "<dataset_id>"
    },
    "name": "select_features"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNo
applyNo
methodNorandom_forest
thresholdNo
dataset_idYes
random_stateNo
target_columnNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/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 largely meets it: it discloses the mutation (dropping columns), the `apply=False` report-only mode, the exact fallback rules when neither k nor threshold is supplied, that lasso is regression-only, and what the return dict contains including whether data was changed. It stops short of saying whether dropped columns are recoverable or whether the change is applied to the original dataset or a copy, which is material for a destructive operation.

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 followed by a clear Args/Returns block; nearly every line carries information. The sibling comparison is placed mid-sentence in the opening line, slightly interrupting the primary statement, but overall the structure is efficient.

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?

For a seven-parameter mutation tool with no annotations and no output schema, the definition covers inputs, defaults, conditional requirements, fallback selection rules, and return contents. Nothing an agent needs in order to call it correctly appears to be missing.

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 it documents all seven parameters: dataset_id (dataset vs split semantics), target_column (conditionally required), method (the two allowed values plus default), k, threshold (with normalised-importance definition and the neither-given fallback behavior), apply, and random_state. This adds substantial meaning beyond the bare JSON types.

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?

Opens with a specific verb+resource+mechanism: 'fit a model on the training rows, rank the numerical features by importance and drop the weak ones.' It also explicitly contrasts itself with the sibling `feature_selection`, so an agent can distinguish the two without opening either schema.

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

Usage Guidelines5/5

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

Names the alternative ('feature_selection in preprocessing uses simple statistical filters instead'), states prerequisites ('Missing values must be imputed first'), scope limits ('Only numerical features are scored'), and the conditional requirement on target_column when dataset_id is a dataset versus a split. Exclusions and preconditions are all present.

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