Skip to main content
Glama

Precision, Recall and F1 Calculator

precision-recall-f1-calculator
Read-onlyIdempotent

Use this when a user asks about their ML model precision, recall, F1 score, or F-beta score. Takes precision and recall as fractions from 0 to 1 and an optional beta weight. Returns F1, F-beta, and interpretation of the precision-recall tradeoff.

Input Schema

NameRequiredDescriptionDefault
betaNobeta used by this deterministic tool.
recallYesrecall used by this deterministic tool.
precisionYesprecision used by this deterministic tool.

Output Schema

NameRequiredDescriptionDefault
betaYes
f1_scoreYes
next_stepYes
f_beta_scoreYes
next_step_urlYes
why_follow_upYes
interpretationYes
affiliate_contextNo
computation_basisYes
precision_recall_gapYes
precision_recall_balanceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedOutput schema / properties / beta
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / precision_recall_gap
      Added value: +{
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "computation_basis",
      -  "f1_score",
      -  "f_beta_score",
      -  "interpretation",
      -  "next_step",
      -  "next_step_url",
      -  "precision_recall_balance",
      -  "why_follow_up"
      -]New value: +[
      +  "beta",
      +  "computation_basis",
      +  "f1_score",
      +  "f_beta_score",
      +  "interpretation",
      +  "next_step",
      +  "next_step_url",
      +  "precision_recall_balance",
      +  "precision_recall_gap",
      +  "why_follow_up"
      +]
  2. Changed8 schema fields changed
    • addedInput schema / properties / beta / description
      Added value: +"beta used by this deterministic tool."
    • addedInput schema / properties / beta / examples
      Added value: +[
      +  1
      +]
    • addedInput schema / properties / precision / description
      Added value: +"precision used by this deterministic tool."
    • addedInput schema / properties / precision / examples
      Added value: +[
      +  1
      +]
    • addedInput schema / properties / recall / description
      Added value: +"recall used by this deterministic tool."
    • addedInput schema / properties / recall / examples
      Added value: +[
      +  1
      +]
    • addedOutput schema / properties / computation_basis
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "f1_score",
      -  "f_beta_score",
      -  "interpretation",
      -  "next_step",
      -  "next_step_url",
      -  "precision_recall_balance",
      -  "why_follow_up"
      -]New value: +[
      +  "computation_basis",
      +  "f1_score",
      +  "f_beta_score",
      +  "interpretation",
      +  "next_step",
      +  "next_step_url",
      +  "precision_recall_balance",
      +  "why_follow_up"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "affiliate_context": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "affiliate": {
      +          "type": "string"
      +        },
      +        "cta_label": {
      +          "type": "string"
      +        },
      +        "disclosure": {
      +          "type": "string"
      +        },
      +        "framing": {
      +          "type": "string"
      +        },
      +        "posture": {
      +          "enum": [
      +            "secondary"
      +          ],
      +          "type": "string"
      +        },
      +        "slot_id": {
      +          "type": "string"
      +        },
      +        "url": {
      +          "type": "string"
      +        },
      +        "variant": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "affiliate",
      +        "cta_label",
      +        "disclosure",
      +        "framing",
      +        "posture",
      +        "slot_id",
      +        "url",
      +        "variant"
      +      ],
      +      "type": "object"
      +    },
      +    "f1_score": {
      +      "type": "number"
      +    },
      +    "f_beta_score": {
      +      "type": "number"
      +    },
      +    "interpretation": {
      +      "type": "string"
      +    },
      +    "next_step": {
      +      "type": "string"
      +    },
      +    "next_step_url": {
      +      "type": "string"
      +    },
      +    "precision_recall_balance": {
      +      "type": "string"
      +    },
      +    "why_follow_up": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "f1_score",
      +    "f_beta_score",
      +    "interpretation",
      +    "next_step",
      +    "next_step_url",
      +    "precision_recall_balance",
      +    "why_follow_up"
      +  ],
      +  "type": "object"
      +}
  4. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  5. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered without the description. The description adds only that beta is optional and that the output includes a tradeoff interpretation; it doesn't address edge cases such as both inputs being zero.

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?

Two sentences: trigger first, then inputs and outputs. No filler, no repetition of the title, and the most decision-relevant information is front-loaded.

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?

With an output schema handling return values and annotations handling safety, the description only needs to orient the caller, which it does. Minor gap: no note on degenerate inputs (precision=recall=0) or that the result is a pure deterministic computation, though the schema hints at determinism.

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 0-1 bounds, required status of precision/recall, and the beta parameter are all documented structurally. The description restates the fraction range and beta optionality without adding format or semantic detail beyond the schema baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific computation (F1/F-beta from precision and recall) and names its inputs and outputs. In a sibling set of cost/SLO/DevOps calculators, an ML-metric tool is unmistakable, so no differentiation problem exists.

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 opening sentence gives an explicit trigger: use it when a user asks about ML model precision, recall, F1, or F-beta. It stops short of stating when NOT to use it or naming an alternative, but no sibling overlaps with this domain, so the omission is low-cost.

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