Skip to main content
Glama

Confusion Matrix Plot

confusion_matrix_plot

Generate and save a confusion matrix for a trained classification model's test data, with optional row normalization, to evaluate class-level prediction performance.

Instructions

Generate and save a confusion matrix of a classification model on its test data. Args: model_id (str): ID of the trained classification model. normalize (bool): Show each row as a fraction of its true class. Default is False. Returns: dict: Model ID, classes, confusion matrix 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": "confusion_matrix_plot"
  }
}

Input Schema

NameRequiredDescriptionDefault
model_idYes
normalizeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose meaningful behavior: the tool saves a file and returns model ID, classes, matrix values, and the saved image filename, which is more than the schema alone reveals. However, it omits where the file is written, whether an existing plot is overwritten, and what happens if the model is untrained or not a classifier.

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 one-line summary is front-loaded and the Args/Returns breakdown is compact and scannable, with no redundant filler. The docstring-style formatting is slightly mechanical but every line carries information.

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?

With no output schema, the Returns section usefully enumerates what the agent gets back, and both parameters are documented despite zero schema coverage. For a simple two-parameter plotting tool this is close to complete; only artifact location and error behavior are missing.

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, and it largely does: model_id is defined as the ID of the trained classification model and normalize is explained as showing each row as a fraction of its true class with a stated default. It does not say how to obtain a valid model_id or what an invalid ID yields, leaving a minor gap.

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?

The description leads with a specific verb+resource: 'Generate and save a confusion matrix of a classification model on its test data,' which tells an agent exactly what the tool produces and that it writes an image file. It does not distinguish itself from the sibling 'confusion_matrix' (presumably the non-plotting variant), so the agent must infer that difference from names alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use guidance, no statement of prerequisites (e.g., model must already be trained), and no routing to or away from siblings such as 'confusion_matrix' or 'classification_report'. Usage is only implied by the phrase 'on its test data.'

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