Skip to main content
Glama

Precision Recall Curve

precision_recall_curve

Generate and save precision-recall curves for a trained classification model on test data, including average precision per class and one-vs-rest curves for multiclass models.

Instructions

Generate and save the precision-recall curve of a classification model on its test data. Binary models get one curve; multiclass models get one-vs-rest curves. Args: model_id (str): ID of the trained classification model. Returns: dict: Model ID, average precision per class, 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": "precision_recall_curve"
  }
}

Input Schema

NameRequiredDescriptionDefault
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 present, the description carries the full burden, and it does disclose meaningful behavior: the tool writes an image file to disk and returns average precision per class plus the filename. It omits where the image is saved, whether an existing file is overwritten, and any cost or permission considerations for a write-side-effect tool.

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 core behavior is front-loaded in the first sentence, with binary/multiclass behavior and the Args/Returns summary following in a predictable structure. The explicit 'Args:'/'Returns:' scaffolding is slightly formulaic but adds no meaningful waste.

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 single-parameter tool with no output schema, the description covers input meaning, variant behavior, and the shape of the return value, which is enough to call it correctly. The only real gap is the destination path of the saved image, which an agent might need to report or retrieve.

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 coverage is 0%, so the description must compensate for the single parameter, and it does: model_id is identified as the ID of the trained classification model, telling the agent the model must be an existing fitted classifier rather than an arbitrary dataset handle. No format or example ID is given, which keeps it short of a 5.

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 opens with a specific verb+resource pair ('Generate and save the precision-recall curve') scoped to classification models on test data, which separates it from roc_curve and learning_curve by subject matter. It does not explicitly name those siblings, so differentiation is implicit rather than stated.

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?

Usage is implied: it applies to a trained classification model evaluated on test data, and the binary vs multiclass behavior is spelled out. There is no explicit guidance on when to pick this over roc_curve or classification_report, and no stated prerequisites such as the model needing to be fitted first.

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