Skip to main content
Glama

float-stability

Floating-point stability of an expression over variable ranges — Evaluates a real-valued expression in binary64 (or binary32) on a deterministic grid over the caller's variable ranges and compares each point with a certified arbitrary-precision reference, reporting the decimal digits lost, the worst input, and overflow, underflow or NaN. Recognises and rewrites exp(x)-1, 1-cos(x), log(1+x), sqrt(a)-sqrt(b), a^2-b^2, the quadratic formula, sqrt(x^2+y^2) and log-

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": {
      "expression": "<expression>",
      "variables": "<variables>"
    },
    "name": "float-stability"
  }
}

Input Schema

NameRequiredDescriptionDefault
precisionNoArithmetic of the code under test. Default binary64.
variablesYesRange of every free variable.
expressionYesExpression in the declared variables, e.g. 'exp(x) - 1'. Operators + - * / ^ (or **); functions sqrt exp expm1 log log1p log2 log10 sin cos tan atan sinh cosh tanh abs pow hypot min max; constants pi, e.
alternativeNoOptional algebraically equal expression to score on the same grid.
maxDigitsLostNoFail above this many lost digits. Default 4.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full load and does reasonably well: it discloses the deterministic grid, the certified arbitrary-precision comparison, and the reported outputs (digits lost, worst input, overflow/underflow/NaN). What it omits is cost/limits (grid size, runtime for up to 6 variables), error behavior on an invalid expression, and whether the 'rewrite' of unstable patterns is returned to the caller or only used internally — and the sentence describing it is cut off at 'and log-', leaving that behavior genuinely ambiguous.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is correctly front-loaded and the prose is dense rather than padded. However, the description terminates mid-clause at 'and log-', so it ends on an incomplete sentence that adds a dangling list of unstable patterns without saying what happens to them.

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?

This is a computationally heavy tool with 5 parameters and no output schema, so the description should fully explain what comes back and what limits apply. It partially does — digits lost, worst input, and the overflow/underflow/NaN flags are named — but output shape, grid resolution/complexity, and failure conditions are left unspecified, and the truncated final sentence breaks the explanation of the rewriting feature.

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 parameters are already self-documenting. The description mentions binary64/binary32 in passing but adds no semantics beyond the schema for `variables`, `alternative`, or `maxDigitsLost` — notably it never explains that `alternative` is scored on the same grid, which is arguably the most easily misread parameter.

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 leads with a precise noun phrase ('Floating-point stability of an expression over variable ranges') and then states the concrete mechanism: evaluating an expression on a deterministic grid and comparing against an arbitrary-precision reference. That verb+resource+method framing is specific enough that an agent could distinguish this from any arithmetic/validation sibling without opening the schema.

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 described mechanism — an agent can infer you call this when you suspect an expression loses precision — but there is no explicit 'use when / do not use when' statement and no named alternative among the sibling tools. Nothing tells the caller whether this is a one-off check versus part of a broader numeric audit.

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