Skip to main content
Glama

Compare two texts

similarity
Read-only

Compare two texts to score how closely their meanings match using a local cosine similarity value, so you can check whether they discuss the same topic.

Instructions

Score how close two texts are in meaning, locally. Returns a cosine between -1 and 1; above about 0.6 usually means the same topic. The order of the two does not matter. Use it to check a pair, such as whether two notes say the same thing; to order many passages against a query use rerank, and to find passages in files use search_folder. Texts longer than a few paragraphs are cut off.

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": "similarity"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesThe first text.
bYesThe second text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.5
    • addedInput schema / properties / a / description
      Added value: +"The first text."
    • addedInput schema / properties / b / description
      Added value: +"The second text."
  2. First observedv0.8.2

TDQS

A4.7/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries real weight here and delivers: return range of -1 to 1, a practical interpretation threshold (~0.6), symmetry of arguments, and a silent truncation limit on long inputs. The truncation caveat is exactly the kind of hidden behavior that prevents misreads, though the description doesn't say how truncation affects the returned score.

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?

Three tight sentences ordered by importance: what it does and what it returns, then how to read the number, then routing to alternatives. Every clause carries information; no filler or restatement of the title.

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?

For a two-string, no-output-schema tool this is complete: semantics, output scale, interpretation guidance, symmetry, input limits, and sibling routing are all covered. An agent can call it correctly and interpret the result without further information.

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% and both params are documented, so the baseline is 3. The description adds genuine meaning beyond the schema by stating that the order of the two arguments does not matter, which resolves a real ambiguity for a symmetric comparison tool.

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 ('score how close two texts are in meaning') plus the scope qualifier 'locally', which separates it from server-side or index-based comparison. The mention of rerank and search_folder makes the boundary with siblings explicit without needing their schemas.

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 a concrete when-to-use case ('check a pair, such as whether two notes say the same thing') and names both alternatives with the conditions that select them: rerank for ordering many passages against a query, search_folder for finding passages in files. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.