Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

ddd

Read-only

Estimates causal effects with triple differences by adding an unaffected subgroup as a control dimension, relaxing parallel trends to differential trend assumptions.

Instructions

Triple Differences (DDD) estimator. Adds a within-treatment-group subgroup that is unaffected by treatment as an additional control dimension, relaxing parallel trends from 'same trend across groups' to 'same differential trend across subgroups within groups'. Validation: certified parity evidence. Assumptions: Parallel trends in the DDD differential (weaker than DID PT); No anticipation; SUTVA. Pre-conditions: treat x time x subgroup variation exists; subgroup is binary and meaningful within treatment group. Failure modes: Staggered adoption with heterogeneous effects -> Textbook DDD can have negative weights with staggered timing. The Olden-Men (2022) / Strezhnev (2023) heterogeneity-robust DDD is on the roadmap (see docs/rfc/did_roadmap_gap_audit.md Section 4). Alternatives: sp.did_2x2, sp.callaway_santanna. Typical minimum N: 100.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
timeYesTime period column.
alphaNoSignificance level for confidence intervals and tests.
treatYesPrimary treatment indicator
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
robustNoRobust standard-error or covariance estimator option.
clusterNoCluster identifier column for clustered standard errors.
weightsNoObservation weights.
subgroupYesWithin-group subgroup (1=affected, 0=not)
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.
covariatesNoCovariate matrix, DataFrame, or column names.
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.4/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, so the agent knows this is a read-only estimation operation. The description adds substantial behavioral context beyond that: it discloses the weaker parallel-trends assumption, the no-anticipation and SUTVA assumptions, the negative-weights failure mode under staggered adoption, and the roadmap for a heterogeneity-robust variant. It also gives a typical minimum N of 100. The only minor gap is not describing the return payload structure, but the output schema exists and the detail parameter documents payload depths.

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-organized: definition, validation, assumptions, pre-conditions, failure modes, alternatives, and minimum N. Every sentence carries information. It is longer than typical but justified by the methodological complexity of DDD. The structure is logical, moving from what it is to when to use it to when not to use it.

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 causal-inference estimator with 15 parameters and a rich output schema, the description covers all critical decision points: identification assumptions, pre-conditions, failure modes, alternatives, and sample size guidance. The output schema and detail parameter handle return-value documentation. Nothing an agent needs to decide whether to call this tool and how to interpret its results is 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 description coverage is 100%, so the baseline is 3. The description does not add parameter-level detail beyond the schema, but it does contextualize the key parameter 'subgroup' by explaining its role in the DDD design ('within-treatment-group subgroup that is unaffected by treatment'). The pre-conditions also clarify what values subgroup must take. This is adequate given full schema coverage.

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 a precise definition: 'Triple Differences (DDD) estimator' and immediately explains the methodological mechanism ('Adds a within-treatment-group subgroup that is unaffected by treatment as an additional control dimension'). This clearly distinguishes it from DID estimators and other causal inference tools. The verb 'estimates' is implicit but the resource and scope are unambiguous.

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 provides explicit when-to-use guidance: it relaxes parallel trends from 'same trend across groups' to 'same differential trend across subgroups within groups'. It lists pre-conditions (treat x time x subgroup variation exists; subgroup is binary and meaningful), failure modes (staggered adoption with heterogeneous effects), and names alternatives (sp.did_2x2, sp.callaway_santanna). This is exemplary routing guidance.

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