Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

qte

Read-only

Estimate quantile treatment effects using propensity reweighting, conditional quantile regression, and IPW counterfactual methods for evidence-backed causal decisions.

Instructions

Quantile treatment effects. 'firpo_qte' / 'firpo_qtt' give Firpo (2007) efficient UNCONDITIONAL QTE / QTT by propensity reweighting (analytic influence-function SE); 'conditional_qr' gives the CONDITIONAL QTE (coefficient on D in a quantile regression, Koenker & Bassett 1978); 'distribution' gives the QTT via an IPW counterfactual distribution. Validation: certified parity evidence. Assumptions: For 'firpo_qte' / 'firpo_qtt' / 'distribution': unconfoundedness + overlap; For 'conditional_qr': unconfoundedness conditional on controls; note this is a CONDITIONAL estimand with no causal reading absent rank invariance; Correct parametric quantile model (sensitivity tested via multiple quantiles). Pre-conditions: binary treatment (all methods); continuous outcome; controls cover the confounding set. Failure modes: Large IPW weights (method='ipw') -> Extreme propensities -- trim (sp.trimming) or switch to doubly-robust DR-QTE; Quantile crossing -> Use rearrangement (Chernozhukov-Fernandez-Val-Galichon) or monotone constraints. Alternatives: sp.qdid, sp.rifreg, sp.cic, sp.metalearner. Typical minimum N: 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
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
methodNoEstimand / estimatorfirpo_qte
n_bootNoNumber of bootstrap replications.
controlsNoControl-variable column names.
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://.
quantilesNoquantiles parameter (list).
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.
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

A3.7/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation, the description discloses estimand assumptions, failure modes (large IPW weights, quantile crossing), and validation ('certified parity evidence'). The mention of 'method='ipw'' conflicts with the schema enum, but since it does not contradict the annotations, annotation_contradiction remains false.

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 dense but front-loaded with the core 'Quantile treatment effects' concept, then covers methods, assumptions, pre-conditions, failure modes, alternatives, and sample size. Almost every sentence carries information, though the 'Validation: certified parity evidence' clause is vague and the lack of structured formatting makes parsing harder.

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?

Since an output schema exists, the description need not explain return values. It thoroughly covers assumptions, prerequisites, failure modes, alternative tools, and a minimum-N guideline. The main gaps are the ambiguous validation statement and the inconsistent ipw reference, which slightly reduce completeness for a complex 13-parameter tool.

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 meaningful semantics for the method parameter by explaining each of the four estimands, but it also references 'method='ipw'' and 'sp.trimming' which are not in the schema enum, muddying parameter mapping. The quantiles parameter is left with only a tautological schema description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as estimating quantile treatment effects and distinguishes the four internal methods ('firpo_qte', 'firpo_qtt', 'conditional_qr', 'distribution') by their estimands and assumptions. It lists alternative tools (sp.qdid, sp.rifreg, sp.cic, sp.metalearner) but does not explicitly differentiate them, preventing a top score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides pre-conditions (binary treatment, continuous outcome, controls covering confounders) and per-method assumptions, which implicitly tell an agent when the tool is appropriate. However, the Alternatives line names sibling tools without criteria for choosing them instead of qte, so routing decisions are left to inference.

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