Skip to main content
Glama

polynomial_features

Generate polynomial and interaction features from numeric columns to capture non-linear relationships when linear models underfit. Use degree and interaction_only to control terms.

Instructions

Create polynomial and interaction features from numeric columns. degree=2 creates x^2 and x1*x2 terms. interaction_only=True skips powers (x^2). Use when linear models underfit: polynomial features capture non-linear relationships. Example: polynomial_features(columns=["Revenue","Weight"], degree=2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
degreeNo
columnsYes
df_nameNo
interaction_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses key behaviors (degree=2 creates x^2 and x1*x2, interaction_only=True skips powers). However, it does not state whether the tool modifies the existing dataframe or returns a new one, nor how df_name is used.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences total: purpose, parameter behavior, usage guidance, and an example. Every sentence earns its place with no filler or redundancy.

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 a 4-parameter tool with no annotations, the description covers the core transformation, usage context, and example. The output schema likely covers return values, so the main gap is the lack of explanation for df_name.

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

Parameters4/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. It explains degree and interaction_only in behavioral terms and provides an example for columns. df_name is left unexplained, but the other parameters receive meaningful elaboration.

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?

Description uses a specific verb ('Create') and resource ('polynomial and interaction features from numeric columns'), clearly distinguishing it from sibling feature engineering tools. It also explains the behavior of degree and interaction_only, making the function unambiguous.

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?

States 'Use when linear models underfit: polynomial features capture non-linear relationships,' which is clear context for when to apply the tool. It does not mention exclusions or alternatives, but the guidance is specific and actionable.

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