Skip to main content
Glama

pysr_uncertainty

Read-only

Bootstrap confidence intervals for the numeric constants of a frozen expression, plus optional prediction bands on an x-grid.

Typical flow: call pysr_run, pick an expression from the response
(best_expression or a pareto_front entry), pass it back here with
the same dataset to get CIs on its fit constants.

Returns frequentist bootstrap confidence intervals, not Bayesian
credible intervals — posterior inference over expression structures
is an open research problem. This tool freezes the expression
chosen by the caller and bootstraps only its numeric constants;
uncertainty about *which* expression is correct is not quantified.

Bootstrap semantics:
  - If y_sigma is supplied, uses parametric bootstrap
    (y_b = y + Normal(0, y_sigma)). CI reflects user-stated
    measurement noise.
  - Otherwise uses residual bootstrap: fit once, resample residuals.
    CI reflects estimated-from-residuals noise.

Only Float constants in the expression become free parameters.
Integers stay structural (the 2 in x**2 is a function-class choice,
not a fit constant). Expressions with no Float constants
(e.g. "x + y") will be rejected with a validation error.

Expression grammar: the `expression` string is parsed by sympy.
Accepted operators are the same set pysr_run emits: unary `sin`,
`cos`, `tan`, `exp`, `log`, `log2`, `log10`, `sqrt`, `abs`, `sinh`,
`cosh`, `tanh`; binary `+`, `-`, `*`, `/`, `^` (or `**`). Whitespace
and parenthesization are free. Every free symbol in the expression
must correspond to an entry in `feature_names` — an unrecognised
symbol is silently treated as a fresh sympy Symbol and the fit will
fail downstream rather than reject early. Parse failures (syntax
errors, malformed operators) surface as tool errors.

If `feature_names` is supplied, its length must equal the number of
columns in `X`; a mismatch is rejected with a validation error.

Pricing: always free, regardless of dataset size. This tool has no
`payment` parameter and is never subject to the x402/Stripe gate.
Large bootstrap jobs still count against the shared rate limit
below, so budget `n_resamples` accordingly.

Rate limit: 10 requests/hour per IP, 200/hour global, max queue
depth 20 (shared with sindy_run and pysr_run).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
XYes2D array of input features. Each row is an observation, each column is a feature. Free tier: 100 rows, 8 features. Paid tier: up to 50,000 rows, 20 features.
yYesTarget values, one per row of X.
alphaNoSignificance level. 0.05 → 95%% CI. Default 0.05.
x_gridNoOptional 2D grid of feature values at which to report a prediction band. Must have the same number of columns as X. Omit to skip prediction-band computation.
y_sigmaNoOptional per-point measurement standard deviations, or a single scalar applied to all points. When supplied, the helper uses parametric bootstrap (y_b = y + Normal(0, y_sigma)); otherwise it uses residual bootstrap. Supplying y_sigma also improves the initial weighted fit.
expressionYesThe expression to bootstrap, as returned by pysr_run (`best_expression` or a `pareto_front[i].expression`). Only numeric Float constants are treated as free parameters — integers in the expression (e.g. the 2 in x**2) stay structural.
n_resamplesNoNumber of bootstrap resamples. Higher = tighter CIs, more compute. Default 100.
feature_namesNoNames for each variable/feature column. Defaults to x0, x1, ...

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteYes
alphaYes
coefficientsYes
prediction_ciNo
bootstrap_methodYes
n_requested_resamplesYes
n_successful_resamplesYes

TDQS

A5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true and destructiveHint=false, but the description adds extensive behavioral detail: parametric vs residual bootstrap semantics, treatment of Float vs Integer constants, sympy parsing behavior, silent handling of unrecognized symbols, validation rules, and rate limits. This far exceeds what annotations provide and helps the agent predict tool behavior accurately.

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 detailed but well-structured with clear sections (Typical flow, Bootstrap semantics, Expression grammar, Pricing, Rate limit). Every sentence provides necessary information without fluff. The front-loaded summary gives immediate clarity, and the logical progression makes it easy for an agent to extract key facts.

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

Completeness5/5

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

Given 8 parameters, an output schema, and annotations, this description covers all necessary contextual aspects: purpose, usage flow, bootstrap methodology, parameter semantics, edge cases, pricing, and rate limits. It leaves no important gap for an agent deciding whether and how to invoke this tool.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds critical meaning not present in the schema: y_sigma triggers parametric bootstrap, x_grid is for prediction bands, n_resamples trade-off, and the crucial rule that only Float constants are free parameters while integers stay structural. The expression grammar and parsing details are essential for correct invocation.

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 opens with a precise verb+resource statement: 'Bootstrap confidence intervals for the numeric constants of a frozen expression, plus optional prediction bands on an x-grid.' It clearly distinguishes from siblings by explaining the typical flow from pysr_run and noting that it does not perform posterior inference over expression structures.

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?

Provides explicit when-to-use context: 'Typical flow: call pysr_run, pick an expression from the response... pass it back here with the same dataset.' It also states exclusions (expressions with no Float constants are rejected) and clarifies limitations (uncertainty about which expression is correct is not quantified). This gives clear guidance on when this tool is appropriate versus alternatives.

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.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: feature_request handles capability requests, pysr_run does algebraic symbolic regression, sindy_run handles differential equation discovery, and pysr_uncertainty provides bootstrap confidence intervals for pysr results. The descriptions explicitly cross-reference each other to prevent confusion.

Naming Consistency4/5

The compute tools follow a consistent 'method_run' pattern (pysr_run, sindy_run), and pysr_uncertainty shares the pysr prefix. feature_request deviates from this pattern but is a distinctly different kind of tool, so the naming is largely predictable with only minor inconsistency.

Tool Count5/5

Four tools is a well-scoped set for a symbolic regression server. Each tool fills a necessary role: two core methods, one uncertainty analysis follow-up, and one feedback channel. No redundancy or bloat.

Completeness4/5

The domain covers algebraic regression, dynamical system identification, and post-hoc uncertainty quantification for pysr. A minor gap is the lack of a sindy_uncertainty tool, but the feature_request mechanism compensates for missing capabilities, and the core workflows are fully supported.

Resources