Skip to main content
Glama

BRAINIAC Statistics & Quality Engineering

Fit a binary logistic regression

statistics_logistic-regression
Read-onlyIdempotent

Binary logistic regression by iteratively reweighted least squares with odds ratios and intervals, deviance, AIC, Hosmer-Lemeshow goodness of fit, a confusion matrix at a chosen threshold and complete-separation detection. Price $0.05 USDC. POST /api/v1/statistics/logistic-regression. An unpaid call returns the x402 payment terms and does not run.

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": {
      "y": "<y>",
      "X": "<X>"
    },
    "name": "statistics_logistic-regression"
  }
}

Input Schema

NameRequiredDescriptionDefault
XYesX, array. Required.
yYesy, array. Required.
namesNonames, array. Optional.
hlGroupsNohlGroups, integer, from 3 to 50. Required.
thresholdNothreshold, number. Required.

Output Schema

NameRequiredDescriptionDefault
nNon. Number.
aicNoaic. Number.
sourcesNosources. Array.
devianceNodeviance. Number.
confusionNoconfusion. Object.
convergedNoconverged. Boolean.
iterationsNoiterations. Number.
droppedRowsNodroppedRows. Number.
limitationsNolimitations. Array.
coefficientsNocoefficients. Array.
nullDevianceNonullDeviance. Number.
hosmerLemeshowNohosmerLemeshow. Object.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world behavior. The description adds genuinely new context: the algorithm used, the exact set of computed outputs, a fixed price of $0.05 USDC, the HTTP route, and the important behavior that an unpaid call returns x402 payment terms instead of running. Not stating whether compute failures still incur charges is a minor omission.

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-loads the model and method, then the outputs, then the price and endpoint, then the payment gate — nothing is filler. The output enumeration is a dense comma list that is slightly hard to parse but every element carries information an agent needs.

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?

An output schema exists, so the return values did not need spelling out, yet the description covers method, deliverables, cost, and payment behavior, which is more than most agents need to select and call it. What is missing is data-shape guidance (X rows matching y length, numeric-only covariates) for a two-required-array tool.

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, but the description adds real meaning by tying 'threshold' to the confusion matrix and naming the Hosmer-Lemeshow test that hlGroups governs. It does not clarify the names parameter or the row/column alignment requirement between X and y, but it does more than restate the schema.

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?

States a specific method (iteratively reweighted least squares) on a specific model (binary logistic regression) and enumerates the exact statistics produced: odds ratios with intervals, deviance, AIC, Hosmer-Lemeshow, confusion matrix, complete-separation detection. The 'binary' qualifier plus the output list cleanly distinguishes it from statistics_linear-regression.

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?

There is no guidance on when to choose this over statistics_linear-regression, statistics_chi-square-test, or statistics_nonparametric-tests, and no preconditions such as minimum sample size or that y must be 0/1 with rows aligned to X. The only conditional stated is operational (unpaid call returns x402 terms), not usage-oriented.

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