Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

double_negative_control

Read-only

Estimates the average treatment effect in the presence of unmeasured confounding by using a negative-control exposure and negative-control outcome as proxies for the hidden confounder.

Instructions

Double negative control estimator (Miao et al. 2018; Shi et al. 2020). Assumptions: Two valid proxies of the hidden confounder U: a treatment-confounding proxy and an outcome-confounding proxy; Negative-control exposure has no causal effect on Y given (U, X) -- exclusion restriction on the NCE arm; Negative-control outcome is not caused by the treatment D given (U, X). Pre-conditions: data has columns for outcome, treatment, a negative-control exposure (nce) and a negative-control outcome (nco); nce and nco share the unmeasured confounder but satisfy the respective exclusion restrictions. Failure modes: Weak proxy: NCE barely correlated with NCO (weak-instrument analogue) -- unstable ATE -> Use stronger proxies or the doubly-robust regression-based estimator instead of just-identified 2SLS; A proxy violates its exclusion restriction (direct effect on Y or caused by D) -- biased ATE -> Validate the negative controls separately or fall back to a sensitivity analysis. Alternatives: sp.proximal, sp.proximal_regression, sp.frontdoor. Typical minimum N: 200.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
nceYesnce parameter (str).
ncoYesnco parameter (str).
alphaNoSignificance level for confidence intervals and tests.
treatYesTreatment indicator or first-treatment-period column.
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
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.
covariatesNoCovariate matrix, DataFrame, or column names.
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.3/5.0
Behavior5/5

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

With readOnlyHint=true already covering the read-only safety profile, the description adds substantial behavioral context: the statistical assumptions under which the estimate is valid, two distinct failure modes (weak proxy → unstable ATE; exclusion violation → biased ATE), fallback recommendations, and a typical minimum N of 200. Nothing contradicts the annotations (an estimator is read-only), and the added failure-mode and fallback details go well beyond the structured fields.

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

Conciseness3/5

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

The content is genuinely information-dense (assumptions, pre-conditions, failure modes, alternatives, minimum N), but it is delivered as one long unbroken paragraph, which hurts scannability. It front-loads the estimator identity well, yet the enumeration of assumptions and failure modes reads as a wall of text rather than structured guidance. The detail justifies length, but structure could be improved.

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 causal-inference estimator with 12 parameters and an output schema, the description is remarkably complete: assumptions for validity, preconditions on the data, two failure modes with mitigations, alternatives, and a minimum sample size. The output schema covers return values, so nothing an agent needs to decide whether to call this tool 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 coverage is 100%, so every parameter is already documented in the input-schema. The description adds useful conceptual framing — it connects nce and nco to 'negative-control exposure' and 'negative-control outcome' and states the proxy-assumption context — but it does not add syntax, defaults, or format details beyond the schema. Baseline 3 is appropriate when the schema carries the parameter documentation.

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 estimator ('Double negative control estimator') anchored to two citations (Miao et al. 2018; Shi et al. 2020), and names the alternatives (sp.proximal, sp.proximal_regression, sp.frontdoor) it is not. An agent can distinguish this from the proxy/frontdoor siblings without inspecting their schemas. The purpose is unambiguous.

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?

Pre-conditions are explicit (data must have outcome, treatment, nce, nco columns), and failure modes provide clear when-not guidance ('Weak proxy: NCE barely correlated with NCO... use stronger proxies or the doubly-robust regression-based estimator'). However, the named alternatives (proximal, proximal_regression, frontdoor) are listed without explicit selection criteria for choosing one over this tool. The guidance is strong on when-not but weaker on why-this-over-that.

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