Skip to main content
Glama

Stat Logistic Regression

stat_logistic_regression

Use binary logistic regression to model yes/no outcomes from one or more predictors and report odds ratios with confidence intervals.

Instructions

Binary logistic regression with odds ratios and confidence intervals.

WHEN TO USE: a binary outcome (yes/no, present/absent) predicted from one or more variables.

WHEN NOT TO USE:

  • Continuous outcome → stat_linear_regression.

  • Ordinal outcome with 3+ levels → an ordinal model, not this.

  • Rare events (fewer than ~10 outcomes per predictor) → the estimates are biased; use penalised regression (Firth).

An odds ratio is not a risk ratio: for common outcomes it exaggerates the effect. Report predicted probabilities alongside when the substantive question is about risk.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "y": "<y>",
      "x": "<x>"
    },
    "name": "stat_logistic_regression"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYes
yYes
nameYes
alphaNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 behavioral burden and goes beyond basic purpose: it warns about small-sample bias in rare events and about odds ratios overstating effects for common outcomes, which are real interpretive pitfalls. It does not cover convergence failures, complete separation, or how the model handles missing data or categorical predictors, so it is not fully complete.

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?

Front-loaded purpose sentence, then labeled WHEN TO USE and WHEN NOT TO USE blocks with a bulleted exclusion list — easy to scan. The closing odds-ratio-versus-risk-ratio paragraph is genuinely useful rather than filler, though the definition is somewhat long for a tool whose parameters go unexplained.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and the statistical caveats cover the modeling context well. The significant remaining gap is the 0%-documented input schema: for a four-parameter tool, an agent still has to guess what `name` and `alpha` do, which is a minimum-viable, not complete, definition.

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?

Schema description coverage is 0% across four parameters, so the description must compensate and largely does not: it never explains that `y` is the binary outcome, `x` is the predictor list, what `name` labels, or that `alpha` sets the confidence level. The phrase 'predicted from one or more variables' only weakly hints at the y/x mapping; `name` and `alpha` are left undocumented in both places.

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 first sentence names a specific method plus its key outputs (odds ratios, confidence intervals), and the WHEN NOT section explicitly distinguishes it from `stat_linear_regression` and ordinal models. An agent can route binary versus continuous versus ordinal outcomes without opening any sibling schema.

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

Usage Guidelines5/5

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

Explicit when-to-use (binary outcome predicted from one or more variables) and when-not-to-use with a named alternative for the continuous case, plus a rare-events exclusion that points to Firth penalised regression. The only mild gap is that the 'ordinal model' alternative is not named, but the condition is stated clearly enough to act on.

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