Skip to main content
Glama

Classification Report

classification_report

Compute per-class precision, recall, F1, support, accuracy, and macro/weighted averages from a trained model or true/predicted label lists, with optional ROC-AUC for models.

Instructions

Per-class precision, recall, F1 and support, plus accuracy and macro / weighted averages. Use EITHER a trained classification model (model_id) OR your own lists of true and predicted labels. Args: model_id (str, optional): ID of a trained classification model. The report is recomputed from its stored data. dataset (str): "test", "train" or "both". Only used with model_id. Default is "test". y_true (list, optional): True labels (use together with y_pred). y_pred (list, optional): Predicted labels, same length as y_true. Returns: dict: accuracy, per_class metrics, averages, a printable text table and (for a model) ROC-AUC.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "classification_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
y_predNo
y_trueNo
datasetNotest
model_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does meaningful work: it discloses that the report is recomputed from the model's stored data (implying it may differ from training-time figures), specifies defaults, and enumerates the return payload including ROC-AUC for the model path. It does not cover failure behavior for mismatched-length y_true/y_pred or a missing model_id, which leaves a gap.

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 summary followed by Args/Returns blocks is the right shape for a four-parameter tool with no output schema, and there is little filler. The pairing/equality information is stated twice across the two list parameters, a minor redundancy.

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?

Because the tool has no output schema, the Returns block doing the work of describing accuracy, per-class metrics, averages, text table and ROC-AUC is essential and present. All four parameters are optional, and the description never states what happens if neither input mode is supplied, which is the remaining hole for a zero-required-parameter tool.

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

Parameters5/5

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

Schema coverage is 0%, yet the description supplies meaning for every parameter: model_id's semantics, y_true/y_pred pairing and equal-length constraint, and dataset's actual value set ("test", "train", "both") which the schema does not express as an enum. The clause tying dataset exclusively to model_id is a constraint found nowhere in the schema, so the description fully compensates for the coverage 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 opening sentence names a specific artifact (per-class precision/recall/F1/support plus accuracy and macro/weighted averages), so the agent knows exactly what is computed. It does not differentiate itself from nearby siblings such as confusion_matrix or confusion_matrix_plot, which is what keeps it below a 5.

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 definition states a clear either/or calling mode (a trained model via model_id, or explicit y_true/y_pred lists) and adds the non-obvious restriction that dataset is only used with model_id. It stops short of naming an alternative tool or stating when a report is preferable to a confusion matrix, so no exclusion guidance.

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