Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

dml_sensitivity

Read-only

Assess robustness of a DML causal estimate to unobserved confounding by computing bias thresholds and partial-R2 benchmarks, yielding bias-adjusted estimate ranges.

Instructions

Compute DML-OVB sensitivity for a fitted DML CausalResult. Validation: certified parity evidence. Assumptions: Unconfoundedness (IRM/PLR) or instrument validity (IIVM/PLIV) given the covariates; Overlap / positivity; Neyman-orthogonal score plus cross-fitting; nuisance estimators converge fast enough (o(n^-1/4)). Pre-conditions: Covariates, treatment, and outcome with enough data for cross-fitted machine-learning nuisances; For instrumented variants (PLIV / IIVM): an instrument as well. Failure modes: Propensity scores near 0/1 -- overlap failure inflates variance and bias -> Trim extreme scores, restrict the estimand to the overlap region, or report sensitivity (dml_sensitivity). Alternatives: sp.tmle, sp.auto_cate, sp.causal_forest. Typical minimum N: 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoBias threshold as a fraction of |theta|. ``q=1`` => confounder needed to shrink estimate to zero; ``q=0.5`` => half the estimate.
k_dNoMultipliers for the benchmark strengths.
k_yNoMultipliers for the benchmark strengths.
cf_dNoHypothesized partial-R2 of an unobserved confounder with the residualised outcome and treatment. If both are given, the report includes a bias bound and adjusted-estimate range.
cf_yNoHypothesized partial-R2 of an unobserved confounder with the residualised outcome and treatment. If both are given, the report includes a bias bound and adjusted-estimate range.
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
resultYesresult parameter.
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_pathNoAbsolute 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.
benchmark_covariatesNoSubset of the original covariates to benchmark against. For each ``X_k``, the benchmark sets ``cf_y_bench, cf_d_bench`` to the partial R2 that ``X_k`` itself contributes (multiplied by ``k_y, k_d`` to express "what if a confounder were kx as strong as ``X_k``?").

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?

Annotations declare readOnlyHint=true, so the safety profile is covered. The description adds substantial behavioral context beyond that: assumptions (unconfoundedness, overlap, Neyman-orthogonality, nuisance convergence), failure modes (overlap failure inflating variance/bias), and explicit pre-conditions. This goes far beyond the minimal read-only hint, providing actionable behavior expectations.

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 organized with labeled sections (Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N), which makes it scannable and front-loaded with the core purpose. It is relatively long, but each section adds essential information and there is minimal redundancy. A minor deduction for length and the somewhat cryptic 'Validation: certified parity evidence' sentence, which adds little clarity.

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 of a DML sensitivity tool, the description is remarkably complete. It covers assumptions, pre-conditions, failure modes, alternatives, and a sample size guideline. Since an output schema exists, return values are covered. There is nothing an agent needs to know to invoke this tool correctly that is missing.

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 every parameter is documented in the input schema. The main description does not add any parameter-level semantics beyond what the schema already provides; it mentions q and cf in the context of the sensitivity logic, but that information is already present in the schema. The description thus adds no extra value for parameters, so the baseline 3 applies.

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 a specific verb ('Compute') and resource ('DML-OVB sensitivity') targeted at a 'fitted DML CausalResult', which is precise and distinguishes it from the many sibling sensitivity tools (e.g., sensitivity, sensitivity_dashboard, sensemakr). It clearly conveys the tool's core function without ambiguity.

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 (covariates, treatment, outcome, instrument for IV variants), failure modes (overlap failure near 0/1 propensity) with remedies, and names alternatives (sp.tmle, sp.auto_cate, sp.causal_forest). It also gives a typical minimum N, giving the agent clear signals on when and when not to use this tool.

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