Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

rd_discrete

Read-only

Estimates regression discontinuity causal effects with a discrete running variable, providing honest confidence intervals that remain valid under sparse mass points.

Instructions

Honest CI for RD when the running variable takes only a moderate number of distinct values (Kolesar-Rothe 2018 AER). Uses bounded second derivative or bounded misspecification smoothness classes; robust to the loss of asymptotics that affects rdrobust under sparse mass points. Assumptions: Continuity of potential outcomes in x at c (Hahn, Todd, van der Klaauw 2001); No manipulation of x at c (McCrary density test); Local randomization only in a neighborhood of c -- extrapolation away from c is not identified. Pre-conditions: running variable x is continuous with support on both sides of c; treatment assignment is determined by the cutoff c (sharp) or probabilistically at c (fuzzy); sufficient mass of observations within the optimal bandwidth. Failure modes: McCrary density test p < 0.05 -> Use donut-hole RD (donut=) or partial-identification bounds; Covariate imbalance at cutoff (sp.rdbalance rejects) -> Include covariates as controls, narrow bandwidth, or report as caveat; Effect unstable across bandwidth halvings -> Report sp.rdbwsensitivity and sp.rd_honest (Armstrong-Kolesar honest CI). Alternatives: sp.rdrobust, sp.rd_honest, sp.rdrbounds, sp.bounds. Typical minimum N:...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
KNoBound on per-side linear-approximation bias; auto if None (BM method)
MNoBound on |g''|; auto if None (BSD method)
cNoc parameter (float).
hNoBandwidth used for local smoothing or kernel weighting.
xYesDiscrete running variable
yYesOutcome variable column name or outcome array.
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
methodNoSmoothness classbsd
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

The description adds rich context beyond the readOnlyHint annotation: statistical assumptions, local-randomization scope, non-identification of extrapolation, and failure-mode diagnostics. It is penalized for the internal inconsistency between discrete running variable and the 'continuous' precondition, plus the truncated 'Typical minimum N' sentence, which obscure the operational boundary.

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 well-organized with labeled sections and a front-loaded summary; the assumptions, failure modes, and alternatives are dense but relevant. It loses a point for the incomplete final sentence ('Typical minimum N:...') and for the contradictory continuous/discrete running-variable statement, which introduce avoidable confusion.

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?

With an output schema present and readOnlyHint annotation, the description does not need to explain return values. It covers assumptions, preconditions, failure modes, and alternatives comprehensively for a complex estimator. A full 5 is not warranted because the contradictory precondition and truncated minimum-N guidance leave an operative gap for an agent deciding whether the data qualify.

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 even without parameter elaboration in the description. The description does add methodological context for method (bsd/bm) and bandwidth relevance, but it does not explain individual parameters such as K, M, or h in any detail, and none is required given full schema coverage.

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 first sentence states the tool's specific purpose: honest CI for RD when the running variable has a moderate number of distinct values, and it explicitly contrasts this with rdrobust under sparse mass points. The name and description align, and the tool is distinguishable from nearby siblings such as rdrobust and rd_honest.

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 provides assumptions, preconditions, failure modes with recommended remedies, and an explicit alternatives list. It loses a point because it never crisply states 'use this when x is discrete' as a rule, and the precondition 'running variable x is continuous' directly contradicts the tool's stated discrete-purpose, weakening the routing guidance.

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