Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

qreg

Read-only

Run quantile regression at a specified quantile to estimate conditional outcome distributions and generate certified parity evidence for decision-making.

Instructions

Quantile regression at specified quantile(s). Validation: certified parity evidence. Assumptions: Conditional quantile is linear in covariates; Outcome continuous (or finely discretized) so the check-function minimization is well-posed; Powell (1991) sandwich SEs require a consistent kernel density of the conditional density at zero. Pre-conditions: Continuous outcome variable; Quantile tau strictly in (0,1). Failure modes: Sparse data in tail quantiles gives unstable density estimate and wide SEs -> Estimate a more central quantile or pool more data near the tail; Crossing/degenerate fit when regressors are collinear -> Drop or combine collinear regressors before refitting. Alternatives: sp.regress, sp.feols. Typical minimum N: 200.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoRegressor columns (alternative to formula)
yNoOutcome column (alternative to formula)
detailNoPayload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip.agent
formulaNo'y ~ x1 + x2' (alternative to y/x)
quantileNoQuantile (0-1)
as_handleNoIf true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running.
data_pathYesAbsolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://.
result_idNoOptional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns.
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses Powell sandwich standard errors, unstable tail-quantile density estimates, collinearity-induced degenerate fits, and remediation steps. This gives the agent meaningful expectations about computation and failure behavior without contradicting the annotations.

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 definition is front-loaded with a one-line statement of purpose and organized into clearly labeled sections, each carrying useful information. It loses a point for the cryptic 'Validation: certified parity evidence' line and dense jargon such as 'Powell sandwich SEs,' which an agent may find opaque.

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?

Combined with 100% schema coverage and an output schema, the description is highly complete: it covers assumptions, preconditions, failure modes, alternatives, and minimum sample size. It is not perfect because the plural 'quantile(s)' is not reconciled with a schema that only accepts a single scalar quantile, and the alternative commands are named without guidance on when to switch.

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

Parameters4/5

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

The input schema already documents all 10 parameters, so the baseline is 3. The description adds valuable semantic constraints not in the schema: the quantile must be strictly in (0,1), the outcome must be continuous, and a minimum sample size around 200 is expected. It does not belabor x/y/formula syntax because the schema already covers it.

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 definition opens with a clear action and model type — 'Quantile regression at specified quantile(s)' — and is reinforced by preconditions and failure modes. However, it does not meaningfully distinguish qreg from close siblings like sqreg or ivqreg; naming sp.regress and sp.feols as alternatives is not enough to tell an agent which tool to pick.

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?

It provides explicit assumptions, preconditions, and failure-mode remedies, so an agent can infer when qreg is appropriate: continuous outcome, tau strictly in (0,1), linear conditional quantile, and a typical minimum N of 200. It names alternatives but never says when to use them instead, so there are no explicit exclusions.

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

Deploy Server

Other Tools