Skip to main content
Glama
gitmystuff

MCP Machine Learning Agent

by gitmystuff

shap_explain_selected

Explain a selected breast cancer model with SHAP: return global top features and a local explanation for a chosen test row, showing which features push toward malignant.

Instructions

Run SHAP for the selected model: global top features plus a local explanation for one test row. Positive SHAP values push toward malignant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_kNoHow many top features to return.
test_sizeNoFraction of the data held out for testing.
request_idNoYour own id for this call; recorded in the audit log.unknown
local_indexNoTest-set row to explain individually.
random_stateNoRandom seed for the train/test split.
knn_neighborsNoNumber of neighbors for the KNN model.
selection_ruleNoRule used to pick the model to explain.recall_then_precision_then_accuracy

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.4/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. It does add genuine value by disclosing the sign convention ('Positive SHAP values push toward malignant'), but it fails to disclose that the tool appears to re-split data and re-train models internally (test_size, random_state, knn_neighbors, selection_rule), nor whether it is read-only, deterministic, or expensive.

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?

Two tight sentences with no filler, and the core operation is front-loaded before the interpretive detail. Slightly under-specified rather than padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained. However, for a 7-parameter tool that re-runs training/splitting and writes to an audit log, the description omits prerequisites, cost, and how selection_rule interacts with sibling tools like select_best_model.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description loosely maps 'top features' to top_k and 'one test row' to local_index, but adds no format or semantic detail beyond the schema.

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?

Clear verb+resource: it runs SHAP on the model chosen by the selection rule and returns both a global feature ranking and a single-row local explanation. This distinguishes it from train_models and select_best_model, though it never explicitly names those siblings as prerequisites.

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 only implied by the phrase 'for the selected model' and the selection_rule parameter, which hints that a model must be selected first. There is no explicit when-to-use statement, no when-not-to-use, and no named alternative tool for interpretation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.