Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

bartik

Read-only

Estimates causal effects via shift-share instrumental variables using pre-period shares and exogenous shocks, including diagnostics for weak instruments and shock validity.

Instructions

Bartik / shift-share IV estimator (Adao-Kolesar-Morales 2019; Borusyak-Hull-Jaravel 2022). Uses pre-period industry / group shares x exogenous shocks as an instrument for local outcome exposure. Assumptions: Exogeneity of shocks conditional on pre-period exposure structure (Borusyak-Hull-Jaravel); Shock-level IV: shocks are independent of region-level unobserved trends; Asymptotic framework: many shocks (L -> inf) -- check via sp.ssaggregate Herfindahl. Pre-conditions: pre-period shares are pre-determined (measured strictly before the outcome window); shocks are as-good-as-random conditional on unit-level controls; >= 50 regions for AKM shift-share SE to be well-sized. Failure modes: Herfindahl of shares too concentrated (one industry dominates) -> Shift-share SE unreliable -- use Adao-Kolesar-Morales shock-level SE via sp.shift_share_se; First-stage F < 10 -> Shares don't predict exposure enough -- report weak-IV-robust CI (sp.anderson_rubin_ci); Shocks correlate with pre-trends -> Shock exogeneity fails -- drop the violating shock dimension or add trend controls. Alternatives: sp.iv, sp.shift_share_se, sp.shift_share_political, sp.shift_share_political_panel. Typical minimum N:...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome (e.g. local wage growth)
endogYesEndogenous local exposure being instrumented (e.g. employment growth)
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
sharesYesPre-period share column (e.g. industry share)
shocksYesShock column (e.g. industry-level change)
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.
covariatesNoCovariate matrix, DataFrame, or column names.
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
Behavior4/5

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

The annotations declare readOnlyHint=true, so the agent knows this is a read-only estimation operation. The description adds substantial behavioral context beyond the annotations: it discloses the asymptotic framework (many shocks, L -> inf), the minimum sample size requirement (>=50 regions), and specific failure modes with their consequences. It doesn't describe the output format in detail, but the output schema exists and covers that. The only minor gap is not explicitly stating that this is a read-only operation, but the annotation covers that.

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 dense and information-rich, covering assumptions, pre-conditions, failure modes, and alternatives in a compact format. It's front-loaded with the core definition. However, it's quite long and the 'Typical minimum N:...' sentence is cut off, which is a minor structural flaw. The density is justified by the complexity of the tool, but the truncation prevents a 5.

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 econometric estimator, the description is remarkably complete: it covers the estimator's mechanism, assumptions, pre-conditions, failure modes with remedies, and alternatives. The output schema exists, so return values are documented. The only missing piece is the truncated 'Typical minimum N' sentence, but the >=50 regions condition is already stated. An agent has everything needed to decide whether to use this tool and how to interpret its results.

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 11 parameters. The description adds context for the key parameters (shares, shocks, endog, y) by explaining the econometric mechanism, but doesn't add syntax or format details beyond what the schema provides. Baseline 3 is appropriate when the schema does 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 clearly identifies the tool as a Bartik/shift-share IV estimator, names the specific econometric references (Adao-Kolesar-Morales 2019; Borusyak-Hull-Jaravel 2022), and explains the core mechanism: pre-period shares x exogenous shocks as an instrument for local outcome exposure. This is a specific verb+resource combination that distinguishes it from the many sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides extensive usage guidance: explicit assumptions (exogeneity of shocks, shock-level IV, many shocks asymptotic framework), pre-conditions (pre-determined shares, as-good-as-random shocks, >=50 regions), and failure modes with specific remedies (Herfindahl concentration -> use sp.shift_share_se; weak first stage -> sp.anderson_rubin_ci; pre-trend correlation -> drop shock or add controls). It also names alternatives (sp.iv, sp.shift_share_se, sp.shift_share_political, sp.shift_share_political_panel). This is exemplary.

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