Skip to main content
Glama

util_kmeans

Read-only

K-means clustering — Cluster numeric points with k-means++ (seeded, reproducible). data= points separated by ; with comma-separated coordinates (1-20 dims, max 600 points) or a plain comma list for 1-D values. Optional k= (otherwise auto-picks k=2..8 by silhouette, k=1 when there is no real structure), scale=true|false (z-score, default on for 2+ dims), labels= names separated by ;, seed=. Returns clusters with centroids in original units, sizes, spread, outliers, assignments, silhouette quality (STRONG/REASONABLE/WEAK/NO_SUBSTANTIAL_STRUCTURE) and the k-selection table. Price: $0.003 USDC (Base, via x402).

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": {
      "data": "<data>"
    },
    "name": "util_kmeans"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYes1,2;1.5,1.8;5,8;8,8;1,0.6;9,11;8,2;10,2;9,3

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare read-only/non-destructive/open-world; the description adds much more — deterministic seeded output, hard input limits (1-20 dims, max 600 points), a payment requirement of $0.003 USDC via x402, and the full shape of the result. The pricing/auth disclosure in particular is information an agent cannot get from any structured field.

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 with purpose, then input format, then options, then return value and price — a sensible ordering with no filler sentences. It is dense and abbreviation-heavy (bare 'k=', 'seed=', 'scale=true|false'), which is efficient but slightly terse to scan.

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?

There is no output schema, so describing the return payload (centroids in original units, sizes, spread, outliers, assignments, silhouette quality tiers, k-selection table) is essential and is done thoroughly. Input limits, defaults and cost are all covered, leaving nothing an agent needs before calling.

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%, but the schema's sole 'data' entry is just a bare example string; the description explains the actual encoding (semicolon-separated points, comma-separated coordinates, plain comma list for 1-D) plus size limits, which is genuine added meaning. The downside is that it documents k, scale, labels and seed, none of which appear in the input schema, so an agent may try to pass parameters that will be rejected.

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 verb and resource — 'K-means clustering — Cluster numeric points with k-means++' — and immediately names the distinguishing properties (seeded, reproducible). No sibling in the util_* family does clustering, so an agent can identify this tool from the first clause alone.

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?

Gives concrete operating context: k is auto-selected by silhouette when omitted, k=1 is returned when there is no real structure, and scaling defaults on for 2+ dims. It does not route the agent away from near-neighbors like util_anomalies or util_distribution, but no real alternative for clustering exists, so the omission is minor.

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