Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

dml_panel

Read-only

Estimates causal treatment effects from long panel data using double/debiased machine learning with unit and optional time fixed effects, cross-fitting, and cluster-robust standard errors.

Instructions

Long-panel Double/Debiased ML for static panel models with fixed effects (Clarke & Polselli 2025, simplified). Absorbs unit (and optional time) fixed effects via within-transform, cross-fits ML nuisance learners with folds that split units, and reports cluster-robust SE at the unit level. PLR moment (continuous or binary treatment). Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Conditional unconfoundedness within unit: E[epsilon_it | X_it, alpha_i, lambda_t] = 0; Strict exogeneity conditional on covariates (weaker than standard FE); Nuisance learners converge fast enough (op(n^{-1/4})) after within-transform. Pre-conditions: long panel: at least unit and outcome columns; include_time_fe=True needs time column; enough units (clusters) for cluster-robust SE -- >= 30 ideally; enough periods per unit for within-transform to leave variation in the treatment. Failure modes: Few units (< 30) -- cluster-robust SE under-coverage -> Use wild cluster bootstrap (sp.wild_cluster_bootstrap) or CR3 jackknife; Within-unit variation in treatment is near zero -> Unit FE absorbs almost all treatment variation -- switch to between...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome column
ml_gNoOutcome nuisance learner
ml_mNoTreatment nuisance learner
seedNoRandom seed for reproducible stochastic steps.
timeNoTime column (required if include_time_fe)
unitYesUnit ID column (FE + clustering)
alphaNoSignificance level for confidence intervals and tests.
treatYesTreatment column
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_foldsNoNumber of cross-fitting or cross-validation folds.
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.
covariatesYesCovariate columns X_it
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.
include_time_feNoWhether to include time fe.
binary_treatmentNobinary_treatment parameter (bool).

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
Behavior5/5

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

Despite readOnlyHint=true already signaling a read-only operation, the description adds substantial behavioral context beyond annotations: it details the estimation mechanics (within-transform, cross-fitting, cluster-robust SE), explicit statistical assumptions, and failure modes. This is precisely the kind of context that helps an agent anticipate edge cases and interpret results, and no contradiction with annotations exists.

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 organized into purpose, assumptions, pre-conditions, and failure modes, which is structured. However, it is verbose and includes a truncated final sentence ('switch to between...') that breaks flow and leaves a recommendation incomplete. Some phrases like 'Validation: validated evidence tier' are opaque and add little value, making the description longer than needed.

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 estimation tool, the description covers key contextual areas: assumptions, preconditions, failure modes, and alternatives. The output schema exists, so return values don't need explanation. The only meaningful gap is the truncated 'switch to between...' instruction, which would have completed the failure-mode guidance. Overall, it is comprehensive but not flawless.

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. The description does not go into per-parameter detail beyond the schema; it mentions include_time_fe needs a time column, but that is already in the schema. It adds some context about n_folds implicitly via cross-fitting, but no substantive new parameter semantics beyond the structured schema.

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 explicitly identifies the tool as 'Long-panel Double/Debiased ML for static panel models with fixed effects', naming the method, resource, and scope. It distinguishes itself from the generic sibling 'dml' by mentioning within-transform, cross-fitting with folds that split units, and cluster-robust SE at the unit level. The PLR moment and treatment types are also specified, leaving no ambiguity about what the tool does.

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?

Pre-conditions are clearly listed, including required panel structure, minimum cluster count (>=30), and the need for within-unit variation in treatment. Failure modes are explicitly linked to alternatives: 'Few units (< 30) ... Use wild cluster bootstrap (sp.wild_cluster_bootstrap) or CR3 jackknife' and 'switch to between...' for near-zero within-unit variation. This gives the agent concrete decision rules for when to use this tool versus others.

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