Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

g_computation

Read-only

Estimate ATE, ATT, or dose-response causal effects using parametric g-formula standardization, with bootstrap SEs and diagnostics.

Instructions

Parametric g-formula (standardization) estimator. ATE/ATT for binary D, or dose-response curve for continuous D. Consistent under correctly-specified outcome model; not doubly robust. Validation: certified parity evidence. Assumptions: Sequential exchangeability / no unmeasured confounding at each time point; Positivity: every treatment level is possible given the past; Correct specification of the treatment and/or outcome models. Pre-conditions: Sequentially measured covariates, (time-varying) treatment, and outcome; Models for the treatment process and the outcome (or weights). Failure modes: Stabilized weights have extreme values (positivity near-violation) -> Truncate weights, simplify the treatment model, or use a doubly-robust estimator (TMLE). Alternatives: sp.tmle, sp.g_computation, sp.ipw. Typical minimum N: 300.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome
treatYesTreatment variable
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_bootNoBootstrap replications for SE
estimandNoTarget estimandATE
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.
covariatesYesBaseline covariates
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
treat_valuesNoDose grid (required for dose_response)
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
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses statistical behavior: consistency under correctly specified outcome model, lack of double robustness, sequential exchangeability and positivity assumptions, preconditions, and a concrete failure mode with recommended remedies. No contradiction with the annotations.

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 but well structured with labeled sections for assumptions, preconditions, failure modes, alternatives, and sample size. The front-loaded definition is clear. The phrase 'Validation: certified parity evidence' is slightly vague, but overall every major section earns its place.

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 with a rich schema and output schema, the description covers identification assumptions, positivity, model specification, preconditions, failure modes, and alternatives. Nothing essential for correct invocation appears missing.

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 coverage is 100%, so the baseline is 3. The description adds a little context by linking binary D to ATE/ATT and continuous D to dose-response, but it does not substantially enrich parameter understanding 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 the tool as a parametric g-formula/standardization estimator and states the exact estimands it produces: ATE/ATT for binary treatment and dose-response curves for continuous treatment. It also distinguishes itself from doubly robust alternatives by explicitly stating it is not doubly robust.

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 gives rich usage context: assumptions, preconditions, failure modes, and named alternatives (sp.tmle, sp.ipw). However, it does not explicitly state a crisp 'use this when X, use TMLE when Y' decision rule; the guidance is largely implicit through the consistency statement and failure-mode recommendation.

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