Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

iv

Read-only

Estimate causal effects with instrumental variables, offering k-class, jackknife, and ML methods plus diagnostics to test instrument validity and endogeneity.

Instructions

Unified IV estimation and the entry point for the whole IV family: k-class (2SLS, LIML, Fuller, GMM, JIVE) plus the many-weak-instrument jackknife variants (jive1, ujive, ijive, rjive, jive_mw), rigorous/post-Lasso instrument selection (lasso, rlasso, post_lasso), marginal treatment effects (mte) and their MST sharp bounds (ivmte_bounds), plausibly-exogenous sensitivity (plausibly_exog_ltz / plausibly_exog_uci), nonparametric and ML variants (npiv, kernel, ivdml, deepiv), quantile IV (ivqreg), Bayesian IV (bayes), continuous-instrument LATE (continuous_late), many-weak-IV Anderson-Rubin (many_weak_ar) and shift-share (shift_share). Includes first-stage F, Sargan/Hansen J, Kleibergen-Paap rk, Sanderson-Windmeijer per-endog F and Hausman diagnostics. Validation: certified parity evidence. Assumptions: Relevance: instruments predict the endogenous regressor (first-stage F >= 10 rule of thumb); Exclusion: instruments affect outcome only through the endogenous regressor; Monotonicity (for LATE interpretation under heterogeneous effects). Pre-conditions: formula includes the (endog ~ instruments) parenthesised block; at least as many instruments as endogenous regressors (order condition...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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
methodNoEstimation method. The k-class methods (2sls, liml, fuller, gmm, jive) take `formula` + `data`; the rest take their own explicit arguments -- see the target function's docstring. Aliases are case-insensitive and -/_ interchangeable.2sls
robustNoStandard error typenonrobust
clusterNoColumn name for cluster-robust SEs
formulaYesIV formula: 'y ~ (endog ~ instruments) + exog'
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.
fuller_alphaNoFuller constant (method='fuller' only)
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

A3.9/5.0
Behavior4/5

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

The annotation readOnlyHint=true already declares the operation non-mutating; the description adds substantial context by listing the included diagnostics (first-stage F, Sargan/Hansen J, Kleibergen-Paap rk, Sanderson-Windmeijer, Hausman) and the statement 'Validation: certified parity evidence.' It also documents assumptions and pre-conditions that constrain valid usage. No contradiction with 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 description is long but well-structured: purpose first, then the method family list, diagnostics, validation, assumptions, and pre-conditions. The extensive method enumeration is necessary to convey the unified scopeasia. It front-loads the core purpose and avoids redundancy with the schema. A few phrases could be tightened, but overall it earns its length for a tool of this complexity.

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?

Given the tool's complexity and the presence of an output schema, the description is quite complete. It covers the tool's scope, the key methods, diagnostics, validation evidence, statistical assumptions, and pre-conditions for the formula. It points to 'the target function's docstring' for method-specific arguments, which is a reasonable delegation. Missing details like error behavior are not critical for a read-only estimation tool.

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 baseline is 3. The description does add some meaning for the `formula` parameter by specifying the parenthesised block syntax, but most parameter details (e.g., `robust`, `cluster`, `detail`) are already fully described in the schema. There is no significant additional semantic value for the parameters beyond what the schema provides.

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 'Unified IV estimation and the entry point for the whole IV family', clearly stating the verb and resource. It enumerates the specific estimator families (k-class, jackknife, lasso, mte, etc.), distinguishing this tool as the umbrella entry point rather than any one specific method. The phrase 'entry point' differentiates it from sibling tools like ivreg or lasso_iv without needing to open their schemas.

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?

The description provides assumptions (relevance, exclusion, monotonicity) and pre-conditions ('formula includes the (endog ~ instruments) parenthesised block; at least as many instruments as endogenous regressors'), which help an agent understand when IV is appropriate. However, it never explicitly says 'use this tool instead of X' or 'for simple 2SLS with one method, consider a more targeted tool'. The routing to alternatives like ivreg or iv_diag is left implicit.

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