Skip to main content
Glama

feature_importance

Rank features by predictive power using tree-based models or mutual information. Returns a ranked list with importance scores to focus modeling on key variables.

Instructions

Compute feature importance using tree-based model or mutual information. Methods: 'random_forest', 'mutual_info_classif', 'mutual_info_regression'. Returns ranked list of features with importance scores. Run after all encoding and feature engineering. Ranks features by predictive power. Helps focus modeling on most important features. Example: feature_importance(target_column="Revenue", method="random_forest", top_n=20)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNo
methodNorandom_forest
df_nameNo
target_columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Since there are no annotations, the description must disclose behavioral traits. It states the output (ranked list) and the available methods, and implies a read-only computation. However, it does not explicitly confirm that the dataframe is not modified, what inputs are required (e.g., preprocessed numeric data), or how missing values are handled. This leaves a moderate gap in transparency.

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 front-loaded with the core verb and resource, then lists methods, output, usage guidance, and an example. It is slightly verbose but each sentence contributes useful information. No redundant fluff, though it could be tightened by removing the vague 'Ranks features by predictive power' sentence.

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 output schema exists, so the return structure is known. Given the tool's moderate complexity and the lack of annotations, the description covers the main purpose, usage timing, methods, and provides an example. However, it does not explain the df_name parameter, potential prerequisites (e.g., encoded data), or possible limitations (e.g., only works for classification vs regression). Overall, it is mostly complete but leaves a few 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 0% description coverage for parameters, so the description must compensate. It explains the 'method' options, shows usage of 'target_column' and 'top_n' in an example, but omits 'df_name'. This partial coverage adds meaning for three of four parameters, but the missing df_name parameter remains unexplained, making the parameter semantics adequate but incomplete.

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 computes feature importance using tree-based models or mutual information and returns a ranked list of features with scores. It uses a specific verb ('Compute') and resource ('feature importance'), and naturally distinguishes itself from sibling tools like correlation_filter, drop_low_importance, and plot_feature_importance_model by focusing on ranking predictive power.

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 provides explicit timing guidance: 'Run after all encoding and feature engineering.' It also explains the purpose ('Ranks features by predictive power. Helps focus modeling on most important features.'). While it does not explicitly state when not to use it or name alternatives, the context is clear enough for an agent to choose this over other feature-related tools.

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