Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

mr

Read-only

Run Mendelian randomization to estimate causal effects from genetic data, using IVW, Egger, median, mode, and diagnostics for pleiotropy and heterogeneity.

Instructions

Unified Mendelian Randomization dispatcher. method= selects the estimator: 'ivw' / 'egger' / 'median' / 'penalized_median' / 'mode' / 'all' (runs IVW+Egger+Median together) / 'mvmr' / 'mediation' / 'bma' (multi-exposure) / 'presso' / 'radial' / 'leave_one_out' / 'steiger' / 'heterogeneity' / 'pleiotropy_egger' / 'f_statistic' (diagnostics). Kwargs are passed through to the target function unchanged; see sp.mendelian_family guide. Validation: certified parity evidence. Assumptions: Relevance: SNPs predict exposure (F-statistic >= 10 per SNP or set-F); Independence: SNPs perp confounders of exposure-outcome; Exclusion restriction: SNPs affect outcome only through exposure (InSIDE for Egger; >= 50% valid for median; modal for mode-based). Pre-conditions: SNP-summary statistics for exposure and outcome aligned by SNP; beta_exposure / beta_outcome / se_exposure / se_outcome arrays of equal length; >= 10 genetic instruments for reliable IVW/median/mode; >= 20 for robust Egger intercept. Failure modes: Egger intercept p < 0.05 -- directional pleiotropy -> Use weighted-median or mode-based estimator; report Egger intercept + I2 as pleiotropy diagnostic; Q-statistic rejects homogeneity (Co...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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
methodNoMR estimator / diagnostic -- call sp.mr_available_methods() for the full list.ivw
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.
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
Behavior4/5

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

With `readOnlyHint: true` and `openWorldHint: false` already supplied, the description still adds behavioral value by explaining that `method=all` runs IVW+Egger+Median together, that kwargs pass through unchanged, and by listing assumptions per estimator. The main deduction is for the vague "Validation: certified parity evidence" line, which is not actionable.

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 long but information-dense and internally labeled with method, validation, assumptions, pre-conditions, and failure modes. However, it reads as one heavy paragraph and includes a few vague phrases like "certified parity evidence," so it is not as crisp as it could be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex dispatcher with seven parameters and an output schema, the description covers assumptions, preconditions, and failure-mode decisions very well. The provided text, however, cuts off mid-sentence at "Q-statistic rejects homogeneity (Co..." which means the failure-mode guidance is incomplete, and it relies on an external `sp.mendelian_family` guide for kwargs semantics.

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 enriches the `method` parameter substantially by enumerating the allowed estimator values and clarifying multi-exposure and diagnostics modes, which the schema only defers to `sp.mr_available_methods()`. Other parameters are already well explained in the schema and gain little additional description here.

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 opens with a specific verb and resource: "Unified Mendelian Randomization dispatcher," and the `method=` parameter enumerates the supported estimators and diagnostics. It clearly distinguishes the tool's role from generic regression tools, though it never explicitly names sibling tools such as `mediation` or `causal_discovery` for contrast.

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?

It provides explicit when-to-use guidance embedded in the assumptions and pre-conditions: ">= 10 genetic instruments for reliable IVW/median/mode; >= 20 for robust Egger intercept." It also drives decision-making with failure-mode instructions: "Egger intercept p < 0.05 -- directional pleiotropy -> Use weighted-median or mode-based estimator." This is far more than a generic pointer; it tells the agent which estimator to choose and when.

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