Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

bcf_longitudinal

Read-only

Estimate time-varying treatment effects in longitudinal data using a hierarchical Bayesian Causal Forest that accounts for unit-level random intercepts and controls for confounding.

Instructions

Hierarchical Bayesian Causal Forest for longitudinal data (BCFLong) -- allows mu_t(X), tau_t(X) to evolve across time with unit-level random intercepts. Assumptions: Unconfoundedness and overlap; The BART/forest priors are appropriate for the outcome scale. Pre-conditions: Covariates, treatment, and outcome; a propensity model is fit internally to limit regularization-induced confounding. Failure modes: MCMC diagnostics fail to converge, or estimates are sensitive to the prior -> Increase draws/tuning, re-scale the outcome, and report posterior diagnostics. Alternatives: sp.dml, sp.auto_cate, sp.causal_forest. Typical minimum N: 250.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeYesTime period column.
unitYesUnit identifier 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
outcomeYesOutcome variable column name or outcome array.
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.
treatmentYesTreatment indicator, treatment variable, or treatment array.
covariatesYesCovariate matrix, DataFrame, or column names.
n_trees_muNoNumber of trees mu.
n_bootstrapNoNumber of bootstrap replications.
n_trees_tauNoNumber of trees tau.
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.1/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses that 'a propensity model is fit internally to limit regularization-induced confounding' — an internal behavior that affects how estimates should be interpreted — and lists concrete failure modes with remediation: 'MCMC diagnostics fail to converge... -> Increase draws/tuning, re-scale the outcome, and report posterior diagnostics.' This is substantial behavioral context that annotations alone do not provide. No contradiction with 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?

Roughly 90 words organized into labeled sections (Assumptions, Pre-conditions, Failure modes, Alternatives, Typical minimum N), with the model identity front-loaded. Every section earns its place and the structure is highly parseable for an agent. The only arguable waste is the sp.*-prefixed alternative names, which look inconsistent with the sibling namespace.

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 complex Bayesian tool with an output schema and fully-described parameters, the description covers the modeling context — assumptions, pre-conditions, internal behavior, failure modes with remediation, alternatives, and minimum sample size. The 'Typical minimum N: 250' guidance is slightly underspecified (units vs. observations) and alternative routing is thin, but nothing critical for 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.

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 of 3 applies; every parameter already carries a description in the schema. The tool description adds no parameter-level detail — the hint to 'Increase draws/tuning' refers conceptually to the n_trees_*/n_bootstrap tuning parameters but never names or maps them to specific schema fields.

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 a specific definition — 'Hierarchical Bayesian Causal Forest for longitudinal data (BCFLong)' — and states exactly what the model does: 'allows mu_t(X), tau_t(X) to evolve across time with unit-level random intercepts.' The 'longitudinal data' qualifier differentiates it from sibling BCF variants (bcf, bcf_ordinal, bcf_factor_exposure) without requiring the agent to open their schemas.

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 gives applicability context — assumptions (unconfoundedness, overlap), pre-conditions (covariates, treatment, outcome), and a 'Typical minimum N: 250.' It names alternatives (sp.dml, sp.auto_cate, sp.causal_forest) but attaches no selection conditions; there is no explicit statement of when to prefer this tool over bcf or causal_forest, and no exclusions. Usage is 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