Skip to main content
Glama

text_similarity

Semantic similarity of two texts for RAG, dedupe and matching: JSON body {a, b}, each up to 8,000 chars, any language. Returns a cosine score from bge-m3 embeddings plus a rough band (near_duplicate, high, related, weak, unrelated). Texts are not stored. Price $0.003 USDC per call via x402. Example output: {"similarity":0.8123,"band":"high","metric":"cosine","model":"baai/bge-m3","dimensions":1024,"chars":{"a":23,"b":27}}

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": {
      "a": "<a>",
      "b": "<b>"
    },
    "name": "text_similarity"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesFirst text, max 8,000 characters
bYesSecond text, max 8,000 characters

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?

With no annotations, the description carries the full burden and does so well: it discloses the embedding model (bge-m3), the metric, the band taxonomy, that texts are not stored, and the per-call price/x402 payment mechanism. That is more than enough for safe invocation.

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 core purpose, limits, and pricing are front-loaded with no filler. The inline example output is longer than strictly necessary but directly substitutes for the missing output schema, so it earns its space.

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?

No output schema exists, yet the description supplies an exact example response including field names and band values, so an agent knows precisely what comes back. Cost, limits, privacy, and language support are all covered — nothing material is missing for a 2-parameter tool.

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 already documents both parameters at 100% coverage, so the baseline is 3; the description adds meaningful detail beyond the schema — that the payload is a JSON body of {a, b}, the 8,000-char ceiling, and that input can be in any language.

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+resource ('Semantic similarity of two texts') plus concrete use cases (RAG, dedupe, matching), and the return contract (cosine score + band). It is clearly distinguishable from all listed siblings, including text_rerank.

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?

Names the jobs it serves — RAG, dedupe, matching — which gives an agent context for selection, but does not explicitly say when to prefer it over the sibling text_rerank or name any exclusions.

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