Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

ffl_decompose

Read-only

Decompose group differences in continuous outcome distributions into composition and structure effects via RIF regression, isolating covariate contributions to quantile gaps.

Instructions

Firpo-Fortin-Lemieux two-step detailed distributional decomposition. Validation: certified parity evidence. Assumptions: Firpo-Fortin-Lemieux RIF regression: small perturbations to the covariate distribution induce small changes in the distributional statistic; Linear approximation of the recentered influence function is locally valid. Pre-conditions: Outcome is continuous (e.g. log earnings) with adequate distributional support; Covariates explain a non-trivial share of outcome variation across groups. Failure modes: RIF instability at extreme quantiles -> Avoid quantiles below ~0.05 or above ~0.95; widen the kernel bandwidth. Alternatives: sp.dfl_decompose, sp.oaxaca, sp.rif_decomposition. Typical minimum N: 500.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesPrimary running variable, regressor, or feature input for this estimator.
yYesOutcome variable column name or outcome array.
tauNoQuantile level or target treatment-effect index.
seedNoRandom seed for reproducible stochastic steps.
statNo'log_var', 'theil_t', 'theil_l', 'atkinson'}quantile
trimNotrim parameter (float).
alphaNoSignificance level for confidence intervals and tests.
groupYesGroup or cohort identifier.
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
n_bootNoNumber of bootstrap replications.
weightsNoObservation weights.
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://.
inferenceNoinference parameter (str).analytical
referenceNo0: B reweighted to look like A's X (composition = effect of A's X on B's outcomes relative to observed B)
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.
quantile_conventionNoQuantile RIF convention (``stat='quantile'`` / ``'iqr'``). ``'rifreg'`` reproduces ``ddecompose`` / ``rifreg``.statspai

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark this as read-only and closed-world, so the description's job is to add non-obvious behavior. It does: RIF regression assumptions, linear approximation validity, quantile instability at extremes, and certified parity evidence. This goes well beyond the structured annotation fields.

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?

Dense but highly structured with labeled sections: Validation, Assumptions, Pre-conditions, Failure modes, Alternatives, and Typical minimum N. Every sentence carries substantive guidance and the most important identity information is front-loaded.

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 tool with 19 parameters, 100% schema coverage, and an output schema, the description fills the statistical and decision-making gaps: assumptions, failure modes, preconditions, alternatives, and sample-size guidance. Nothing essential for selecting and invoking the tool correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description need not restate parameters. It adds useful semantics for key inputs: tau should avoid quantiles below 0.05/above 0.95, y should be continuous, and x should meaningfully explain outcome variation. It doesn't discuss parameters like stat, inference, or detail, but those already have descriptive schema entries.

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 opens with 'Firpo-Fortin-Lemieux two-step detailed distributional decomposition', naming the estimator, method family, and scope clearly. It further distinguishes itself by listing specific alternatives (sp.dfl_decompose, sp.oaxaca, sp.rif_decomposition), so an agent can separate it from sibling decomposition tools.

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 alternative tools to choose instead. It also gives pre-conditions (continuous outcome, non-trivial covariate share), failure-mode guidance (avoid extreme quantiles, widen bandwidth), and a typical minimum N of 500. This is strong when-to-use and when-not-to-use guidance.

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