Skip to main content
Glama

BRAINIAC Predictive & Customer Analytics

K-means clustering with silhouette k-selection

predictive-analytics_kmeans-cluster
Read-onlyIdempotent

Lloyd k-means with k-means++ seeding, optional standardisation, nInit restarts, silhouette and inertia for a k range, and stable label renumbering. Price $0.04 USDC. POST /api/v1/predictive-analytics/kmeans-cluster. 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": {
      "columns": "<columns>",
      "rows": "<rows>"
    },
    "name": "predictive-analytics_kmeans-cluster"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNok, integer, from 2 to 50. Optional.
rowsYesrows, array. Required.
seedNoseed, integer, from -9007199254740991 to 9007199254740991. Required.
nInitNonInit, integer, from 1 to 50. Required.
kRangeNokRange, array. Optional.
columnsYescolumns, array. Required.
maxIterNomaxIter, integer, from 1 to 1000. Required.
standardizeNostandardize, boolean. Required.

Output Schema

NameRequiredDescriptionDefault
kNok. Number.
capsNocaps. Object.
labelsNolabels. Array.
inertiaNoinertia. Number.
sourcesNosources. Array.
rowsUsedNorowsUsed. Number.
centroidsNocentroids. Array.
kSelectionNokSelection. Array.
silhouetteNosilhouette. Number.
droppedRowsNodroppedRows. Number.
limitationsNolimitations. Array.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive, and the description reinforces this by stating stable label renumbering, which explains why results are reproducible alongside a fixed seed. It also discloses the $0.04 USDC cost and the unpaid-call behavior, which annotations cannot convey.

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 algorithm summary is front-loaded in a single dense sentence, followed by pricing, endpoint, and the unpaid-call caveat. Every sentence carries operational information with no filler, though the endpoint string is of marginal value to an agent.

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?

With an output schema present, return values need not be described, and the annotations cover the safety profile. The description closes the remaining gaps an agent needs (cost, endpoint, unpaid behavior, k-selection semantics); only input-validation or error behavior is left unstated.

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 meaning the schema lacks: it explains that a k range yields silhouette and inertia for model selection, that standardisation is optional, and that nInit drives restarts. This links parameters to actual behavior rather than restating them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific algorithm and its components: Lloyd k-means, k-means++ seeding, nInit restarts, and silhouette-based k selection. An agent can immediately tell this performs clustering, which distinguishes it from metric/survival siblings, though it does not explicitly contrast with the dbscan-cluster sibling.

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

Usage Guidelines3/5

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

Usage is implied (cluster tabular rows into k groups) and the payment prerequisite is stated clearly: an unpaid call returns x402 terms and does not run. However, there is no guidance on when to use this versus dbscan-cluster, nor on when to supply fixed k versus kRange.

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