Skip to main content
Glama
Ian3738
by Ian3738

build_syntax

Generates Mplus input syntax for common model types (CFA, EFA, SEM, mediation, growth, mixture, invariance, two-level), returning editable text for review before running it in Mplus.

Instructions

Write Mplus input syntax for a standard model family (cfa, efa, path, sem, mediation, growth, lpa, lca, invariance, twolevel, custom). Returns the syntax as text - it does not run it. Read it, adjust it, then pass it to run_syntax. Anything the template does not cover goes in model_extra, analysis_extra or model_constraint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoMediation: the predictor.
yNoMediation: the outcome.
plotNoPLOT type, e.g. 'PLOT3'.
saveNoWhat to save, e.g. 'FSCORES' or 'CPROBABILITIES'.
namesYesEvery column in file order, e.g. 'id y1-y6 x1 x2'.
titleNoTitle line for the output.
outputNoOUTPUT options. Default depends on the model type.
startsNoMixture random starts, e.g. '500 100'.
weightNoSampling weight variable.
withinNoTwo-level: %WITHIN% lines.
betweenNoTwo-level: %BETWEEN% lines.
classesNoNumber of latent classes for lpa/lca.
clusterNoCluster variable for TWOLEVEL or COMPLEX.
factorsNoFactors for cfa/sem/invariance, e.g. {'F1': ['y1', 'y2', 'y3']}.
missingNoMISSING specification, e.g. 'ALL (-999)'.ALL (-999)
groupingNoGrouping spec, e.g. 'sex (1 = male 2 = female)'.
auxiliaryNoAUXILIARY spec, e.g. '(R3STEP) x1 x2'.
bootstrapNoBootstrap draws; adds CINTERVAL (BOOTSTRAP).
data_fileYesData file name as Mplus will see it, e.g. 'scale.dat'.
efa_rangeNoEFA factor range, e.g. [1, 4].
estimatorNoML, MLR, WLSMV, BAYES ...
mediatorsNoMediation: one or more mediators.
quadraticNoGrowth: add a quadratic slope factor.
covariatesNoMediation: controls for m and y.
idvariableNoID variable, carried into SAVEDATA.
indicatorsNoGrowth: repeated measures in time order. Mixture: class indicators.
model_typeYescfa, efa, path, sem, mediation, growth, lpa, lca, invariance, twolevel or custom.
processorsNoPROCESSORS for parallel estimation.
timescoresNoGrowth: time scores, one per indicator. Default 0,1,2 ...
categoricalNoOrdered categorical outcomes, e.g. 'u1-u6'.
covariancesNoWITH statements, e.g. ['y1 WITH y2;'].
model_linesNoExtra MODEL lines, verbatim.
regressionsNoMODEL lines such as ['y ON x1 x2;', 'f1 ON x1;'].
usevariablesNoVariables the model uses. Default: all of NAMES.
savedata_fileNoSAVEDATA file name.
analysis_extraNoExtra ANALYSIS lines, e.g. ['TYPE = COMPLEX;'].
class_specificNoMixture: lines for class blocks, e.g. ['%c#1%', '[y1*2];'].
free_variancesNoMixture: free indicator variances across classes.
model_constraintNoMODEL CONSTRAINT lines, verbatim.
growth_regressionsNoGrowth: e.g. ['i s ON x;'].
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It clearly states the tool is non-executing and that the output is raw text, and it reveals template limitations by directing uncovered content to extra parameters. It could add failure behavior or caveats, but the core behavior is 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 concise, front-loaded with purpose, and contains no filler. Each sentence earns its place, and the whole definition is appropriately sized for the tool's complexity.

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 40-parameter tool with no output schema and no annotations, the description still covers the essential workflow, the full model-family list, and a fallback policy for unsupported elements. The per-parameter context in the schema compensates for missing model-type-specific grouping.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides 100% parameter descriptions, setting a baseline of 3. The description adds a useful routing rule for non-template content, but it references `model_extra` while the schema actually defines `model_lines`; following the description verbatim could lead an agent to pass a non-existent parameter.

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 specific verb and resource: 'Write Mplus input syntax for a standard model family', then enumerates model types. It also distinguishes itself from run_syntax by explicitly stating 'Returns the syntax as text - it does not run it.'

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?

It gives an explicit workflow: 'Read it, adjust it, then pass it to `run_syntax`', which tells the agent how to use this tool in relation to its execution sibling. However, it does not compare against other siblings like syntax_help or state conditions when build_syntax should be avoided.

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

Install Server

Other Tools

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/mplus-mcp'

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