Skip to main content
Glama

knn_classify

Classify a query point using labeled numeric training rows with k-nearest-neighbour voting; optionally apply min-max normalisation and select a distance metric.

Instructions

k-nearest-neighbour classification. train rows: [a1, ..., an, label]. Optional min-max normalisation.

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": {
      "train": "<train>",
      "query": "<query>"
    },
    "name": "knn_classify"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNo
queryYes
trainYes
metricNoeuclidean
normaliseNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses the train-row layout and that normalisation is optional, but says nothing about metric choices, tie-breaking, required feature-dimension matching, or that the tool is a pure computation with no side effects.

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?

Three short fragments, front-loaded with the algorithm name and no filler. The 'train rows: [a1, ..., an, label]' notation is compact, though the fragmentary style is slightly terse at the cost of clarity.

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

Completeness2/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. However, for a five-parameter tool with zero annotation and zero schema-description coverage, the description leaves too much undocumented — notably valid metric values, the effect of k, and query dimensionality.

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 coverage is 0%, so the description must supply parameter meaning. It documents only the train row structure (features plus trailing label) and the normalise flag; k, query, and metric are left entirely to the bare schema titles.

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 the specific algorithm and task ('k-nearest-neighbour classification'), which distinguishes it from probabilistic siblings like naive_bayes_classify. It does not explicitly contrast with those siblings, but the verb+resource is unambiguous.

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 k-NN over naive_bayes_classify or other classifiers, nor on prerequisites such as consistent feature dimensionality between train and query. The agent must infer the use case from the algorithm name alone.

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