Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

rkd

Read-only

Estimate causal treatment effects from a regression kink at a known cutoff, with automatic bandwidth selection and diagnostics for validity.

Instructions

Regression Kink Design estimator (Card et al., 2015). Assumptions: Conditional expectations of potential outcomes are continuous at the cutoff; Units cannot precisely manipulate the running variable around the cutoff (no sorting); For fuzzy designs: monotonicity of treatment take-up at the cutoff. Pre-conditions: A continuous running/forcing variable with a known cutoff that (sharply or fuzzily) assigns treatment; Enough observations in a neighbourhood of the cutoff to fit a local polynomial. Failure modes: Density of the running variable jumps at the cutoff (manipulation / sorting) -> Run a McCrary / density test (rdplotdensity); if manipulation is present the design is invalid near the cutoff; Estimate swings with the bandwidth -- results are not robust -> Report a bandwidth-sensitivity curve and use a data-driven MSE-optimal bandwidth. Alternatives: sp.rdrobust, sp.rdrandinf, sp.rdbwselect. Typical minimum N: 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cNoKink point (cutoff).
hNoBandwidth. If None, an MSE-optimal bandwidth is selected automatically.
pNoLocal polynomial order (1 = local linear, the default and most common choice for RKD).
xYesRunning variable name.
yYesOutcome variable name.
alphaNoSignificance level for confidence intervals.
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
kernelNoKernel function: 'triangular', 'epanechnikov', or 'uniform'.triangular
clusterNoCluster variable name for clustered standard errors.
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.
treatmentNoTreatment variable for fuzzy RKD. If None, estimate the reduced-form kink in E[Y|X] (sharp / reduced-form RKD).
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.9/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false. The description adds substantial behavioral context beyond that: three named statistical assumptions, failure modes (density jumps at cutoff, bandwidth sensitivity), consequences, and remediation actions. This gives the agent a realistic model of when results are trustworthy, which annotations alone cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

The description is long but every section earns its place: assumptions, pre-conditions, failure modes with remedies, alternatives, and minimum sample size. It is clearly structured with labeled sections and front-loaded with the method's identity, so an agent can extract the needed information quickly.

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 estimator with 15 parameters, the description covers what the tool does, the statistical assumptions required for validity, input pre-conditions, failure modes with concrete remediations, sibling alternatives, and a sample-size heuristic. Since an output schema exists, return-value documentation is already handled elsewhere; nothing needed for correct invocation is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. The description adds meaning beyond the schema by linking 'MSE-optimal bandwidth' to parameter h, 'local polynomial' to p, 'treatment take-up' to the fuzzy-design treatment parameter, and 'known cutoff' to c. This contextualizes key parameters without restating their schema definitions.

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 a specific method ('Regression Kink Design estimator') with a citation (Card et al., 2015), making the tool's function immediately clear. It also names sibling alternatives (sp.rdrobust, sp.rdrandinf, sp.rdbwselect), distinguishing this estimator from related regression-discontinuity tools in the large sibling list.

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 provides explicit pre-conditions (continuous running variable, known cutoff, enough observations near cutoff), enumerates alternatives, and gives failure-mode-triggered guidance (run rdplotdensity if sorting suspected; report bandwidth-sensitivity curve if estimates swing). It even states a conditional when-not: 'if manipulation is present the design is invalid near the cutoff', plus a typical minimum N of 500.

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