Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

iv_diag

Read-only

Assess instrument strength and validity for IV estimates, delivering weak-IV robust confidence sets and sensitivity diagnostics in one call.

Instructions

Modern IV reporting bundle (R ivDiag analogue). Combines 2SLS point estimate, analytic + pairs/wild bootstrap SEs, Olea-Pflueger effective F, Lee-McCrary-Moreira-Porter (2022) tF-corrected critical value, Anderson-Rubin / CLR / K weak-IV-robust confidence sets, Kleibergen-Paap rk LM, Conley-Hansen-Rossi (2012) plausibly-exogenous LTZ sensitivity, and a Blandhol-Bonney-Mogstad-Torgovitsky (2022/2025) / Soczynski (2024) TSLS-as-LATE caveat into a single IVDiagResult. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Instrument relevance (non-zero first stage); Exclusion restriction: the instrument affects the outcome only through the treatment; Independence/exogeneity of the instrument; for LATE, monotonicity (no defiers). Pre-conditions: An instrument plausibly affecting treatment, an endogenous treatment, and an outcome; A strong first stage (assess instrument strength before interpreting estimates). Failure modes: Weak first stage -- biased point estimates and unreliable conventional SEs -> Report first-stage F / effective F and use weak-IV-robust inference (Anderson-Rubin). Alternatives: sp.iv, sp.anderson_ru...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome column
h0NoNull hypothesis for AR/CLR/K
exogNoOptional included exogenous controls
vcovNoHeteroskedasticity-robust covariance typeHC1
alphaNoSignificance level for confidence intervals and tests.
endogYesSingle endogenous regressor
absorbNoHigh-dimensional fixed effects to partial out before the bundle is computed, so every statistic describes the absorbed specification (ivreghdfe-equivalent)
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 (0 to skip)
clusterNoCluster column for cluster-robust SE / cluster 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://.
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.
instrumentsYesinstruments parameter (list[str] | str).
boot_methodsNoSubset of {'pairs','wild'}
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
include_k_ciNoWhether to include k ci.
ltz_gamma_sdNoStandard deviation of CHR (2012) LTZ Gaussian prior on gamma
random_stateNoRandom seed or RandomState for reproducible stochastic steps.
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.
include_clr_ciNoWhether to include clr ci.

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
Behavior4/5

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

Annotations include readOnlyHint=true, so the description doesn't need to justify that it's read-only. Beyond annotations, the description discloses the tool's behavior in detail: it computes a bundle of diagnostics, has specific assumptions (exclusion restriction, monotonicity), failure modes (weak first stage), and offers a validation tier and pre-conditions. It also implicitly discloses that it returns a comprehensive result object. This is rich behavioral context.

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 information-dense, covering all key aspects: purpose, validation, assumptions, failure modes, and alternatives. It is front-loaded with the purpose and then provides structured sections. However, it might be slightly verbose with the enumeration of all methods, but each is relevant. It is not concise, but it earns its length for a complex tool.

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 the tool's complexity (21 params, output schema provided), the description is comprehensive: it states pre-conditions, assumptions, failure modes, validation, and alternatives. It also mentions the detail parameter for controlling output depth, which is crucial for LLM planning. The output schema exists, so return value details are not duplicated. Nothing essential is missing for an agent to decide and call this tool correctly.

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%, so every parameter has a description in the schema. The description adds some context by framing the bundle's purpose and failure modes (e.g., weak first stage -> use robust inference), which helps interpret the output but doesn't add parameter-level details beyond what schema already provides (e.g., ltz_gamma_sd is explained in schema but not in description). However, the description's high-level context does enhance understanding of parameters like 'detail' and 'vcov' in the broader workflow.

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 clearly identifies what the tool does: a comprehensive IV reporting bundle that combines multiple estimation and testing procedures into a single result. It lists specific methods (e.g., 2SLS, Anderson-Rubin, CLR) and states the validation tier, assumptions, and failure modes, making the purpose distinct and informative. It differentiates from siblings like 'iv', 'ivreg', 'weakrobust' by emphasizing the bundled, single-call nature and the inclusion of the latest LATE caveats.

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 implies usage for IV analysis problems, provides pre-conditions (instrument plausibly affecting treatment, endogenous treatment, outcome, strong first stage), and failure modes (weak first stage -> use weak-IV-robust inference). It mentions alternatives (sp.iv, sp.anderson_ru...) but is cut off, and doesn't explicitly describe scenarios when to prefer this over those alternatives. Still, the guidance on assumptions and failure modes is substantial.

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