Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

vector_similarity

Read-onlyIdempotent

Compute similarity/distance between two float vectors: cosine similarity, dot product, Euclidean and Manhattan distance. Essential for vector DB relevance scoring, embedding evaluation, and nearest-neighbor testing.

Input Schema

NameRequiredDescriptionDefault
metricNoDistance metric (default: all)
vector_aYesFirst vector as array of floats
vector_bYesSecond vector as array of floats

Output Schema

NameRequiredDescriptionDefault
norm_aNo
norm_bNo
dimensionNo
dot_productNo
interpretationNo
cosine_distanceNo
cosine_similarityNo
euclidean_distanceNo
manhattan_distanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "vector_a": [
      +      1,
      +      0
      +    ],
      +    "vector_b": [
      +      0,
      +      1
      +    ]
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "cosine_distance": {},
      +  "cosine_similarity": {},
      +  "dimension": {},
      +  "dot_product": {},
      +  "euclidean_distance": {},
      +  "interpretation": {},
      +  "manhattan_distance": {},
      +  "norm_a": {},
      +  "norm_b": {}
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is fully covered. The description adds nothing beyond that – no mention of behavior on mismatched dimensions or zero vectors – so it contributes little behavioral value on top of structured data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the verb and resource, with the metric list and use cases packed efficiently. No filler or redundancy.

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 a full schema and an output schema in place, the description need not explain return values, and it covers purpose, metrics and validation contexts. Minor gaps like edge-case behavior (dimension mismatch) keep it short of a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the enum for metric is documented, so the schema carries the parameter burden. The description reinforces the metric names and clarifies inputs are floats, but adds no format or default detail beyond what the schema already provides.

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?

States a specific verb (compute) and resource (similarity/distance between float vectors) and enumerates the four supported metrics, so the agent knows exactly what is calculated. It does not name or distinguish itself from related siblings such as similarity_score or embedding_similarity, leaving the agent to infer that this one operates on raw float vectors.

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?

The 'vector DB relevance scoring, embedding evaluation, nearest-neighbor testing' clause implies usage contexts but gives no explicit when-to-use/when-not conditions and never points to an alternative tool. It is adequate but leaves the selection against siblings ambiguous.

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.