Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

hal_tmle

Read-only

Estimate causal treatment effects (ATE/ATT) from observational data using TMLE with Highly Adaptive Lasso nuisance learners, providing double-robust inference with confidence intervals.

Instructions

TMLE with Highly Adaptive Lasso (HAL) nuisance learners (Qian & van der Laan 2025). The stable 'delta' variant plugs HAL into standard TMLE. The reserved 'projection' variant raises NotImplementedError until the Riesz-projection targeting step has reference parity. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Known limitations: variant='projection' raises NotImplementedError -- the Riesz-projection targeting step from Li-Qiu-Wang-vdL (2025) Section 3.2 is not yet ported (the v1.11.x code path was a no-op on the point estimate; see CHANGELOG). The implementation roadmap and parity-test gates are in docs/rfc/hal_tmle_projection.md. Assumptions: Unconfoundedness (sequential exchangeability for longitudinal/LTMLE); Positivity / overlap of treatment given history; At least one nuisance (outcome or treatment) is estimated consistently; the targeting step gives double robustness. Pre-conditions: Covariates, treatment, and outcome (for survival/longitudinal variants: time-to-event and time-varying covariates); Enough data to fit a Super Learner / HAL nuisance library. Failure modes: Near-positivity violations create extreme clever...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
alphaNoSignificance level for confidence intervals and tests.
treatYesBinary treatment
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.
variantNoHAL-TMLE variantdelta
estimandNoEstimandATE
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 matrix, DataFrame, or column names.
C_propensityNoInverse L1 penalty for HAL propensity classifier
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.
lambda_outcomeNoOutcome L1 penalty; None -> 5-fold CV
max_anchors_per_colNoColumn name for max anchors per.

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

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

Annotations provide readOnlyHint=true and openWorldHint=false, but the description goes well beyond them by detailing known limitations, failure modes, the no-op status of the projection variant at v1.11.x, and the parity-test gates. The only minor gap is the truncated failure-mode sentence, which cuts off before completion.

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 structured with labeled sections (Validation, Known limitations, Assumptions, Pre-conditions, Failure modes), making it scannable. It earns its length because it conveys serious limitations and assumptions. It loses one point because the final sentence is truncated mid-thought, and some redundancy exists around the projection variant.

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?

Given the tool's complexity — 17 parameters, two variants, one unusable variant, exposure to assumptions and failure modes — the description covers the essential context well and even points to a design doc. It stops short of a full account of expected outputs, but the output schema exists and the description explicitly names failure modes. The truncation of the failure-modes sentence prevents a 5.

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 17 parameters. The description adds very little parameter-level meaning beyond what the schema provides, though it does contextualize the 'projection' variant's relationship to the implementation roadmap. Baseline 3 is appropriate.

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 opens with 'TMLE with Highly Adaptive Lasso (HAL) nuisance learners', naming a specific statistical method, and names two variants ('delta' and 'projection') with their behaviors. It also cites Qian & van der Laan 2025, distinguishing this from siblings like tmle, ltmle, and super_learner.

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 does not explicitly name sibling tools, but it gives strong contextual guidance: it warns that variant='projection' raises NotImplementedError and directs users to docs/rfc/hal_tmle_projection.md, and it lays out assumptions/pre-conditions. It lacks explicit 'use X instead of Y' statements, but for a causal-inference estimator with an obvious family, the implied usage is clear.

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