Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

spillover

Read-only

Estimate direct and spillover treatment effects under partial interference within clusters, using Hudgens-Halloran decomposition and exposure functions for valid causal inference.

Instructions

Direct + spillover treatment effect estimation under partial interference (within-cluster). Uses the Hudgens-Halloran decomposition with chosen exposure function. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Partial interference: spillover only within cluster, not across; Correct exposure function (fraction / any / count -- sensitivity tested); Overlap: every (treatment x exposure) cell has positive probability. Pre-conditions: data has a cluster column defining the interference boundary; treatment varies within clusters; >= 30 clusters for cluster-robust inference. Failure modes: No within-cluster variation in treatment -> Assignments are cluster-level -- use sp.cluster_matched_pair or cluster-level ATE; Exposure function misspecified -> Compare estimates under exposure_fn in {fraction, any, count}. Alternatives: sp.network_exposure, sp.cluster_matched_pair, sp.peer_effects. Typical minimum N: 500.

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
clusterYesCluster column (interference boundary)
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.
covariatesNoCovariate matrix, DataFrame, or column names.
exposure_fnNoExposure functionfraction
n_bootstrapNoNumber of bootstrap replications.
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.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint:true and openWorldHint:false. The description adds substantial behavioral context beyond these: assumptions (partial interference, correct exposure function, overlap), failure modes (misspecified exposure_fn), validation tier, and typical minimum N. It does not contradict annotations; the read-only hint aligns with estimation-only behavior. The extra context fully discloses edge cases and limitations.

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 organized into labeled sections (assumptions, pre-conditions, failure modes, alternatives) and front-loads the core purpose. Every sentence carries information, but it is somewhat dense and could be seen as longer than necessary. Still, the structure improves scannability and no information is redundant. It is concise relative to the breadth of content.

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 complex estimator with 13 parameters and 4 required, the description covers purpose, assumptions, pre-conditions, failure modes, alternatives, and typical sample size. It leverages the output schema to avoid explaining return values. No critical usage aspect is missing; an agent could correctly invoke it for partial interference scenarios and know when to use alternatives.

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 limited parameter-specific meaning: it references exposure_fn (fraction/any/count) in assumptions and failure modes, and clarifies the cluster parameter as defining the interference boundary. However, it does not elaborate on other parameters (y, treat, data_path, etc.) beyond what the schema already states. It adds marginal value, not enough to push beyond baseline.

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?

States a specific verb and resource: 'Direct + spillover treatment effect estimation under partial interference (within-cluster). Uses the Hudgens-Halloran decomposition with chosen exposure function.' This clearly distinguishes it from other causal tools by naming the method and interference assumption. It also explicitly lists alternatives (sp.network_exposure, sp.cluster_matched_pair, sp.peer_effects), making differentiation unambiguous.

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?

Provides explicit when-to-use conditions: pre-conditions (cluster column, within-cluster variation, >=30 clusters) and failure modes that route to alternatives (e.g., 'No within-cluster variation in treatment -> use sp.cluster_matched_pair or cluster-level ATE'). Also names alternatives directly, leaving nothing to inference.

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