Skip to main content
Glama

Feature Importance Plot

feature_importance_plot

Generates and saves a bar chart of a trained model's most important features using feature_importances_ or absolute coef_, returning top features with importance values and the image filename.

Instructions

Generate and save a bar chart of the most important features of a trained model. Uses feature_importances_ (tree models) or absolute coef_ (linear models). Args: model_id (str): ID of the trained model. top_n (int): Number of top features to show. Default is 15. Returns: dict: Model ID, top features with importance values, and saved image filename.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model_id": "<model_id>"
    },
    "name": "feature_importance_plot"
  }
}

Input Schema

NameRequiredDescriptionDefault
top_nNo
model_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden. It does disclose two important behaviors on its own: that it performs a write side effect ("save" a chart) and that it returns a dict containing the model ID, top features with importance values, and the saved image filename. It omits what happens on unsupported model types, where the file lands, and whether an existing file is overwritten.

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?

Front-loaded with the core action in the first sentence, then a mechanism sentence, then compact Args/Returns sections. Only minor redundancy in restating the default value already present in the schema; nothing is extraneous.

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 2-parameter tool with no output schema and no annotations, the description is substantially complete: it covers purpose, method selection by model type, both parameters, and the return payload. The remaining gap is failure behavior for unsupported model types and output file location.

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 document both parameters, and it does: model_id as "ID of the trained model" and top_n as "Number of top features to show" with the default restated. Meaning is added beyond the bare schema types, though model_id's expected format and where to obtain it are not clarified.

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?

Uses a specific verb-plus-resource ("Generate and save a bar chart of the most important features of a trained model") and adds the mechanism used (feature_importances_ for tree models, absolute coef_ for linear models). This clearly distinguishes it from sibling plot tools like confusion_matrix_plot, residual_plot, and prediction_plot, though it never names an alternative explicitly.

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 applicability by naming the model families it supports (tree and linear models), which is useful selection context. However it gives no explicit when/when-not guidance relative to feature_selection or the other plot siblings, and no prerequisites such as requiring a fitted model.

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

Deploy Server

Other Tools