Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

aggte

Read-only

Aggregate Callaway-Sant'Anna group-time treatment effects into overall, event-study, group, or calendar-time summaries with cluster-robust bootstrap inference.

Instructions

Aggregate Callaway-Sant'Anna group-time ATTs into interpretable summaries -- overall ATT, event-study by relative time, group-specific ATT(g), or calendar-time ATT(t). Inference uses the multiplier bootstrap on the pre-stored influence functions, so SEs are correct under clustering at the unit level. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Same identifying assumptions as the source estimator (parallel trends, no anticipation, SUTVA); For dynamic aggregation: balanced panel within the requested event-time window (use balance_e). Pre-conditions: result was produced by sp.callaway_santanna or sp.did with staggered=True; result.detail contains the per-(g, t) ATT estimates and their influence functions. Failure modes: result.detail is empty or missing influence functions -> Re-run sp.callaway_santanna; aggte requires the per-(g,t) influence functions; Empty event-time aggregation (no overlapping cohorts) -> Widen the (min_e, max_e) window or drop balance_e. Alternatives: sp.callaway_santanna, sp.sun_abraham, sp.did_imputation. Typical minimum N: 50.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoAggregation typesimple
alphaNoSignificance level for confidence intervals and tests.
cbandNoUniform confidence band
max_eNomax_e parameter (float).
min_eNomin_e parameter (float).
na_rmNoDrop ATT(g,t) cells with missing / infinite SE before aggregating
bstrapNobstrap parameter (bool).
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_bootNoNumber of bootstrap replications.
resultYesOutput of sp.callaway_santanna or sp.did with staggered=True
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.
balance_eNoFor dynamic: cap event time at +/-balance_e for balanced panel
boot_typeNoBootstrap variantmultiplier
data_pathNoAbsolute 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.
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the multiplier bootstrap inference, unit-level clustering behavior, dynamic-balancing requirement, and failure modes involving missing influence functions. There is no contradiction with the read-only annotation.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, then organized into clearly labeled sections: assumptions, preconditions, failure modes, alternatives, and typical minimum N. It is dense but well-structured, with each section adding actionable information.

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 18-parameter tool with an output schema, this description supplies the missing context an agent needs: assumptions, valid inputs, likely failure modes, alternatives, and an operating constraint. Nothing essential for correct invocation is missing.

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 schema already documents every parameter. The description adds operational meaning beyond the schema by explaining what result.detail must contain, when balance_e is needed, and how min_e/max_e relate to empty event-time aggregation.

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 specific verb and resource: 'Aggregate Callaway-Sant'Anna group-time ATTs into interpretable summaries' and enumerates the four aggregation modes. It also names alternatives, so the tool is distinguishable from source estimators like sp.callaway_santanna.

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?

It gives explicit preconditions: the result must come from sp.callaway_santanna or sp.did with staggered=True and must contain per-(g,t) influence functions. It also documents failure modes and corrective actions, making when-to-use and alternatives 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