Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

evalue

Read-only

Calculate the E-value to quantify how much unmeasured confounding would be needed to explain away an observed association, helping assess the robustness of causal estimates.

Instructions

Compute the E-value for sensitivity to unmeasured confounding. Validation: certified parity evidence. Assumptions: VanderWeele-Ding (2017) E-value: quantifies the minimum confounder-exposure and confounder-outcome risk ratios that could explain away an observed association; The estimate is expressed (or convertible) to a risk-ratio scale; OR and HR map to RR via the rare-outcome approximation (rare=True) or the Ding-VanderWeele common-outcome conversion (rare=False, default); MD/SMD/OLS use exp(0.91*d); The E-value bounds joint confounding but assumes no other bias (selection, measurement, model misspecification). Pre-conditions: A point estimate on a supported scale (RR/OR/HR/MD/SMD/OLS); for an exact risk-difference E-value call sp.evalue_rd with the 2x2 cell counts; Either an SE or an explicit CI to obtain the CI E-value (OLS also needs the outcome sd). Failure modes: Ratio estimate <= 0 supplied for measure RR/OR/HR, or risk difference outside [-1, 1] -> Pass a positive ratio for RR/OR/HR or a difference within [-1, 1], matching the measure argument; Reported E-value near 1.0, i.e. trivially weak confounding overturns the result -> Treat the finding as fragile to unmeasured co...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ciNoConfidence interval on the ``measure`` scale. Takes precedence over ``se`` for ratio measures.
sdNoOutcome standard deviation, required for ``measure='OLS'`` to standardise the coefficient.
seNoStandard error of ``estimate``. Required for ``MD`` / ``OLS`` to obtain a confidence-interval E-value; for ratio measures it is used (with ``alpha``) to build a CI when ``ci`` is not given.
rareNoFor ``OR`` / ``HR`` only: whether the rare-outcome approximation applies. ``rare=True`` treats OR/HR ~ RR; ``rare=False`` (the default) uses the exact common-outcome conversion to the RR scale (``sqrt(OR)`` for OR; the Ding-VanderWeele formula for HR).
trueNoReference value the confounding would have to move the estimate to. Defaults to the null: 1 for ratio measures, 0 for difference measures. A non-null ``true`` gives a "non-null" E-value.
alphaNoSignificance level used to build a CI from ``se`` when ``ci`` is not supplied (ratio measures).
deltaNoContrast size for ``OLS`` (E-value for a ``delta``-unit change in the exposure).
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
measureNoOne of ``'RR'``, ``'OR'``, ``'HR'``, ``'MD'``, ``'SMD'``, ``'OLS'``, ``'DIFF'``, ``'RD'``.RR
estimateYesPoint estimate on the scale given by ``measure``: - ``'RR'`` risk ratio, ``'OR'`` odds ratio, ``'HR'`` hazard ratio (all must be > 0); - ``'MD'`` / ``'SMD'`` standardised mean difference; - ``'OLS'`` raw linear-regression coefficient (supply ``sd``); - ``'DIFF'`` / ``'RD'`` risk difference (approximate scalar path;
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_pathNoAbsolute 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.
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
rare_outcomeNoDeprecated alias for ``rare`` (kept for backwards compatibility).
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?

Beyond the readOnlyHint annotation, the description discloses key behavioral traits: assumption of rare-outcome approximation, OR/HR conversion logic, MD/SMD/OLS transformations, the assumption of no other bias, and failure modes. It also notes the implication of an E-value near 1.0 for fragility, giving interpretative context that annotations alone do not provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear labels (Validation, Assumptions, Pre-conditions, Failure modes) and front-loaded purpose, but it is quite lengthy and ends abruptly mid-sentence ('fragile to unmeasured co...'), which hurts conciseness. While most sentences carry information, the length and truncation prevent a higher score.

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?

The description covers assumptions, pre-conditions, failure modes, and an alternative tool, and an output schema is present. However, the final advice on interpreting E-value near 1.0 is cut off, leaving that part incomplete. It is thorough overall but not fully complete due to truncation.

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 description coverage is 100%, so the baseline is 3. The description adds meaningful semantic context (e.g., OR/HR map to RR via different conversions, OLS requires sd, rare=True treats OR/HR as RR). This enriches understanding of how parameters interact, beyond the individual schema descriptions.

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 verb and resource: 'Compute the E-value for sensitivity to unmeasured confounding.' It explains the VanderWeele-Ding E-value concept and differentiates from a sibling by directing risk-difference cases to sp.evalue_rd, making the tool's scope 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 pre-conditions (supported scales, SE or CI needed for CI E-value), an explicit alternative (sp.evalue_rd for exact risk differences), and failure modes with corrective guidance. This clearly tells an agent when this tool is appropriate versus alternatives and how to avoid common input errors.

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