Skip to main content
Glama

Run Regression

run_regression
Read-onlyIdempotent

This is QUESTIONSTAR's built-in, server-side computation on the survey's responses. The same and other statistics (e.g. multivariate/interaction regression, time-series, ANOVA) can be computed from the raw responses returned by list_survey_responses. Computes a LINEAR REGRESSION of one survey variable (dependent) on one or more predictors. Variables are addressed by question codes as returned by get_survey: Q1 (whole question), Q3.1 (matrix row), Q2.3 (checkbox option — enters as 0/1). Analyzable: choice questions (options enter by their numeric export code), checkbox options, numeric, slider and sorting questions; free-text cannot be analyzed. Responses missing ANY model variable are excluded LISTWISE. The result uses POSITIONAL header contracts: modelSummaryHeader[i] names modelSummary[i] (R², adjusted R², …); anovaHeader names the columns of each anova row; coefficientNames[i] names coefficients[i] — each coefficient row holds estimate, standard error, t and p in the header's order. coefficientsWarnings carries engine warnings such as collinearity. The regression runs on the server's R engine; if it is unavailable the call returns an error envelope. Heavy rate class (600 requests/hour).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesSurvey publication code — the 8-character code from the survey's public link (e.g. 1a2b3c4d). Returned by list_surveys.
dependentYesQuestion code of the dependent variable (the one to explain).
predictorsYesQuestion codes of the predictors, at least one.
includeConstantNoWhether the model includes a constant (intercept); omitted = true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
anovaNo
errorsNo
dependentNo
casesTotalNo
predictorsNo
surveyCodeNo
anovaHeaderNo
coefficientsNo
modelSummaryNo
coefficientNamesNo
modelSummaryHeaderNo
coefficientsWarningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, it discloses listwise deletion of responses missing any model variable, dependency on the server R engine with an error envelope when unavailable, a heavy rate class (600 req/hour), and the presence of engine warnings such as collinearity. These are exactly the operational traits an agent must anticipate before calling.

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 block is long but front-loads the core definition and proceeds through alternative, computation, variable syntax, missing-data policy, output contract, and rate limit in a logical order. Most sentences carry non-redundant information, though the positional header contract detail could be trimmed given an output schema exists.

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 complex statistical tool it covers everything an agent needs: input variable encoding, analyzable question types, missing-data handling, engine failure behavior, rate limits, and how to read the positional result headers. With an output schema present, it does not over-explain return values while still clarifying the non-obvious header ordering.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds substantial meaning the schema lacks: variable addressing syntax (Q1 whole question, Q3.1 matrix row, Q2.3 checkbox option as 0/1), which question types are analyzable, that choice options enter by numeric export code, and that free-text is not analyzable. This materially changes how an agent must construct dependent and predictors.

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 names a specific verb and resource — computing a linear regression of one survey variable on one or more predictors — and situates it against siblings by noting that other statistics (multivariate regression, time-series, ANOVA) come from list_survey_responses instead. An agent can distinguish this from run_correlation and run_t_test without opening a schema.

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 clearly frames when this tool is the right path (built-in server-side regression) versus pulling raw data and computing statistics externally via list_survey_responses. It does not explicitly name or exclude the sibling statistical tools run_correlation and run_t_test, so the routing guidance is strong but not exhaustive.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources