Skip to main content
Glama

Find documents similar to text

find_similar_text

Find specification documents semantically similar to a free-form query for pre-creation dedup and discovery, ranked by cosine similarity of local embeddings.

Instructions

Find the documents most semantically similar to a free-form query text (for pre-creation dedup/discovery checks), ranked by cosine similarity of local sentence embeddings (fastembed/bge-small, the similarity extra). By default every whole-body domain is searched (req, uc, tsk, qa, prb, gol, rsk, dec, sop, feat, vcr, sysrs; adr is excluded structurally) -- restrict with target_types. Returns up to top_k (default 10, validated 1..100) hits as {type, id, title, status, path, score} rows, sorted by score descending; min_score (default: no filter) is an inclusive cosine lower bound. An unparseable candidate still appears, embedded from its full raw text, with id = null and the <failed to parse> marker title/status. When the embedding feature is unavailable (SPECMGR_SIMILARITY_DISABLED present, or the backend/model fails to load), returns the structured {available: false, reason, message} result instead of raising. A bad target_types/top_k is a ValueError before any filesystem access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kNo
min_scoreNo
target_typesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.36.0

TDQS

A4.7/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 thoroughly: default domain coverage with adr structurally excluded, the fallback `{available: false, reason, message}` result when the embedding feature is disabled or fails to load, the unparseable-candidate behavior (id=null, `<failed to parse>` marker), and that bad target_types/top_k raises ValueError before any filesystem access.

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 the core purpose, then progressively adds ranking method, scope, return shape, and failure modes. Every clause carries information, but the single long paragraph with heavy parenthetical nesting is denser than ideal for scanning.

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 four-parameter search tool with no annotations, the description covers scope, ranking, defaults, return fields, and error/fallback behavior. An output schema exists, yet the description still gives the row shape without over-explaining, leaving nothing an agent needs to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and it does: query is free-form, top_k defaults to 10 and is validated 1..100, min_score is an inclusive cosine lower bound with no filter by default, and target_types restricts the enumerated domain list. This adds real meaning beyond the bare schema types.

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 precise verb+resource: find documents most semantically similar to a free-form query text, ranked by cosine similarity of local embeddings. This distinguishes it cleanly from the get_*/list_*/find_related siblings, which retrieve by identity or reference rather than semantic similarity.

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?

Gives explicit context ('for pre-creation dedup/discovery checks'), telling the agent when this tool is the right choice. However, it never names an alternative or a when-not condition (e.g. versus find_related or list_*), so routing is implied rather than spelled out.

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