Skip to main content
Glama

Bin Feature

bin_feature

Convert a numerical column into bins using quantile, uniform, or custom edges learned from training rows, with open-ended first and last bins so unseen test values still map to a bin.

Instructions

Turn a numerical column into bins (e.g. age -> age groups). Bin edges are learned from the training rows only; the first and last bins are open-ended so unseen test values still fall in a bin. Args: dataset_id (str): ID of a dataset or of a split. column (str): Numerical column to bin. bins (int): Number of bins for "quantile" and "uniform", 2 to 50. Default is 5. strategy (str): "quantile" (equal-sized groups), "uniform" (equal-width bins) or "custom". Default is "quantile". edges (list[float], optional): Required for "custom". The inner boundaries, e.g. [18, 65] makes three bins: <=18, 18-65 and >65. Bins include their upper boundary. labels (list[str], optional): Names for the bins (one per bin). If omitted, bins are numbered 0, 1, 2, ... new_column (str, optional): Name of the new column. Default is "_bin". drop_original (bool): Drop the original column. Default is False. Returns: dict: The inner edges used, the number of bins and how many training rows fall in each bin.

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>",
      "column": "<column>"
    },
    "name": "bin_feature"
  }
}

Input Schema

NameRequiredDescriptionDefault
binsNo
edgesNo
columnYes
labelsNo
strategyNoquantile
dataset_idYes
new_columnNo
drop_originalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior2/5

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

No annotations exist, so the description carries the full disclosure burden. It does valuable work — edges are learned from training rows only, first/last bins are open-ended so unseen test values are covered, and bins include their upper boundary — but it never states that the tool mutates the dataset (adds a column, optionally drops the original), whether that change is persisted or reversible, or what happens for non-numeric columns.

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 leading one-liner and example are front-loaded, then a compact Args block with no filler sentences. It is dense but every line carries information an agent needs, so length is justified.

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 an 8-parameter tool with no annotations and no output schema, the definition covers inputs thoroughly and describes the return dict (inner edges, bin count, per-bin training counts). The main remaining gap is dataset-mutation semantics and error behavior, which the description leaves implicit.

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?

With 0% schema description coverage, the description fully compensates: it documents all eight parameters, gives the 2–50 range for bins, states edges is required only for "custom", explains that [18, 65] yields three bins with inclusive upper bounds, and specifies the 1:1 labels-to-bins constraint plus the "<column>_bin" default.

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 first sentence states a precise verb and resource — convert a numerical column into bins — with a concrete example (age -> age groups). It is clearly a feature-engineering transform, but it never distinguishes itself from siblings like create_feature or transform_feature, so an agent must infer which one to pick.

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?

The strategy descriptions ("quantile" equal-sized groups, "uniform" equal-width, "custom" with edges) effectively tell an agent which mode to choose, but nothing says when to use this tool versus create_feature/transform_feature, and no prerequisites or exclusions are given.

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