Skip to main content
Glama

Compare Threshold

compare_threshold
Read-onlyIdempotent

Compare two numeric expressions exactly and get a threshold verdict, including the shortfall when the threshold is not met.

Instructions

Exact threshold check with a verdict and the shortfall when it fails. Use calc_exact, not this, when you want the computed VALUE rather than a threshold comparison.

a OP b. Both sides are evaluated exactly and printed as fractions — a threshold comparison written out cannot be gotten backwards. Example: ('1/25', '>', '0.05').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesLeft-hand numeric expression, evaluated exactly
bYesRight-hand numeric expression, evaluated exactly
opYesComparison operator: one of ==, !=, >, >=, <, <= ('=' also accepted for ==)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.12.0
    • addedInput schema / properties / a / description
      Added value: +"Left-hand numeric expression, evaluated exactly"
    • addedInput schema / properties / b / description
      Added value: +"Right-hand numeric expression, evaluated exactly"
    • addedInput schema / properties / op / description
      Added value: +"Comparison operator: one of ==, !=, >, >=, <, <= ('=' also accepted for ==)"
  2. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "compare_thresholdDictOutput",
      +  "type": "object"
      +}
  3. Changed6 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / a / title
      Added value: +"A"
    • addedInput schema / properties / b / title
      Added value: +"B"
    • addedInput schema / properties / op / title
      Added value: +"Op"
    • addedInput schema / title
      Added value: +"compare_thresholdArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  4. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context: both sides are evaluated exactly and printed as fractions, and the comparison 'cannot be gotten backwards.' It also mentions the verdict and shortfall output. This goes beyond the annotations without contradicting them.

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 compact and front-loaded: the core purpose and the key alternative are stated in the first two sentences. The example and the 'cannot be gotten backwards' note are useful and not redundant. Every sentence earns its place.

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?

The tool has an output schema, so return values are already documented. The description covers the core behavior, the alternative tool, and an example. It could mention edge cases like invalid operators or division by zero, but for a simple comparison tool with full schema coverage and an output schema, the description is sufficiently complete.

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 schema already documents all three parameters (a, b, op) with descriptions. The description adds the example ('1/25', '>', '0.05') and clarifies that both sides are evaluated exactly, but it doesn't add much beyond what the schema already provides. Baseline 3 is appropriate.

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 verb ('Exact threshold check') and resource (threshold comparison), and explicitly distinguishes it from calc_exact by saying 'Use calc_exact, not this, when you want the computed VALUE rather than a threshold comparison.' This clearly differentiates it from the most similar sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly names the alternative tool (calc_exact) and the condition that selects it ('when you want the computed VALUE rather than a threshold comparison'). It also explains the exact-evaluation behavior and gives an example, leaving no ambiguity about when to use this tool.

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