Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

rif_decomposition

Read-only

Decompose group differences in distributional statistics like quantiles into explained endowments and unexplained coefficients, providing causal evidence for decision-making.

Instructions

RIF Oaxaca-Blinder decomposition (FFL 2009, Section 5). Validation: certified parity evidence. Assumptions: The recentered influence function for the chosen distributional statistic (quantile, variance, Gini, etc.) is a valid first-order approximation, so its expectation recovers the statistic (Firpo-Fortin-Lemieux 2009); The aggregate Oaxaca-Blinder split into explained (endowments) vs unexplained (coefficients) requires no omitted covariates correlated with group and a correctly specified RIF regression; Detailed (per-covariate) decompositions assume path/normalization invariance and, for the unexplained part, an ignorable reference-group choice. Pre-conditions: group is a binary 0/1 indicator and reference in {0,1}; Covariates and the target distributional statistic are well-defined in both groups; Both groups have enough observations to fit the RIF regression at the chosen statistic. Failure modes: RIF for a tail quantile is noisy where the density is near zero, giving unstable shares -> Avoid extreme quantiles or smooth/bootstrap the density estimate underlying the RIF; Limited covariate overlap between groups makes the explained component unreliable (specification error) ->...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tauNoQuantile level or target treatment-effect index.
groupYesBinary (0/1) group indicator 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
formulaYesModel formula using patsy/R-style syntax.
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://.
referenceNoWhich group's coefficients to use as the reference (0 or 1).
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.
statisticNostatistic parameter (StatisticKind).quantile
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.
quantile_conventionNoQuantile RIF convention for ``statistic="quantile"``. Use ``"dineq"`` for R ``dineq::rif`` parity.statspai

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and openWorldHint=false, covering the safety profile. The description adds meaningful behavioral context beyond the annotations: it discloses assumptions about RIF validity, pre-conditions for reliable estimation, and failure modes such as noisy tail-quantile RIF and unreliable explained components under limited overlap. No contradiction with annotations is present.

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 description is organized into labeled sections (Validation, Assumptions, Pre-conditions, Failure modes), which aids scanning. However, the 'Validation: certified parity evidence' line is vague and contributes little, the failure-mode section is truncated with '->...', and the overall length is heavy relative to the schema's own detailed parameter coverage.

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?

For a high-complexity statistical tool, the description covers assumptions, pre-conditions, and failure modes, and an output schema exists to explain return values. It lacks a plain-language summary of what the decomposition returns and does not give a concrete example, but these are largely covered by the rich schema, making the description reasonably complete.

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 all 12 parameters are documented. The description adds marginal context (e.g., group/reference binary constraints, the chosen distributional statistic), but most of this is already present in the schema descriptions, so the value added is limited and stays at the baseline for full schema coverage.

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 states the tool performs a RIF Oaxaca-Blinder decomposition (FFL 2009, Section 5), naming both the method and a reference. It is not a tautology and identifies the resource, but it does not explicitly differentiate itself from sibling decomposition tools such as oaxaca, dfl_decompose, or melly_decompose.

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 assumptions, pre-conditions, and failure modes that clarify when the decomposition is valid (e.g., binary group indicator, enough observations, no omitted covariates) and warns against extreme quantiles and limited covariate overlap. However, it never mentions alternative tools or explicitly states when to prefer rif_decomposition over siblings like oaxaca or fairlie, leaving tool-selection guidance implied rather than explicit.

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