Skip to main content
Glama

plot_feature_importance_model

Generate a bar plot of feature importance from trained tree-based models to identify which features most influence predictions.

Instructions

Bar plot of feature importance from a trained model. Works with tree-based models (random_forest, gradient_boosting, decision_tree). Use after train_model to understand which features drive predictions. Example: plot_feature_importance_model(model_name="random_forest_data_train")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNo
save_pathNo
model_nameNo
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It discloses that only tree-based models are supported, and the example shows expected usage. But it omits behavioral details such as how save_path is used, what happens if the model is unsupported, whether the plot is displayed or saved, and any side effects. This is a significant gap for a tool with no annotation safety hints.

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?

The description is three sentences, front-loaded with the main purpose. It efficiently covers what the tool does, supported models, usage sequence, and includes a concrete example. Every sentence contributes value, and there is no redundancy or filler.

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

Completeness2/5

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

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description provides the essential purpose and example but leaves critical operational gaps unaddressed. Specifically, top_n and save_path semantics are undocumented, error conditions for unsupported models are not stated, and the description does not explain whether the plot is displayed or saved. While the output type is clear, the missing parameter details and behavioral caveats make the description incomplete for reliable invocation.

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

Parameters1/5

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

The schema has 0% description coverage, so the description must compensate. It only mentions model_name in the example ('model_name="random_forest_data_train"') but does not explain top_n or save_path, nor does it define model_name beyond the example. The description adds no meaningful parameter semantics beyond what the parameter names infer (e.g., top_n suggests a limit but not its role).

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 states a specific verb and resource: 'Bar plot of feature importance from a trained model.' It distinguishes from sibling tools like feature_importance (which likely computes values) and permutation_importance (different method) by clarifying it produces a plot and works with tree-based models. The example reinforces the purpose.

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 explicit context: 'Use after train_model to understand which features drive predictions.' It also scopes supported model types (random_forest, gradient_boosting, decision_tree). However, it doesn't mention alternatives like feature_importance or permutation_importance for numerical importance, so it stops short of explicit when-not-to-use guidance.

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