Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

rd_honest

Read-only

Compute honest confidence intervals for sharp regression discontinuity with provable finite-sample coverage, avoiding bandwidth-selection bias by bounding the second derivative of E[Y|X].

Instructions

Armstrong-Kolesar (2018) honest confidence intervals for sharp regression discontinuity -- the only RD inference procedure with provable finite-sample coverage without bandwidth-selection bias. M is the upper bound on the second derivative of E[Y|X] near the cutoff; smaller M means tighter CIs but riskier coverage if the true curvature is larger. Validation: certified parity evidence. Assumptions: E[Y|X] has bounded second derivative |E[Y|X]''| <= M near c; Continuity of potential outcomes at c (Hahn-Todd-van der Klaauw 2001); No manipulation of x at c (run sp.mccrary_test alongside). Pre-conditions: x is continuous with support on both sides of c; Sample mass within the optimal bandwidth on each side; User-supplied M (or willingness to estimate it from data). Failure modes: M estimated from data and effective sample tiny -> Pass an explicit M based on theory or sensitivity analysis (M_grid in Armstrong-Kolesar 2018 Section 4); Honest CI much wider than rdrobust CI -> rd_honest is honest by construction (covers under any |f''| <= M); rdrobust trades coverage for precision. Reporting both is recommended; McCrary density test p < 0.05 -> Use donut-hole RD (donut=) or partia...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
MNoUpper bound on |E[Y|X]''| near c; if None, estimated from data
cNoCutoff value
hNoBandwidth; auto-selected by opt_criterion if None
xYesRunning variable
yYesOutcome variable
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
kernelNoLocal-linear kerneltriangular
sclassNoSmoothness class for the bound M: 'H' (Holder, RDHonest's default -- f' is M-Lipschitz) or 'T' (Taylor)H
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.
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.
opt_criterionNoBandwidth optimization criterionmse

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses assumptions (bounded second derivative, continuity, no manipulation), preconditions (continuous x, sample mass on both sides), and failure modes with concrete remedies. It also exposes the key M tradeoff between tighter CIs and coverage risk. Nothing contradicts 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.

Conciseness4/5

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

The description is long but information-dense: assumptions, preconditions, failure modes, and alternatives all earn their place. It is front-loaded with the core purpose. However, it is a single dense block rather than cleanly sectioned, and it ends abruptly with a truncated phrase ('or partia...'), which slightly hurts structural polish.

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 method with 15 parameters, the description covers selection-relevant context: statistical assumptions, data preconditions, parameter tradeoffs, alternative procedures, and failure-mode handling. Since an output schema exists, the description does not need to explain return values. An agent has enough to decide whether and how to invoke rd_honest.

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 adds useful meaning for M — smaller M gives tighter CIs but riskier coverage — and references M_grid for sensitivity analysis. However, it adds little beyond the schema for the other 14 parameters, and the schema already documents them adequately.

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 identifies the tool as producing Armstrong-Kolesar (2018) honest confidence intervals for sharp regression discontinuity, which is a specific verb-resource pairing. It also distinguishes itself from rdrobust by emphasizing provable finite-sample coverage without bandwidth-selection bias, so an agent can tell it apart from the many RD sibling tools.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use and when-not-to-use guidance: run sp.mccrary_test alongside, pass an explicit M when the data-driven estimate is unreliable, prefer donut-hole RD if the McCrary test rejects, and report rd_honest together with rdrobust. It names rdrobust as the precision-oriented alternative and explains the tradeoff.

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