Skip to main content
Glama

bin_column

Discretize numeric columns into categorical bins using quantile, uniform, or custom edge methods. Create meaningful categories for analysis and modeling.

Instructions

Discretize a numeric column into bins/categories. Methods: 'quantile' (equal-frequency bins), 'uniform' (equal-width bins), 'custom' (provide bin edges as list). For custom bins, pass bins as a list of edges, e.g. [0, 100, 1000, float('inf')]. Example: bin_column(column="Revenue", bins=3, method="quantile", labels=["low","medium","high"]) Example: bin_column(column="Revenue", bins=[0,500,5000,1e9], method="custom", labels=["small","medium","large"])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
binsNo
columnYes
labelsNo
methodNoquantile
df_nameNo
new_columnNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It explains the supported methods and custom binning format but does not state whether the operation mutates data, handles missing values, or requires a specific dataframe context. Some transparency is provided via examples.

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 description is concise and front-loaded with the main purpose, followed by method details and illustrative examples. Every sentence contributes to understanding, though the examples add length they are valuable.

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

Completeness3/5

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

The tool has six parameters and moderate complexity. The description covers the core binning logic and methods well, but omits criteria for dataframe selection and output column naming. The presence of an output schema likely reduces the need to describe return values, so completeness is adequate but not thorough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It adds meaning for 'bins' (integer vs list), 'method', and provides examples for 'column' and 'labels'. However, 'df_name' and 'new_column' are not explained, leaving gaps for those parameters.

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 clearly states the tool discretizes numeric columns into bins/categories, using a specific verb and resource. It does not explicitly contrast with sibling encoding tools, but the numeric binning purpose is distinct enough.

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 description implies when to use the tool (for binning numeric columns) and demonstrates its methods with examples. It lacks explicit guidance on when not to use it versus alternatives like label encoding or normalization.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AstyanM/mcp-data-science'

If you have feedback or need assistance with the MCP directory API, please join our Discord server