Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

rd2d

Read-only

Estimate causal effects at a two-dimensional cutoff boundary using local polynomial regression discontinuity, with data-driven bandwidth selection and diagnostics.

Instructions

2D boundary regression discontinuity estimation. 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
hNoManual bandwidth. If None, MSE-optimal bandwidth is selected.
pNoPolynomial order for point estimation (1 = local linear).
yYesOutcome variable name.
x1YesFirst running variable (score dimension 1).
x2YesSecond running variable (score dimension 2).
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', 'uniform', or 'epanechnikov'.triangular
n_evalNoNumber of evaluation points when ``eval_points`` is None. Use 1 for a single pooled effect.
approachNo``'distance'``: project onto signed distance to boundary, then apply univariate local polynomial RD. ``'location'``: fit bivariate local polynomial on each side of the boundary at evaluation points.distance
boundaryNoFunction ``f(x1) -> x2`` defining the boundary curve. If None, the boundary is the vertical line ``x1 = 0``.
bwselectNoBandwidth selection method (used when ``h`` is None).mserd
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.
treatmentYesBinary treatment indicator (1 = treated, 0 = control).
eval_pointsNoShape ``(k, 2)`` array of boundary evaluation points. If None, points are automatically selected along the boundary.
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?

Annotations declare readOnlyHint=true and openWorldHint=false, and the description does not contradict these. It adds valuable behavioral context: assumptions about continuity and no sorting, failure modes like density jumps and bandwidth sensitivity, and recommended diagnostic actions. This goes beyond the annotations by detailing the estimation's validity conditions.

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 (Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N) and front-loads the core purpose. While it is verbose, each section contributes meaningful information for an agent to assess applicability and potential pitfalls.

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?

Given the tool's complexity (2D RD, 19 parameters) and the presence of an output schema, the description is quite complete. It covers validity assumptions, preconditions, failure modes, alternatives, and sample size guidance. It does not describe return values because the output schema covers that, but it leaves little for an agent to infer about the method's scope.

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 marginal context, such as 'data-driven MSE-optimal bandwidth' related to bwselect, but does not systematically explain each parameter beyond the schema. It does not need to, given the schema's completeness.

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 '2D boundary regression discontinuity estimation', a specific verb+resource+dimension that precisely identifies the tool's function. It also differentiates from standard RD by noting '2D boundary' and lists alternatives like sp.rdrobust, making the distinction explicit.

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 pre-conditions ('continuous running/forcing variable with a known cutoff') and assumptions, as well as failure modes with corrective actions (e.g., 'if manipulation is present... Run a McCrary / density test'). It names alternatives but does not explicitly state when to choose them over rd2d, so it stops short of a fully decisive routing.

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