Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

dist_iv

Read-only

Estimates instrumental-variable quantile treatment effects, giving the complier local average treatment effect at each outcome quantile to assess heterogeneous causal impact.

Instructions

Distributional IV: the complier LATE at each quantile of y. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Selection-on-observables (unconfoundedness + overlap) or, for IV variants, instrument validity; For IV-QTE: rank invariance / rank similarity (monotonicity of the structural quantile function); Relevance: instruments predict the endogenous regressor (first-stage F >= 10 rule of thumb). Pre-conditions: Covariates, treatment, and outcome; for IV-quantile methods, a valid instrument; Enough data to estimate the outcome distribution across quantiles; formula includes the (endog ~ instruments) parenthesised block. Failure modes: Estimated conditional quantiles cross (non-monotone), or tail quantiles are unstable -> Use rearrangement / monotonization and avoid extreme quantiles where data are sparse; First-stage F < 10 (Stock-Yogo 5% bias) -> Use weak-IV-robust inference (Anderson-Rubin) or LIML; Over-identification test rejects (sp.estat 'overid') -> At least one instrument is invalid; drop instruments or switch to just-identified LIML. Alternatives: sp.qte, sp.iv, sp.dml, sp.deepiv. Typical minimum N: 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome, binary treatment, binary instrument.
seNo``'auto'`` picks ``'analytic'`` without covariates and ``'bootstrap'`` with them (the analytic influence function treats ``pi(X)`` as known).auto
seedNoRandom seed for reproducible stochastic steps.
alphaNoSignificance level for confidence intervals and tests.
treatYesOutcome, binary treatment, binary instrument.
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
n_bootNoBootstrap replications when ``se='bootstrap'``.
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://.
quantilesNoDefaults to ``(0.1, 0.25, 0.5, 0.75, 0.9)``.
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.
covariatesNoConditioning set for ``P(Z=1|X)``. Unlike versions <= 1.20.0 (which accepted and silently ignored this argument) it now changes the estimate.
instrumentYesOutcome, binary treatment, binary instrument.
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.4/5.0
Behavior5/5

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

Although annotations already mark the tool as read-only, the description adds substantial behavioral context: assumptions, relevance checks, over-identification testing, quantile-crossing failure modes, weak-IV remedies, typical minimum N, and validation evidence tiers. This goes well beyond what the annotations alone convey.

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 description is long but organized into labeled sections (Validation, Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N) — every section earns its place for a complex estimator. It is somewhat dense, but it is structured well and front-loads the core estimand.

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?

For a complex distributional IV-QTE tool with 15 parameters, 4 required fields, an output schema, and rich annotations, the description is remarkably complete. It covers validity conditions, failure modes, alternative methods, sample-size guidance, and failure remedies, leaving little an agent would need to infer on its own.

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 coverage is 100% and individual parameter descriptions already carry meaning (defaults, enum behavior, payload depth, caching semantics). The description adds some context, such as the parenthesized endog ~ instruments block and the relevance condition, but many parameter-level details are left to the schema. 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 opens with a precise estimand — "complier LATE at each quantile of y" — which identifies the method and its target. It names alternatives (sp.qte, sp.iv, sp.dml, sp.deepiv), helping an agent distinguish it from closely related IV and QTE tools.

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 description provides explicit pre-conditions, assumptions (e.g., rank invariance, valid instrument, first-stage F >= 10), and failure-mode remedies, giving the agent clear context for when the tool applies. It names alternatives but does not explicitly state when to prefer one sibling over another, so it falls just short of full routing guidance.

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