Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

zero_first_stage

Read-only

Tests instrument validity by checking its effect where it has no first stage, then quantifies bias and returns a pleiotropy-robust corrected estimate with bootstrap confidence intervals.

Instructions

Zero-first-stage (ZFS) test of the exclusion restriction, plus van Kippersluis-Rietveld (2018) pleiotropy-robust correction. Estimates the instrument's direct effect on the outcome in a subsample where it has no first stage, reports the implied bias in the main-sample IV estimate, and returns the corrected point estimate with a cluster-bootstrap interval. Accepts the same exog / absorb / cluster spec as sp.iv, so the test runs on the specification actually fitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome column
zfsYesBoolean column/mask marking the zero-first-stage subsample where the instrument is believed inert
exogNoexog parameter (list[str] | str).
alphaNoSignificance level for confidence intervals and tests.
endogYesEndogenous regressor
absorbNoFixed effects absorbed in every component regression
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 reps for the corrected estimate (0 to skip)
clusterNoCluster identifier column for clustered standard errors.
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.
instrumentYesThe single excluded instrument being tested
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
random_stateNoRandom seed or RandomState for reproducible stochastic steps.
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
Behavior4/5

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

Annotations declare readOnlyHint=true, so the agent knows it is a read-only analysis. The description adds meaningful behavioral context beyond that: it estimates the instrument's direct effect in a zero-first-stage subsample, reports implied bias, returns a corrected estimate with a cluster-bootstrap interval, and accepts the same spec as sp.iv. It also discloses the detail parameter's payload-depth behavior (minimal/standard/agent) which affects what the agent receives. 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but well-structured: it front-loads the purpose and method, then the outputs, then the spec compatibility. Every sentence earns its place, and the detail parameter's payload-depth explanation is useful for an agent deciding how to call it. No fluff 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 is complete for a read-only diagnostic tool with a rich output schema. It explains the purpose, the method, the key inputs (zfs, instrument), the outputs (bias, corrected estimate, bootstrap interval), and the spec compatibility with sp.iv. The only minor gap is that it doesn't explicitly state what happens when n_boot=0 or how the cluster-bootstrap interval behaves, but the schema documents n_boot and the output schema likely covers the return structure.

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 schema already documents all 16 parameters. The description adds context for the key parameters (zfs as the zero-first-stage subsample, instrument as the single excluded instrument, exog/absorb/cluster as the same spec as sp.iv) but does not add much beyond the schema for most parameters. Baseline 3 is appropriate because the schema carries the heavy lifting.

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 names a specific statistical procedure (zero-first-stage test of the exclusion restriction), names the method variant (van Kippersluis-Rietveld 2018 pleiotropy-robust correction), and states the concrete outputs: implied bias in the main-sample IV estimate and a corrected point estimate with cluster-bootstrap interval. It also distinguishes itself from generic IV tools by noting it accepts the same spec as sp.iv, so the test runs on the actually fitted specification.

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 clearly states when to use it: to test the exclusion restriction and obtain a pleiotropy-robust correction, in a subsample where the instrument has no first stage. It also explains the relationship to sp.iv (same exog/absorb/cluster spec), which implies it is a diagnostic companion to sp.iv. It does not explicitly name alternatives or state when not to use it, but the context is clear enough for an agent to select it appropriately.

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