Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

iv_compare

Read-only

Run multiple IV estimators on the same specification and compare estimates, confidence intervals, and first-stage F statistics to check instrument strength and sensitivity before reporting.

Instructions

Run several k-class / JIVE estimators on the same IV specification and return a one-row-per-method comparison DataFrame (estimate, SE, CI, first-stage F). Useful as a sensitivity sanity check before reporting. 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_rubin_ci, sp.dml. Typical minimum N: 200.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alphaNoSignificance level for confidence intervals and tests.
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
formulaYesModel formula using patsy/R-style syntax.
methodsNomethods parameter (tuple[str]).
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.
endog_nameNoOverride endogenous-coefficient name lookup
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.1/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and openWorldHint=false, so the read-only safety profile is already covered. The description adds substantive context beyond annotations: the comparison-DataFrame output structure, the weak-first-stage failure mode with its consequences (biased point estimates, unreliable conventional SEs), the identifying assumptions (relevance, exclusion, exogeneity, monotonicity for LATE), and a typical minimum N of 200.

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 organized into labeled sections — purpose, assumptions, pre-conditions, failure modes, alternatives, minimum N — and front-loads the core purpose in the first sentence. It is dense but every section earns its place; no filler or repetition of schema content.

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?

The description covers the statistical context an agent needs to use an IV comparison tool correctly: identifying assumptions, the relevance pre-condition, the weak-instrument failure mode with a concrete mitigation, alternatives, and a minimum sample size. An output schema exists, so return-value details are already structured, and nothing critical for selecting or invoking the tool is missing.

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%, with all 10 parameters (alpha, detail, formula, methods, as_handle, data_path, result_id, endog_name, data_columns, data_sample_n) already documented in the input schema. The description adds no parameter-level details beyond the schema, so the baseline of 3 applies.

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 specific verb phrase — 'Run several k-class / JIVE estimators on the same IV specification' — and states the exact output shape (one-row-per-method DataFrame with estimate, SE, CI, first-stage F). This clearly differentiates it from single-estimator siblings like sp.iv, ivreg, and jive, and the explicit alternatives list reinforces the distinction.

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 explicitly states when to use the tool ('Useful as a sensitivity sanity check before reporting') and names three alternatives (sp.iv, sp.anderson_rubin_ci, sp.dml). The failure-mode section routes to Anderson-Rubin weak-IV-robust inference when the first stage is weak, which effectively implies a when-not condition, though it lacks a crisp 'use X instead when Y' formulation.

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