Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

continuous_did

Read-only

Estimate causal effects of a continuous treatment dose using difference-in-differences. Choose from TWFE, group-time ATT, dose-response, or CGS methods for panel data.

Instructions

DiD with continuous treatment intensity. Four modes: (i) 'twfe' TWFE with dosexpost interaction; (ii) 'att_gt' dose-quantile group-time ATT versus the untreated (dose=0) arm with bootstrap SE (heuristic); (iii) 'dose_response' local-linear regression of DeltaY=Y_post-Y_pre on baseline dose; (iv) 'cgs' Callaway-Goodman-Bacon-Sant'Anna (2024) ATT(d|g,t) MVP -- 2-period design, OR only, bootstrap SE, [pending verification] markers on paper formulas. Full CGS parity (cohort aggregation, DR/IPW, analytical IF variance) is on the roadmap -- see docs/rfc/continuous_did_cgs.md. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Known limitations: method='cgs' is an MVP -- 2-period design, OR only, bootstrap SE; full CGS parity (cohort aggregation, DR/IPW, analytical IF variance) is on the roadmap (see docs/rfc/continuous_did_cgs.md). Other modes (twfe / att_gt / dose_response) are stable. Assumptions: Parallel trends in potential outcomes across dose levels; No anticipation of treatment; Strong parallel trends (CGS 2024) required for ATT(d|g,t) interpretation in att_gt mode. Pre-conditions: panel data with unit x time x outcome x contin...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable
idYesUnit identifier
doseYesContinuous treatment / dose variable
postNoBinary post-treatment indicator (inferred from t_pre / t_post if omitted)
seedNoRandom seed for reproducible stochastic steps.
timeYesTime period column
alphaNoSignificance level for confidence intervals and tests.
t_preNoLast pre-treatment period
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
methodNoEstimation modeatt_gt
n_bootNoBootstrap replications for SE
t_postNoFirst post-treatment period
clusterNoCluster variable for SE (TWFE mode)
controlsNoControl variables
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.
n_quantilesNoNumber of dose quantiles for discretisation
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
Behavior5/5

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

The description substantially enriches the readOnlyHint annotation by disclosing that cgs is an MVP with pending verification, that other modes are stable, that bootstrap SEs are heuristic, and that full CGS parity is on the roadmap. It also lists model assumptions and pre-conditions, giving an agent a realistic sense of the tool's reliability and scope.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The description is front-loaded with purpose and mode names, but it is verbose and contains redundancy: the CGS MVP limitation and roadmap reference appear twice in nearly identical phrasing. The density of caveats is useful, but tighter editing would make it more effective.

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?

For a complex econometric tool with 20 parameters and an output schema, the description is largely complete: it covers modes, assumptions, pre-conditions, known limitations, and validation status. It lacks an explicit comparison to sibling tools, but the output schema and rich schema descriptions fill most structural gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds useful meaning beyond the schema by explaining what the method parameter values actually compute, such as 'TWFE with dosexpost interaction' and 'local-linear regression of DeltaY=Y_post-Y_pre on baseline dose.' It does not systematically document all 20 parameters, but the additional method-level semantics justify a small uplift.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'DiD with continuous treatment intensity' and enumerates four distinct estimation modes, giving a specific verb and resource. It does not explicitly differentiate itself from siblings such as cgs_continuous_did or did, despite overlapping method names in the sibling list, so it falls short of full sibling differentiation.

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 provides clear context on when the tool applies: it requires panel data with continuous treatment and lists pre-conditions, assumptions, and stable versus MVP modes. It does not explicitly say when to use another sibling tool instead, but it does give enough method-selection and caveat guidance to be useful.

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