Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

cs_report

Read-only

Generates a comprehensive staggered difference-in-differences analysis report, featuring diagnostics, coefficient estimates, and actionable next steps for evidence-based business decisions.

Instructions

One-call staggered-DID workflow following Baker et al. (2026).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gNoOutcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame).
iNoOutcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame).
tNoOutcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame).
xNoCovariates for conditional parallel trends.
yNoOutcome / cohort / time / unit id columns (required when ``data_or_result`` is a DataFrame).
alphaNoSignificance level for confidence intervals and tests.
max_eNoEvent-time window passed to the dynamic aggregation.
min_eNoEvent-time window passed to the dynamic aggregation.
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_bootNoMultiplier-bootstrap replications for :func:`aggte`.
balanceNobalance parameter (bool).
save_toNoWhen set, treats the value as a *path prefix* and writes the report in every supported format in one call: - ``<prefix>.txt`` -- fixed-width plain-text report - ``<prefix>.md`` -- GitHub-flavoured Markdown - ``<prefix>.tex`` -- booktabs LaTeX fragment - ``<prefix>.xlsx`` -- multi-sheet workbook - ``<prefix>.png`` -- 2x2 summary figure (only if matplotlib is installed; silently skipped otherwise) Missing parent directories are created on the fly.
verboseNoIf ``True``, print the report before returning.
weightsNoUnit weights omega. Changes the target parameter, not just precision -- see :func:`statspai.did.callaway_santanna`.
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_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://.
estimatorNoestimator parameter (str).dr
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.
rr_methodNoSensitivity restriction handed to :func:`breakdown_m`.smoothness
triangulateNoAlso fit the other covariate strategies (regression adjustment, IPW, doubly robust) and report them side by side, as in the paper's Table 7 / Figure 4. Only meaningful with covariates.
anticipationNoanticipation parameter (int).
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
random_stateNoSeed for the bootstrap (set to ``None`` for non-reproducibility).
control_groupNocontrol_group parameter (str).nevertreated
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.
data_or_resultYesEither a long-format panel (then ``y, g, t, i`` are required and :func:`callaway_santanna` is run first), or an already-fitted :func:`callaway_santanna` result.
functional_formNofunctional_form parameter (bool).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.2/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, so the description need not repeat that. However, it adds no behavioral context: it does not disclose that the tool prints a report (verbose parameter), can save files (save_to), or returns a structured payload. For a tool with 27 parameters and an output schema, this is a significant gap beyond what annotations cover.

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 a single, concise sentence that is front-loaded with the main purpose. However, it is under-specified to the point of being unhelpful for a complex tool. Conciseness is good, but it sacrifices necessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 27 parameters, an output schema, and a rich set of siblings (callaway_santanna, aggte, did, etc.), the description is severely incomplete. It does not explain what the report contains, how the workflow operates, or how it relates to other DID tools. An agent would struggle to decide when to invoke this and what to expect.

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 all parameters have individual descriptions. The description itself does not add any parameter-level meaning or relationships (e.g., that data_or_result can be a DataFrame or result handle, or that y,g,t,i are required together). It meets the baseline but adds no extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool is a 'One-call staggered-DID workflow' referencing Baker et al. (2026), which conveys the method and that it is a complete pipeline. However, it does not explicitly say it produces a report, nor does it differentiate from closely related siblings like callaway_santanna, aggte, or staggered_cs. The purpose is clear enough but lacks precision.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description does not mention prerequisites, typical scenarios, or exclusions. An agent would have to infer usage from the schema and sibling names, which is insufficient.

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