Skip to main content
Glama

callaway_santanna

Read-only

Estimate group-time average treatment effects for staggered difference-in-differences with doubly robust, IPW, or regression-adjusted methods, handling heterogeneous effects where TWFE fails.

Instructions

Staggered DID (Callaway-Sant'Anna 2021): group-time ATT with doubly-robust, IPW, or regression-adjusted estimators. Robust to heterogeneous treatment effects where TWFE fails. Requires a cohort column g (first-treatment period; 0 = never-treated). Validation: certified evidence with scoped limitations. Known limitations: clustervars accepts a cluster that varies within unit only with panel=False (repeated cross-sections, as Stata csdid without ivar()); on a panel the influence functions are per unit.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "g": "<g>",
      "i": "<i>",
      "t": "<t>",
      "y": "<y>"
    },
    "name": "callaway_santanna"
  }
}

Input Schema

NameRequiredDescriptionDefault
gYesFirst-treatment-period cohort column (0 for never-treated).
iYesUnit ID column
tYesTime column
yYes
detailNoPayload depth; agent is the fullest.agent
data_idNoData handle (d_...) from load_data; replaces data_path.
data_csvNoSmall inline table as CSV text.
as_handleNoCache the fit and return its result_id.
data_pathNoAbsolute path of a data file on the server.
estimatorNodr
result_idNoHandle of an earlier fit made with as_handle=true.
data_recordsNoSmall inline table as row objects.
control_groupNonevertreated
max_output_bytesNoResult byte budget (default 262144; 0 = none).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish this as a safe, closed read (readOnlyHint=true, openWorldHint=false), and the description adds a validation status plus a real behavioral caveat about clustering and influence functions being per unit on a panel. That caveat is genuinely beyond what the annotations or schema convey, though 'certified evidence with scoped limitations' is too opaque to be actionable.

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 method, estimand, and estimator options are front-loaded in the first two sentences, and the limitation note is compact. The trailing 'clustervars' discussion is dense and references something not visible in this schema, which costs a bit of clarity but not much length.

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

Completeness3/5

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

An output schema exists, so return values need no explanation, but for a 14-parameter tool the description never touches the data-source options (data_id/data_csv/data_path/data_records), as_handle/result_id, or control_group. It also discusses a 'clustervars' argument that does not appear in the input schema, which risks misleading an agent about available parameters.

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 79%, so the schema largely documents g, i, t, y and the data-source handles. The description adds real meaning for the estimator enum (spelling out dr/ipw/reg) and restates the g coding, but says nothing about control_group, detail, as_handle, or the data-input precedence, leaving the remaining fifth of coverage with no extra support.

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?

Names the exact estimator and estimand: 'Staggered DID (Callaway-Sant'Anna 2021): group-time ATT' with a choice of dr/ipw/reg estimators. Contrasts itself explicitly with TWFE ('Robust to heterogeneous treatment effects where TWFE fails'), which is enough for an agent to separate it from a generic `did` tool.

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?

States the precondition that selects this tool ('where TWFE fails' / heterogeneous treatment effects) and the data prerequisite ('Requires a cohort column g ... 0 = never-treated'). It stops short of naming a concrete alternative for the non-staggered or homogeneous case, so it is clear context without explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.