Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

cbps

Read-only

Estimate causal treatment effects by balancing covariates between treated and control groups, reducing confounding for reliable business decisions.

Instructions

Covariate-Balancing Propensity Score estimator (Imai-Ratkovic 2014). Validation: certified parity evidence. Assumptions: Unconfoundedness: treatment is as-good-as-random given the measured covariates; Overlap / common support: every unit has a non-degenerate probability of each treatment; The covariate set blocks all back-door paths. Pre-conditions: Pre-treatment covariates measured for treated and control units; A binary (or low-cardinality) treatment indicator; Sufficient covariate overlap between treatment arms. Failure modes: Poor overlap -- extreme propensity scores or few acceptable matches -> Trim or restrict to the common-support region and report the discarded units; Covariate imbalance remains after matching/weighting -> Re-specify the balancing model (CBPS, entropy balancing) and re-check standardized mean differences. Alternatives: sp.propensity_score, sp.cbps, sp.ebalance, sp.dml. Typical minimum N: 200.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome column.
seedNoRandom seed for reproducible stochastic steps.
trimNoOptional pscore clip for stability.
alphaNoSignificance level for confidence intervals and tests.
treatYesBinary 0/1 treatment 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
variantNo'exact': just-identified CBPS (only balance moments). 'over': over-identified CBPS (MLE + balance, solved via two-step GMM).over
estimandNoestimand parameter (Literal['ATE', 'ATT']).ATE
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.
covariatesYesCovariates entering the logit score.
n_bootstrapNoNumber of bootstrap replications.
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
add_interceptNoPrepend a constant to the covariate matrix.
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.9/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false, so the description adds substantial behavioral context: unconfoundedness/overlap assumptions, pre-conditions, failure modes, and suggested remedies. It also notes a typical minimum sample size of 200 and mentions trimming/re-specification. It does not contradict the read-only hint—estimation is a read operation—and adds value beyond the annotations.

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 organized with labeled sections (Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N), making it scannable. The opening sentence identifies the estimator immediately. Some content, such as 'Validation: certified parity evidence,' is vague and does not clearly earn its place, preventing a 5.

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 causal estimator with 16 parameters and no nested objects, the description covers the essential usage context: identification assumptions, data pre-conditions, failure modes with remedies, alternatives, and a sample size guideline. Since an output schema exists, return-value details are not required. Missing is an explicit statement of what the tool returns (e.g., ATE estimate, balance diagnostics), but the parameter names and schema largely cover that.

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 schema already documents every parameter, including enum meanings (detail, variant, estimand). The tool description adds general context (overlap, trimming, alternatives) but does not add parameter-level semantics beyond what the schema provides. Baseline 3 is appropriate because the schema carries the burden.

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 names the exact estimator ('Covariate-Balancing Propensity Score estimator') and cites the method (Imai-Ratkovic 2014), so an agent can identify what this tool implements. However, it never states the primary verb/outcome explicitly—it does not say it estimates an average treatment effect, propensity scores, or balance weights, leaving that to inference from the parameter names (treat, y, estimand). This is clear but not maximally explicit.

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?

The description provides concrete pre-conditions (pre-treatment covariates, binary treatment, sufficient overlap) and failure-mode guidance (trim to common support, re-specify balancing model), which tells an agent when the tool is appropriate and what to do when assumptions fail. It lists alternatives (propensity_score, ebalance, dml) but does not give explicit 'use this instead when X' routing, so it stops short of a 5.

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