Skip to main content
Glama

Residual Plot

residual_plot

Generate and save residual plots for a regression model's test data, including residuals versus predicted values and a residual histogram, to help diagnose model fit.

Instructions

Generate and save residual plots for a regression model on its test data: residuals vs predicted values, and a histogram of the residuals. Args: model_id (str): ID of the trained regression model. Returns: dict: Model ID, mean and std of residuals, 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": "residual_plot"
  }
}

Input Schema

NameRequiredDescriptionDefault
model_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose that it saves plots and returns residual statistics plus an image filename. However, it omits details such as where files are saved, overwrite behavior, required model state, and error behavior.

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 is short and front-loaded, with a clear Args/Returns structure. Every sentence contributes directly to understanding what the tool produces.

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 simple one-parameter plotting tool, the description covers the main action, required input, generated plots, and return contents. It is nearly complete, but missing details about output location and model prerequisites keep it from a perfect score.

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. It explains that model_id is the ID of a trained regression model, which is meaningfully more specific than the schema's bare string type, though it does not specify ID format or where to obtain it.

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 uses a specific verb and resource: generate and save residual plots for a regression model on test data. It also names the two plot types, but it does not explicitly distinguish this tool from sibling plotting or analysis tools.

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?

It clearly states the context: use this for a regression model on its test data. It does not explicitly say when not to use it or name alternative tools for related visualizations.

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