Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

pretrends_equivalence

Read-only

Tests that pre-treatment trends are demonstrably small using F and TOST equivalence tests, countering low-power false reassurance from standard pre-trend tests.

Instructions

Pre-trend equivalence tests (Liu, Wang & Xu 2024, the fect diagnostic panel). Reverses the usual null: instead of testing whether pre-period effects are zero, tests whether they are demonstrably small. Failing to reject 'no pre-trend' is often just low power (Roth 2022), so the conventional test alone overstates the evidence for parallel trends. Reports the joint F test alongside its non-central-F and TOST equivalence counterparts, where a small p-value is the reassuring outcome. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Known limitations: the TOST is computed only when tost_threshold is supplied; there is no universal outcome-scale default, so it is not invented. Pre-conditions: result carries influence functions so the joint pre-period covariance can be recovered; at least two pre-treatment periods (one is absorbed as the normalisation reference); more treated units than pre-periods. Alternatives: sp.pretrends_test, sp.pretrends_power, sp.honest_did.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alphaNoSignificance level for confidence intervals and tests.
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
resultYesDiD result carrying an event study and influence functions (e.g. sp.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://.
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.
f_thresholdNoDimensionless effect-size bound for the F equivalence test (fect's default)
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.
tost_thresholdNoEquivalence bound in outcome units. Omitted by default because there is no defensible universal scale for 'negligible pre-trend'; the TOST is skipped when it is not supplied. fect uses 0.36 * residual SD.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so no contradiction. The description adds valuable behavioral context: it reports joint F, non-central-F, and TOST tests, clarifies that a small p-value is the reassuring outcome, and discloses the known limitation that TOST requires tost_threshold with no invented default. Pre-conditions about influence functions and data requirements further enhance transparency beyond annotations.

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 description is longer than ideal but well-structured with labeled sections (Validation, Known limitations, Pre-conditions, Alternatives) and front-loaded with the core concept. Some content, like citations and validation tier, is tangential to invocation, but it remains organized and readable.

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 statistical tool with 10 parameters, the description covers purpose, conceptual rationale, limitations, pre-conditions, and alternatives. Combined with a 100%-covered schema and an output schema, an agent has enough context to select and invoke the tool correctly. No critical gaps remain.

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's mention of tost_threshold largely repeats the schema's note about no universal default, and it does not add new meaning for the other parameters. It provides conceptual framing but no additional parameter-level detail beyond the schema.

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 states a specific verb and resource ('Pre-trend equivalence tests') and clearly distinguishes itself from the conventional pretrends test by explaining it reverses the null and tests for demonstrably small pre-period effects. It names sibling tools as alternatives, making differentiation explicit. The core function is unmistakable.

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?

The description explains when equivalence testing is appropriate (when the conventional test alone overstates evidence due to low power) and lists pre-conditions that must hold for the tool to work. It names alternatives (sp.pretrends_test, sp.pretrends_power, sp.honest_did) but does not map each alternative to a specific scenario, leaving some inference to the agent.

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