Skip to main content
Glama

create_column

Create a new column from a pandas expression for feature engineering, including ratios and interactions, while preventing division by zero.

Instructions

Create a new column using a pandas eval expression. Columns are referenced by name. For domain-relevant feature engineering: ratios, differences, interactions. Always add epsilon (1e-5) to denominators to avoid division by zero. Example: create_column(new_column="Yield", expression="Revenue / (ChargeableWeight + 1e-5)") Example: create_column(new_column="WeightPerPiece", expression="ChargeableWeight / (Pieces + 1e-5)")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
df_nameNo
expressionYes
new_columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Without annotations, the description carries the burden of behavioral disclosure. It adds useful context about using pandas eval expressions and the epsilon tip, but it does not specify whether an existing column is overwritten, whether the operation modifies the DataFrame in-place, or how the df_name parameter affects which DataFrame is modified.

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 a clear verb and object. The use-case sentence and epsilon guideline earn their place, and the two examples are helpful. It could be slightly more compact by merging the examples, but they add concrete value.

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 is moderately complex (custom eval expressions), and the description covers the core behavior, use cases, and a key tip. However, it omits details about the df_name parameter and potential edge cases like overwriting existing columns. An output schema exists, so return values are likely covered, but the description still leaves some operational gaps.

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?

The schema has no descriptions for the three parameters (coverage 0%), so the description must compensate. The examples clarify new_column and expression (e.g., expression='Revenue / (ChargeableWeight + 1e-5)'), but the df_name parameter, despite having a default, is never mentioned or explained, leaving its semantics ambiguous.

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?

The description clearly states the tool's purpose with a specific verb+resource: 'Create a new column using a pandas eval expression.' It also provides two concrete examples that illustrate the intended use for ratios and interactions, distinguishing it from other feature-engineering siblings like polynomial_features or log_transform.

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?

The description gives context for when to use it: 'For domain-relevant feature engineering: ratios, differences, interactions.' It also provides a practical guideline on adding epsilon to avoid division by zero. However, it does not explicitly mention when not to use it or name alternative tools, falling short of a 5.

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