Skip to main content
Glama

bacon_decomposition

Read-only

Decompose a two-way fixed-effects DID estimate into 2x2 comparison weights to reveal whether negative-weight treated-vs-treated comparisons drive the result before you trust it.

Instructions

Goodman-Bacon (2021) decomposition: breaks the two-way fixed-effects DID estimator into its 2x2 comparison weights. Reveals whether treated-vs-treated comparisons (which can have negative weights) dominate the estimate. Run this before trusting a TWFE-DID point estimate. Validation: certified parity evidence.

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": {
      "id": "<id>",
      "time": "<time>",
      "treat": "<treat>",
      "y": "<y>"
    },
    "name": "bacon_decomposition"
  }
}

Input Schema

NameRequiredDescriptionDefault
yYes
idYes
timeYes
treatYes
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.
result_idNoHandle of an earlier fit made with as_handle=true.
data_recordsNoSmall inline table as row objects.
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

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the bar is lower. The description adds genuine behavioral value by explaining that treated-vs-treated comparisons can carry negative weights and can dominate the estimate, plus a validation claim. However, it says nothing about data requirements (staggered timing, balanced panel, binary absorbing treatment), which is the main failure mode for this diagnostic.

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?

Three tight sentences, front-loaded with the method and mechanism before the recommendation. Minor waste in the trailing fragment "Validation: certified parity evidence," which is cryptic in isolation, but overall there is very little filler.

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?

Because an output schema exists, the description need not explain return values, and the read-only safety profile is covered by annotations. For a 12-parameter panel-data diagnostic, though, it omits input data preconditions and does not point at sibling estimators to use when the decomposition reveals a problematic weighting.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description contributes no parameter meaning at all. The four required parameters (id, time, treat, y) are bare strings with no schema descriptions, and the description never explains the expected long-format panel layout or the role of each column. With 12 parameters and only 67% schema coverage, the undocumented required core is the most consequential gap and the prose does not compensate.

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 names a specific method (Goodman-Bacon 2021 decomposition), the exact estimator it operates on (two-way fixed-effects DID), and the output concept (2x2 comparison weights). It is immediately distinguishable from siblings like did, callaway_santanna, and honest_did, which are estimation rather than decomposition tools.

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?

It gives a clear usage directive: "Run this before trusting a TWFE-DID point estimate," which establishes the decision context (diagnostic step preceding DID interpretation). It does not name explicit alternatives or state when NOT to run it (e.g., when there is no variation in treatment timing), so it falls short of full routing guidance.

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