Skip to main content
Glama

ROC curve & AUC / ROC 曲线与 AUC

roc_auc
Read-only

ROC curve & AUC / ROC 曲线与 AUC | USE WHEN: the user has a binary gold standard and predicted scores/probabilities and wants AUC, ROC curve, discrimination, or the best cut-off | ALIASES: ROC, AUC, 曲线下面积, 诊断效能, 最佳阈值, cutoff, discrimination, 敏感度特异度, ROC曲线 | RETURNS: AUC、最优阈值、敏感度特异度

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "labels": [
        0,
        1,
        0,
        1,
        1,
        0
      ],
      "scores": [
        0.1,
        0.9,
        0.2,
        0.8,
        0.7,
        0.3
      ]
    },
    "name": "roc_auc"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelsYes真实标签,只能取 0/1(也认 yes/no、阳性/阴性)。**两个类别各需至少 2 例**——总例数 <4 或某类只有 1 例时直接 400:样本这么少 AUC 的置信区间没有意义,本接口不给一个看起来精确的假数值。长度须等于 scores。
scoresYes模型对每个样本的输出分数或预测概率,长度须等于 labels。AUC 只看排序不看绝对量纲,概率(0~1)或原始 logit 分数都可以。返回 AUC、95% CI、最佳阈值及对应敏感度/特异度。

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / labels / description
      Previous value: -"真实标签 0/1"New value: +"真实标签,只能取 0/1(也认 yes/no、阳性/阴性)。**两个类别各需至少 2 例**——总例数 <4 或某类只有 1 例时直接 400:样本这么少 AUC 的置信区间没有意义,本接口不给一个看起来精确的假数值。长度须等于 scores。"
    • changedInput schema / properties / scores / description
      Previous value: -"预测分数/概率"New value: +"模型对每个样本的输出分数或预测概率,长度须等于 labels。AUC 只看排序不看绝对量纲,概率(0~1)或原始 logit 分数都可以。返回 AUC、95% CI、最佳阈值及对应敏感度/特异度。"
  2. Added

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already establish readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered; the description adds that results include the optimal threshold and its sensitivity/specificity, which is value beyond the annotations. However, it omits other behavioral facts an agent would want, such as the minimum-sample 400 behavior and the reported 95% CI, which appear only in the schema.

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 pipe-delimited USE WHEN / ALIASES / RETURNS layout is front-loaded and scannable, with the primary purpose stated first. The long alias string is slightly noisy but each entry serves retrieval matching, so little is genuinely wasted.

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 two-parameter, read-only statistical computation with full schema coverage and no output schema, the description covers what it does, when to use it, and roughly what it returns (AUC, optimal threshold, sensitivity/specificity). Completeness is high; only the 95% CI return and small-sample rejection are left to the schema.

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% and both parameters are fully documented in the schema (allowed label encodings, length matching, ≥2 per class, scores may be probabilities or logits), so the description adds essentially no parameter detail. Baseline 3 applies when the schema carries the semantic load.

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 states a specific computation (ROC curve & AUC) plus the exact input condition: a binary gold standard with predicted scores/probabilities, and the desired outputs (AUC, ROC curve, discrimination, best cut-off). This lets an agent distinguish it from chart-only or AUC-comparison siblings in practice, though it never names an alternative to rule out.

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 'USE WHEN' clause gives a concrete triggering scenario and the ALIASES list broadens matching for terms like cutoff, 诊断效能 and discrimination. There is no explicit when-not-to-use guidance (e.g. 'use delong_auc_compare to compare two AUCs'), so it falls short of a top score.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources