Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

synthdid_estimate

Read-only

Estimate causal treatment effects from panel data via synthetic difference-in-differences, with pre-trend diagnostics and placebo inference for validation.

Instructions

R-style alias: synthdid::synthdid_estimate. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Parallel trends in the absence of treatment, after the synthetic/DiD weighting; No anticipation and no interference between units (SUTVA); The control pool's outcome process is stable around the intervention. Pre-conditions: Panel with treated and control units and a clear treatment date; Pre-treatment periods available to assess comparability of trends; panel data in long form (unit x time x outcome). Failure modes: Weighted pre-treatment trends still diverge between treated and synthetic control -> Inspect the unit/time weights and pre-trend fit; consider event-study DiD with honest bounds; Pre-treatment RMSPE > post-treatment effect -> Poor pre-fit -- switch to method='demeaned'/'augmented' or enlarge donor pool; Placebo p-value >= 0.1 despite visible gap -> Use inference='conformal' (valid under weak assumptions) or report ranked placebo statistic. Alternatives: sp.synth, sp.augsynth, sp.callaway_santanna, sp.gardner_did. Typical minimum N: 15.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
timeYesTime period column.
unitYesUnit identifier column.
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
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.
treat_timeYestreat_time parameter.
treat_unitYestreat_unit parameter.
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

B3.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, covering the non-mutating behavior. The description adds valuable behavioral context beyond the annotations: statistical assumptions (parallel trends, SUTVA, no anticipation), pre-conditions, and failure modes (pre-trend divergence, RMSPE, placebo p-value) that an agent should know before calling and when interpreting results. It does not contradict 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.

Conciseness3/5

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

The description is well-organized with labeled sections (Validation, Assumptions, Pre-conditions, Failure modes, Alternatives, Typical N), but it is long and dense. The opening line is unhelpful, and the actual purpose is buried among operational details. It could be more concise by stating the core function first and moving some failure-mode detail to an output schema or linked documentation.

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 complexity of 11 parameters and 6 required ones, the full schema coverage and presence of an output schema cover structural details. The description fills in domain context—assumptions, pre-conditions, failure modes, alternatives, and minimum sample size—making it fairly complete for an agent to decide when to call and how to interpret common issues. It lacks an explicit plain-English statement of what the tool returns, but the output schema likely addresses that.

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 any parameter-specific semantics; it only tangentially references method='demeaned'/'augmented' and inference='conformal' in failure modes, which are not even among the schema's parameters. It does not clarify the meaning of required parameters like treat_time or treat_unit, leaving the schema's minimal descriptions to carry the burden.

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

Purpose2/5

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

The description opens with 'R-style alias: synthdid::synthdid_estimate', which is a tautology and does not explicitly state that the tool estimates a synthetic difference-in-differences treatment effect. While it mentions synthetic/DiD weighting and synthetic control, the core verb-resource statement is absent, and the tool is not clearly distinguished from siblings like synth, sdid, or robust_synth.

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

Usage Guidelines3/5

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

The description lists pre-conditions (panel with treated/control units, treatment date, long form) and alternatives (sp.synth, sp.augsynth, sp.callaway_santanna, sp.gardner_did), which imply when to use the tool, but it does not explicitly differentiate among alternatives or state when not to use it. The failure modes provide troubleshooting guidance but not usage selection criteria.

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