Skip to main content
Glama

plot_confusion_matrix

Generate a confusion matrix heatmap to compare true and predicted labels, enabling deeper diagnosis of classification model errors.

Instructions

Visual confusion matrix heatmap for classification models. Shows true vs predicted labels with counts. Use after evaluate_model for deeper diagnosis. Example: plot_confusion_matrix(model_name="rf_classifier", test_df_name="data_test")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
save_pathNo
model_nameNo
test_df_nameNo
target_columnNo
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral transparency. It discloses the core output (a heatmap with counts) and the recommended timing (after evaluate_model), but it does not mention side effects like saving to a file via save_path, what the function returns, or any required input conditions. The context is useful but incomplete.

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 consists of three concise sentences: purpose, content, and an example. It is front-loaded with the most important information and contains no redundant or irrelevant text. This is a model of conciseness.

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 that there are 4 parameters, no annotations, and no output schema, the description is not contextually complete. It provides a clear purpose and a usage hint but omits explanation of all parameters, return behavior, and edge cases. The bare minimum for a usable tool description is met, but significant gaps remain.

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

Parameters2/5

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

The input schema has 0% description coverage, so the description must compensate. It provides an example using model_name and test_df_name, but it does not explain save_path or target_column, nor does it clarify the implications of leaving all parameters optional. This leaves the user guessing about the full parameter set.

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 that the tool creates a confusion matrix heatmap showing true vs predicted labels with counts. It distinguishes itself from sibling plotting tools by specifying it's for classification models and uses the term 'confusion matrix', which is unique among the listed plot tools. The example invocation further clarifies the tool's scope.

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 explicitly recommends using the tool after evaluate_model for deeper diagnosis, providing a clear workflow context. It doesn't explicitly mention alternatives or when not to use it, but the specificity to confusion matrices implies it is the go-to for that particular diagnostic, which suffices for a score of 4.

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