Skip to main content
Glama

embedding_similarity

Read-onlyIdempotent

Compute text similarity using local algorithms (Bag of Words, TF-IDF, Character N-grams). No API key needed — runs entirely in-process. NOT real embeddings: true vector embeddings are run_semantic_tests with mode="embeddings" and an OpenAI key. Supports single pair or batch mode with pipe-separated pairs. Useful for RAG retrieval testing, semantic search evaluation, and text deduplication.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text_a": "the cat sat",
      "text_b": "quantum field theory"
    },
    "name": "embedding_similarity"
  }
}

Input Schema

NameRequiredDescriptionDefault
batchNoBatch mode: array of { text_a, text_b } pairs. Overrides text_a/text_b if provided.
text_aNoFirst text to compare (single-pair mode)
text_bNoSecond text to compare (single-pair mode)
methodsNoAlgorithms to use (default: all three). Options: "bow", "tfidf", "ngram"

Output Schema

NameRequiredDescriptionDefault
modeNo
countNo
scoresNo
text_aNo
text_bNo
resultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "text_a": "the cat sat",
      +    "text_b": "quantum field theory"
      +  }
      +]
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds behavior beyond them: it runs entirely in-process, needs no API key, and is deliberately not a real embedding model. That key caveat prevents an agent from misinterpreting the scores as vector-space distances. It does not describe output shape or score ranges, but an output schema exists to carry that.

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?

It is dense and front-loaded: algorithm scope, the no-API-key guarantee, the 'NOT real embeddings' disclaimer, and the routing alternative all appear early. The trailing use-case list earns its place as triage guidance, but the pipe-separated phrasing is an ambiguous detail that costs more than it gives.

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?

For a four-parameter, read-only comparison tool with a full output schema and complete annotation coverage, the description supplies what structured data cannot: the in-process/local nature and the explicit 'this is not real embeddings' limitation. The only completeness defect is the mismatch between the described pipe-separated batch format and the actual array-of-objects schema.

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 coverage is 100%, so text_a, text_b, batch, and methods are all already documented in the schema, which sets the baseline at 3. The description does add the useful note that batch mode exists, but its phrase 'batch mode with pipe-separated pairs' conflicts with the schema, where batch is an array of {text_a, text_b} objects rather than a pipe-delimited string, which could confuse an agent about the expected input format.

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?

The description opens with a specific verb and resource — 'Compute text similarity using local algorithms' — and immediately enumerates the concrete methods (Bag of Words, TF-IDF, Character N-grams). It also explicitly separates itself from the nearest sibling by name, so an agent can distinguish embedding_similarity from run_semantic_tests without opening either schema.

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?

It gives clear when-to-use context ('RAG retrieval testing, semantic search evaluation, text deduplication') and an explicit routing rule to run_semantic_tests with mode="embeddings" plus an OpenAI key when true vector embeddings are needed. The gap is that it never mentions the very similar sibling similarity_score or bm25_score, so the agent still has to guess between several overlapping comparison tools.

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.