Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

rd_extrapolate

Read-only

Extrapolate regression-discontinuity treatment effects away from the cutoff to estimate effects at other running-variable values, using local polynomial assumptions and supporting sharp or fuzzy designs.

Instructions

Angrist-Rokkanen (2015) extrapolation of RD effects away from the cutoff. 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; running variable x is continuous with support on both sides of c. 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; McCrary density test p < 0.05 -> Use donut-hole RD (donut=) or partial-identification bounds. Alternatives: sp.rdrobust, sp.rdrandinf, sp.rdbwselect, sp.rd_honest. Typical minimum N: 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cNoRD cutoff value.
xYesRunning variable name.
yYesOutcome variable name.
covsNoCovariate names for conditional independence. Required.
alphaNoSignificance level.
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
methodNoEstimation method: ``'ols'``, ``'ipw'``, or ``'doubly_robust'``.ols
n_evalNoNumber of evaluation points when ``eval_points`` is None.
h_localNoBandwidth for local RD estimate at the cutoff (for comparison). If None, the MSE-optimal bandwidth from ``rdrobust`` is used.
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 RD. If None, sharp design assumed (D = 1{X >= c}).
eval_pointsNoRunning variable values at which to extrapolate the CATE. If None, ``n_eval`` equally spaced points spanning the data range.
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.7/5.0
Behavior5/5

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

While annotations already declare readOnlyHint=true, the description adds substantial behavioral context: it lists the underlying assumptions (continuity of potential outcomes, no manipulation, monotonicity for fuzzy designs), pre-conditions, failure modes (e.g., density jump, bandwidth sensitivity), and diagnostic suggestions (McCrary test, bandwidth-sensitivity curves). This goes well beyond the annotation and helps the agent anticipate when results may be invalid and what to do about it.

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 structured with labeled sections (Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N) and is front-loaded with the purpose. Every sentence adds value: assumptions, pre-conditions, failure modes with remedies, and alternatives. There is no redundancy or filler. It is longer than some, but each element is essential for correct tool selection and usage.

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?

Given the complexity (16 parameters) and that an output schema exists, the description covers all essential aspects: purpose, assumptions, pre-conditions, failure modes, alternatives, and sample size guidance. It does not need to explain return values because the output schema does that. The description is complete enough for an agent to decide whether to use this tool and how to interpret common pitfalls.

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%, meaning every parameter already has a description in the schema. The tool description does not add per-parameter details beyond what the schema provides. It does add general methodological context (e.g., mentioning fuzzy designs and monotonicity), but it does not enhance understanding of individual parameters like 'covs' or 'treatment'. Baseline 3 is appropriate when schema fully covers parameters.

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 opens with a precise statement of purpose: 'Angrist-Rokkanen (2015) extrapolation of RD effects away from the cutoff.' This names the specific method, the resource (RD effects), and the action (extrapolation away from cutoff). It also distinguishes from siblings by explicitly listing alternative tools (rdrobust, rdrandinf, rdbwselect, rd_honest), making it clear this is for extrapolation, not standard RD estimation.

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 guidance on when to use this tool vs. alternatives: it states the purpose (extrapolation away from cutoff) and lists alternative tools for other purposes. It also includes pre-conditions (continuous running variable, known cutoff, enough observations) and failure modes (manipulation, bandwidth sensitivity, McCrary test failure) with suggested corrective actions (donut-hole RD, partial-identification bounds). This goes beyond mere context to actionable decision criteria.

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