Skip to main content
Glama
Ian3738
by Ian3738

mediation

Assess whether a predictor's effect on an outcome operates through mediator variables, estimating direct, indirect, and total effects with bootstrap confidence intervals and optional covariates.

Instructions

Mediation analysis: does X affect Y through M? Builds and fits the path model, and reports the a, b, direct (c') and indirect paths with bootstrap confidence intervals - the standard Preacher-Hayes evidence for mediation. Supports several mediators at once (each gets its own indirect effect plus a total) and covariates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mYesMediator column(s).
xYesPredictor column.
yYesOutcome column.
dataYesDataset name in the session.
digitsNoDecimal places.
save_asNoName for the fitted model in the session.
bootstrapNoBootstrap samples for the indirect effect's interval; 5000 is conventional.
conf_levelNoConfidence level.
covariatesNoColumns to control for in both equations.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the disclosure burden and does substantial work: it says the tool builds the path model, fits it, and reports all relevant paths with bootstrap confidence intervals. It does not mention optional session side effects such as save_as or the exact output structure, but core behavior is clearly disclosed.

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

Conciseness5/5

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

Two well-structured sentences lead with the mediation question, then specify model fitting, reported paths, bootstrap intervals, and supported extensions. No filler or repetition.

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 moderately complex statistical tool with no output schema, the description covers the essential inputs and expected results, including multiple mediators and covariates. It leaves out minor details like interval method or default bootstraps, but those defaults are already in the schema.

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 coverage is 100%, so the schema already documents all 9 parameters; the description adds useful context by naming X, M, Y, multiple mediators, and covariates, but it does not explain conf_level, digits, or save_as in prose. Baseline 3 is appropriate.

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 analytical verb (fits a path model and reports mediation paths) and a concrete resource: the indirect effect of X on Y through M. The description distinguishes this from generic regression or SEM by naming the precise a, b, c', and indirect paths with bootstrap confidence intervals.

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?

The opening question 'does X affect Y through M?' makes the intended use clear, and the mention of multiple mediators and covariates signals when broader mediation models are appropriate. It does not explicitly warn against alternatives like sem or regression, but the context is strong enough to guide tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ian3738/r-stats-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server