Skip to main content
Glama
Ian3738
by Ian3738

moderation

Test whether an effect depends on a moderator by fitting a mean-centered interaction model, reporting R² change from the interaction, and giving simple slopes at -1 SD/mean/+1 SD.

Instructions

Moderation analysis: does the effect of X on Y depend on W? Fits the interaction model with mean-centred predictors, reports the R-squared change contributed by the interaction, and gives simple slopes at -1 SD / mean / +1 SD of a continuous moderator (or within each level of a categorical one), plus an interaction plot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesPredictor column.
yYesOutcome column.
dataYesDataset name in the session.
plotsNoInclude an interaction plot.
centerNoMean-centre the continuous predictors before fitting.
digitsNoDecimal places.
save_asNoName for the fitted model in the session.
moderatorYesModerator column.
covariatesNoColumns to control for.
simple_slopesNoReport simple slopes.

Schema Changelog

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

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does disclose the modeling approach (mean-centred predictors), the reported statistics (R-squared change, simple slopes), and the plot output. But it omits side effects such as saving a model to the session (save_as) and does not mention assumptions, missing-data handling, or whether the original data is modified. This leaves some behavioral aspects implicit.

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 two sentences with no filler. The first sentence crisply states the purpose as a question, and the second packs the details into a compact list. The second sentence is dense but not overly long; it could be slightly better structured as a list, but it remains concise and front-loaded.

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?

Given the tool's statistical complexity and the absence of an output schema, the description adequately explains the core outputs: R-squared change, simple slopes, and an interaction plot. It does not fully describe the output format or potential error conditions, but for invoking the tool with the required parameters, the provided context is sufficient.

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?

The schema provides 100% parameter coverage, so the baseline is 3. The description adds meaningful semantics beyond the schema: it explains that predictors are mean-centred (relating to 'center'), simple slopes are reported at -1 SD/mean/+1 SD or by group (relating to 'simple_slopes'), and an interaction plot is produced (relating to 'plots'). This clarifies how parameters shape the output.

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 the precise research question 'does the effect of X on Y depend on W?' and then enumerates the concrete operations: fitting an interaction model, reporting R-squared change, computing simple slopes, and producing an interaction plot. This clearly identifies the tool as moderation analysis and distinguishes it from sibling tools like regression and mediation.

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 description frames when to use the tool: when you want to know whether an effect depends on a moderator. It provides clear context for selecting this tool over a plain regression or mediation. However, it does not explicitly state when not to use it or name alternative tools for comparison.

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