Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

dose_response

Read-only

Estimate causal dose-response curves for continuous treatments under unconfoundedness via propensity-score weighting or double ML, controlling for confounders.

Instructions

Dose-response function for a continuous treatment under unconfoundedness. Uses generalised propensity-score weighting or double ML for the conditional expectation E[Y(d)]. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact). Assumptions: Weak unconfoundedness: Y(d) perp D | X for each d; Generalised overlap: positive conditional density of D at each evaluated dose; Smoothness of dose-response function (for local-polynomial / kernel smoothing). Pre-conditions: treat is continuous (numeric, not binary); covariates comprise the confounding set; n >= 1000 for stable dose-response curves. Failure modes: Sparse data at extreme doses -> Narrow dose_range; CIs at tails will be wide and uninformative; Heavy-tailed generalised propensity weights -> Use stabilised weights or restrict to common-support dose window. Alternatives: sp.dml, sp.metalearner, sp.causal_forest. Typical minimum N: 1000.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesOutcome variable column name or outcome array.
treatYesContinuous treatment / dose
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
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.
covariatesYesCovariate matrix, DataFrame, or column names.
dose_rangeNo(lo, hi) over which to evaluate dose-response
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.
n_dose_pointsNoNumber of dose points.

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?

With readOnlyHint=true already present, the description still adds substantial behavior: the estimation method (generalised propensity-score weighting or double ML), explicit assumptions, pre-conditions, and concrete failure modes such as sparse extreme-dose data and heavy-tailed propensity weights. 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?

The description is organized with clear labels (Validation, Assumptions, Pre-conditions, Failure modes, Alternatives) and is front-loaded with purpose. It is dense and mostly useful, though the 'Typical minimum N' repeats the earlier n >= 1000 precondition and the Validation line is somewhat opaque.

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 12-parameter tool, the description covers the key statistical assumptions, data requirements, failure modes, and alternatives, while the input schema and output schema handle parameter details and return structure. Nothing critical is missing for an agent deciding whether and how to call it.

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%, but the description adds meaning beyond the schema: treat must be continuous, covariates must be the confounding set, and dose_range is connected to sparse-tail failure modes. Not every parameter is elaborated, but the most important substantive ones gain extra context.

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: estimates a dose-response function for a continuous treatment under unconfoundedness. It also names concrete alternatives (sp.dml, sp.metalearner, sp.causal_forest), distinguishing it from nearby siblings in a very large tool set.

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?

Provides explicit context for use: continuous treatment, unconfoundedness, confounding-set covariates, and n >= 1000. It lists alternatives but does not give explicit 'use X when Y' routing conditions, so it falls just short of full 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