Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

cic

Read-only

Quantify distributional treatment effects by estimating counterfactual outcome distributions for treated units and reporting quantile treatment effects.

Instructions

Changes-in-Changes (Athey & Imbens 2006). Nonparametric quantile DiD that identifies the full counterfactual outcome distribution for treated units, not just the mean. Reports quantile treatment effects (QTE) via empirical-CDF transformation; bootstrap SE. Validation: certified parity evidence. Assumptions: Rank-invariance of untreated potential outcomes across periods; Time-invariant group-level production technology (distributional DiD); SUTVA. Pre-conditions: continuous-ish outcome with sufficient support overlap between treated and control; 2 periods, 2 groups. Failure modes: Discrete outcome with few support points -> CIC quantile transformation degenerates; use sp.qte or sp.drdid for mean effects. Alternatives: sp.qte, sp.drdid, sp.did_2x2. Typical minimum N: 200.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
seedNoRandom seed for reproducible stochastic steps.
timeYesPeriod indicator (0=pre, 1=post)
alphaNoSignificance level for confidence intervals and tests.
groupYesTreatment-group indicator (0/1)
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_bootNoNumber of bootstrap replications.
n_gridNoGrid size for inverse-CDF mapping
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://.
quantilesNoQuantile grid (default: deciles)
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.
covariatesNoCovariates for the Athey-Imbens (2006 p.466) two-step estimator; 'C(col)' / 'i.col' terms are absorbed as fixed effects
first_stageNoFirst-stage residualizer (only 'feols' supported)feols
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.7/5.0
Behavior5/5

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

Annotations mark the tool as read-only, and the description adds substantial behavioral and methodological context beyond that: it reports QTEs via empirical-CDF transformation with bootstrap SE, states modeling assumptions, preconditions, failure modes, and a typical minimum sample size. This gives the agent a strong sense of what the tool does and how it behaves.

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 organized, front-loading the core method and then covering assumptions, preconditions, failure modes, and alternatives with minimal fluff. Each section earns its place given the complexity of the estimator.

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 estimator, the description supplies the essential selection context: estimand, assumptions, data requirements, failure mode, alternative tools, and sample-size guidance. The input schema covers all parameters and an output schema exists, so the description does not need to restate 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 baseline is 3 even though the description does not repeat parameter-level details. The description adds useful high-level context (continuous outcome, two groups/two periods) but does not explain individual parameters beyond what the schema already 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 clearly identifies CIC as a nonparametric quantile difference-in-differences estimator that recovers the full counterfactual outcome distribution and reports QTEs. It distinguishes itself from mean-effect estimators with 'not just the mean' and explicitly names alternative 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 gives explicit when-to-use guidance: full distributional counterfactuals, continuous-ish outcomes, sufficient support overlap, and a 2-period/2-group design. It also states a clear when-not-to-use case (discrete outcomes with few support points) and routes to alternatives: sp.qte, sp.drdid, and sp.did_2x2.

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