Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

boundary_rd

Read-only

Estimate causal effects at a cutoff using regression discontinuity, handling sharp or fuzzy designs with local polynomial smoothing.

Instructions

User-friendly alias for :func:sp.rd2d (boundary discontinuity design). 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
hNoBandwidth used for local smoothing or kernel weighting.
pNop parameter (int).
yYesOutcome variable column name or outcome array.
x1Yesx1 parameter (str).
x2Yesx2 parameter (str).
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
kernelNoKernel function used for weighting or smoothing.triangular
n_evalNoNumber of eval.
approachNoapproach parameter (str).distance
boundaryNoboundary parameter (Optional[Callable]).
bwselectNobwselect parameter (str).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.
treatmentYesTreatment indicator, treatment variable, or treatment array.
eval_pointsNoeval_points parameter (Optional[numpy.ndarray]).
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.6/5.0
Behavior5/5

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

The annotations already declare readOnlyHint=true, so the description carries no contradiction. It adds substantial behavioral context: assumptions (continuity, no manipulation, monotonicity), pre-conditions (continuous running variable, sufficient N), failure modes (density jumps, bandwidth sensitivity) with recommended next steps (rdplotdensity, bandwidth-sensitivity curve), and a typical minimum N of 500. This goes well beyond the structured 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 structured with clear sections (Assumptions, Pre-conditions, Failure modes, Alternatives) and is front-loaded with the alias and purpose. Every section adds actionable information; there is no fluff. It is dense but appropriately so for a complex econometric tool.

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 tool with 19 parameters and an output schema, the description covers the essential context: assumptions, pre-conditions, failure modes with remedies, alternatives, and minimum sample size. It does not explain return values, but the output schema is present. This is complete for an agent to correctly invoke the tool and interpret results in context.

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 the schema already documents all parameters. The description adds value by advising on bandwidth selection ('use a data-driven MSE-optimal bandwidth') and referencing the bandwidth parameter (h) and bwselect, but it does not elaborate on most parameters. It provides meaningful guidance for key parameters without repeating schema text.

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 states it is a 'User-friendly alias for sp.rd2d (boundary discontinuity design)', which is a specific verb-resource combination. It clearly identifies the underlying method and names distinct alternatives (sp.rdrobust, sp.rdrandinf, sp.rdbwselect), so an agent can differentiate it from siblings.

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?

It provides explicit alternatives and lists pre-conditions and failure modes that guide when to use the tool. However, it does not give explicit conditions for choosing between this and the alternatives (e.g., when to prefer rdrobust over boundary_rd). The guidance is strong but not exhaustive on selection 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