Skip to main content
Glama

mixed_lm

Fit linear mixed-effects models with specified random effects, returning fixed-effect estimates, standard errors, p-values, random-intercept variance, AIC/BIC, and convergence status.

Instructions

Fit a linear mixed-effects model with a random-effects structure.

``data`` is either a ``{column: list}`` mapping or an ``"@<path>.csv"``
reference (relative paths resolve against ``output_dir()``). ``groups``
names the grouping column. ``re_formula`` optionally describes the random
effects (e.g. ``"~1"`` for random intercepts only). ``reml`` selects REML
(default) or maximum likelihood.

Returns fixed-effect estimates with standard errors, z values and p values,
the random-intercept variance, AIC/BIC and the convergence flag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
remlNo
groupsYes
formulaYes
re_formulaNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses data-source formats (mapping vs '@<path>.csv'), that relative paths resolve against output_dir(), that reml defaults to REML, and it lists the returned quantities (fixed effects, SEs, z/p, random-intercept variance, AIC/BIC, convergence flag). It does not cover error/failure behavior or missing-data handling, keeping it short of a 5.

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?

Well-organized: purpose first, then per-parameter clarifications, then return values. Sentences are dense with information and each earns its place, though the parameter block reads as a run-on list rather than crisp bullets.

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 5-parameter statistical tool with no annotations and no output schema, the description supplies the parameter semantics and the return contract an agent needs to call it. The one meaningful gap is the absence of any guidance on model-choice context relative to sibling regression tools.

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 0%, so the description must compensate, and it documents four of five parameters meaningfully: data (mapping or CSV path), groups (grouping column), re_formula (random effects with an example '~1'), and reml (REML vs ML). Only formula is left undescribed, though it is a conventional input.

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?

States a specific verb and resource: 'Fit a linear mixed-effects model with a random-effects structure.' This is clearly distinguishable from statistical siblings like linear_regression, glm, and nonlinear_mixed_lm. It stops short of explicitly naming the sibling it is not (nonlinear_mixed_lm), so it is clear but not maximally differentiating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains how to supply parameters but never says when this tool should be chosen over alternatives such as linear_regression, glm, or nonlinear_mixed_lm. There are no exclusions or prerequisites (e.g. required grouping structure), leaving the agent to infer the use case.

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