Skip to main content
Glama
junna-legal
by junna-legal

semantic_search

Find documents in an indexed collection that are semantically similar to a query, ranked by cosine similarity score.

Instructions

Search a collection for documents semantically similar to a query. Returns top-k results ranked by cosine similarity. The collection must have been indexed first with semantic_index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query text
top_kNoNumber of top results to return (default: 5, max: 100)
min_scoreNoMinimum similarity score threshold (0-1, default: 0)
collectionYesName of the collection to search
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that results are top-k ranked by cosine similarity and that indexing is required beforehand. However, it does not mention what happens if the collection is missing or not indexed, nor describe the output schema or potential errors.

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?

The description is concise, using only two sentences to convey purpose, result type, ranking method, and a crucial prerequisite. Information is front-loaded and every clause adds value with no redundancy.

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 relatively simple search tool with complete schema coverage, the description covers the essential purpose, the ranking method, and the indexing prerequisite. It does not detail the return structure or error handling, but the absence of an output schema and the straightforward nature of the task make this acceptable.

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

Parameters3/5

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

The input schema fully describes each parameter, so the baseline is 3. The description adds general context about top-k and cosine similarity but does not add new information about parameter syntax or specific semantics beyond what the schema already provides.

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 clearly states the tool's function: searching a collection for semantically similar documents to a query. It also specifies the ranking mechanism (cosine similarity) and differentiates from siblings by emphasizing the semantic nature and prerequisite indexing, distinguishing it from database-query or file_search.

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 description provides a clear usage context: use when you need semantic similarity search on an indexed collection. It explicitly states the precondition that the collection must be indexed first with semantic_index, which is a valuable cue against alternatives. However, it does not explicitly mention when not to use it or contrast with keyword-based search.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/junna-legal/mcp-starter-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server