Skip to main content
Glama
Ian3738
by Ian3738

sem

Fit confirmatory factor analysis and structural equation models using lavaan syntax, with fit indices and modification indices.

Instructions

Confirmatory factor analysis or structural equation modelling with lavaan. Give the model in lavaan syntax: =~ defines a latent factor ('anxiety =~ q1 + q2 + q3') ~ a regression ('outcome ~ anxiety + age') ~~ a covariance := a derived quantity Reports chi-square, CFI, TLI, RMSEA with its interval, SRMR, standardised loadings and path estimates, and composite reliability / AVE per factor. Set modification_indices=true to see which fixed parameters would most improve fit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesDataset name in the session.
typeNocfa, sem, path or growth.sem
groupNoGrouping column for a multi-group model.
modelYeslavaan model syntax; separate statements with newlines.
digitsNoDecimal places.
std_lvNoStandardise latent variables instead of fixing the first loading to 1.
missingNolistwise, or 'fiml' to use full-information maximum likelihood.listwise
save_asNoName for the fitted model in the session.
bootstrapNoBootstrap samples for standard errors; 0 disables.
estimatorNoML, MLR (robust), WLSMV (for ordinal indicators), GLS or DWLS.ML
mi_thresholdNoOnly show modification indices at or above this value.
modification_indicesNoReport modification indices.

Schema Changelog

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

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral transparency burden. It does so well by listing the fit statistics reported, the standardized estimates, composite reliability, and what the `modification_indices=true` flag does. It does not mention convergence failure or side effects like saving a model, but the key behavioral expectations are 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?

The description is front-loaded with the purpose, then uses a compact syntax legend, lists the output, and ends with a conditional flag explanation. Every sentence contributes useful information and none of it is redundant with the schema.

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

Completeness5/5

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

For a 12-parameter tool with no output schema, the description covers the most complex and essential parts: model syntax, output statistics, and modification indices. The remaining parameters are fully described in the input schema, so an agent has enough information to call the tool correctly.

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 coverage is 100%, so the baseline is 3. The description earns extra credit by decoding the lavaan syntax operators (`=~`, `~`, `~~`, `:=`) with concrete examples for the `model` parameter, which is the most semantically rich parameter. It also clarifies the behavior of `modification_indices=true` beyond the schema description.

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 precise statement of what the tool does: confirmatory factor analysis or structural equation modelling with lavaan. It also explains the lavaan syntax operators, making the resource and method unambiguous. This clearly separates `sem` from sibling tools like `regression` or `factor_analysis`.

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 intended use is explicitly stated: CFA/SEM models written in lavaan syntax. It gives clear context for when to use the tool, though it does not name alternative tools or list exclusion criteria. The mention of 'confirmatory' versus the sibling `factor_analysis` implies the boundary, but not explicitly.

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