Skip to main content
Glama

Text Similarity

text_similarity
Read-onlyIdempotent

Document similarity and near-duplicate detection: compare two texts (a, b) or cluster up to 200 texts. Metrics: TF-IDF cosine on stemmed content words, word Jaccard, k-word shingle Jaccard and containment, 64-bit SimHash with Hamming distance, and character edit ratio for short texts, plus a verdict (identical / near-duplicate / similar / related / different). Batch mode returns the most similar pairs and duplicate clusters. Offline, deterministic. Price: $0.002 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/text-similarity

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "text_similarity"
  }
}

Input Schema

NameRequiredDescriptionDefault
aNoFirst text
bNoSecond text
textsNoBatch mode: texts to compare pairwise and cluster
minScoreNoBatch: only report pairs with cosine >= this
thresholdNoShingle Jaccard needed to call two texts duplicates (batch clusters)
shingleSizeNoWords per shingle

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, it discloses paid pricing ($0.002 USDC per successful call via x402 on Solana), the HTTPS mirror endpoint, and that results are offline and deterministic — all information an agent cannot get from the schema or annotations.

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 and both modes before the metric catalog and the pricing/endpoint footnote. Dense but every clause is informative; the long metric list is the only part that borders on enumerative padding.

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 no output schema, the description carries the return-value burden and does state verdict labels and that batch mode returns top pairs plus clusters. It stops short of specifying which per-metric scores come back in single-pair mode, a minor remaining gap for a 6-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 coverage is 100%, so baseline is 3, but the description adds real meaning by tying shingleSize to 'k-word shingle Jaccard', explaining what minScore filters (most similar pairs) and threshold controls (duplicate clusters), and naming the underlying metrics behind the verdicts.

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 names a specific verb and resource ('Document similarity and near-duplicate detection') and spells out both operating modes (pairwise compare via a/b, cluster via texts). It clearly separates this tool from the extract/diff/text-processing siblings in the catalog.

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?

The two modes and their inputs (a/b vs texts, up to 200) are stated explicitly, giving clear context for choosing between them. It does not, however, name alternatives such as fuzzy_match or text_diff, so an agent must infer those boundaries from the sibling list.

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