Skip to main content
Glama

text_similarity

Read-only

Text similarity and overlap check (offline) — Compare two texts offline: term-frequency cosine, word-set Jaccard, shingle overlap (how much of a appears word-for-word in b and vice versa), longest common word run and the shared passages. Verdict IDENTICAL / NEAR_DUPLICATE / HIGH_OVERLAP / PARTIAL_OVERLAP / SIMILAR / RELATED / DIFFERENT with a 0-100 score. Use it for duplicate detection, copy/plagiarism screening, or checking a rewrite. a and b up to 20,000 characters each; optional shingle (2-10 words, default 5). Lexical, not semantic; for meaning use /v1/ai/similarity. Price: $0.001 USDC (Base, via x402).

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
aYese.g. The quick brown fox jumps over the lazy dog near the river bank today.
bYese.g. Today the quick brown fox jumps over the lazy dog near the old mill.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld/non-destructive; the description adds material context they do not cover: offline computation, a per-call price of $0.001 USDC on Base via x402, and per-input limits of 20,000 characters. It also pre-announces the output vocabulary (seven verdict labels plus a 0-100 score) even though no output schema exists. Nothing here contradicts the declared hints.

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?

Effectively one dense paragraph, front-loaded with the method and verdict vocabulary, then limits, then the semantic alternative, then price. Every clause carries information, though the packed parentheticals and trailing pricing note make it slightly harder to scan than a short bulleted layout would be.

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 two-parameter read-only computation with no output schema, the description covers inputs, limits, algorithm, result vocabulary and cost — nearly everything needed to call it correctly. The only incompleteness is the phantom shingle parameter and the absence of any detail on the shape of the returned metrics/passage list.

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?

With 100% schema coverage the schema already names a and b, but its descriptions are only example sentences; the description adds the real constraint (up to 20,000 characters each) and explains shingle granularity (2-10 words, default 5). The deduction is for the 'optional shingle' parameter, which is absent from the supplied input schema, creating a mismatch an agent could trip over if it tries to pass it.

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 and resource (compare two texts) and enumerates exactly which algorithms produce the result: TF cosine, Jaccard, shingle overlap, longest common word run, shared passages. It also names the boundary against a sibling ('Lexical, not semantic; for meaning use /v1/ai/similarity'), so an agent can differentiate it without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to-use cases (duplicate detection, copy/plagiarism screening, checking a rewrite) and an explicit exclusion with the alternative to pick instead when semantic meaning is required. Nothing is left to inference about which tool to select.

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