Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

conformal_fair_ite

Read-only

Generate counterfactual-fair conformal prediction intervals for individual treatment effects, adjusting for demographic parity so coverage stays valid even when protected attributes shift.

Instructions

Counterfactual-fair conformal prediction for ITE (2025). Wraps standard conformal ITE intervals with a demographic-parity adjustment, giving distribution-free coverage under protected-attribute shifts. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Exchangeability for conformal coverage, applied within protected-group strata; Counterfactual fairness: protected attribute excluded from the outcome regression (used only for stratified calibration); ITE ignorability / overlap so the treated and control nuisances are identified. Pre-conditions: DataFrame with y, treat, predictive covariates, and a categorical protected column; Calibration set per protected stratum for group-wise conformal coverage; Optional test_data to emit fair ITE intervals on. Failure modes: A protected stratum has too few calibration rows for valid group-wise quantiles -> Collapse sparse protected categories or pool strata before calibration; protected column accidentally leaks into covariates, breaking counterfactual fairness -> Remove the protected attribute from covariates; pass it only via the protected argument. Alternatives: sp.conformal,...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
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://.
protectedYesProtected-attribute column
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.
covariatesYesCovariate 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.4/5.0
Behavior5/5

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

Annotations already mark the tool as read-only, and the description adds substantial context beyond that: explicit statistical assumptions (exchangeability, counterfactual fairness, ITE ignorability/overlap), failure modes for sparse strata and protected-column leakage, and a validation evidence tier. There is no contradiction with readOnlyHint=true since the operation is pure computation.

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

Conciseness5/5

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

The description is long but well-organized into labeled sections (Validation, Assumptions, Pre-conditions, Failure modes, Alternatives), with the core purpose front-loaded in the first sentence. Every section contributes operational value and earns its place for a tool with 11 parameters.

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?

An output schema exists, so return values need no description. The definition covers prerequisites, assumptions, failure modes, and alternatives, making it nearly complete for an agent to decide when and how to call it. The only gaps are the truncated alternatives list and the phantom test_data reference, which keep it from a perfect score.

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 pre-conditions about calibration sets and protected-stratum grouping, but it also references an 'optional test_data' parameter that does not appear in the input schema, which could mislead an agent. No additional meaning is provided for alpha, detail, as_handle, or the other schema-documented parameters.

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 names a specific method ('Counterfactual-fair conformal prediction for ITE') and immediately differentiates it from siblings like conformal_ite and conformal_synth by the demographic-parity adjustment. The verb 'wraps' and the outcome ('distribution-free coverage under protected-attribute shifts') make the function's role unmistakable.

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 clearly state the required data shape (y, treat, predictive covariates, protected column) and the calibration-set prerequisite, and failure modes give actionable remediation steps. However, the description never explicitly tells the agent when to choose this tool over conformal_ite or other conformal variants; the alternatives line is truncated ('sp.conformal,...'), leaving the selection rule implied rather than stated.

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