Skip to main content
Glama

Найти в документах по смыслу

search_documents
Read-only

Retrieves relevant fragments from an indexed folder by embedding your question and reranking matches, returning citable snippets with file names and fragment numbers.

Instructions

Ищет в проиндексированной папке фрагменты, отвечающие на вопрос: эмбеддинг запроса + косинусная близость, затем реранкинг (POST /rerank). Возвращает фрагменты с именем файла и номером фрагмента — используйте их как цитаты в ответе. Сначала нужен index_documents.

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": {
      "folder": "<folder>",
      "query": "<query>"
    },
    "name": "search_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesВопрос или поисковый запрос своими словами
top_kNoСколько фрагментов вернуть (по умолчанию 6)
folderYesПапка, которую индексировали
rerank_modelNoМодель реранкинга (по умолчанию cohere/rerank-v3.5); 'none' — без реранкинга

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

readOnlyHint=true is consistent with a search operation, so the annotation already covers the safety profile. Beyond that, the description discloses the retrieval pipeline, the rerank call, and — with no output schema present — what the response contains (fragments plus file name and fragment number). It does not mention latency, cost of reranking, or behavior when the folder was never indexed.

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 short sentences, front-loaded with the action and mechanism, then the return shape and usage, then the prerequisite. Nothing is redundant or padded.

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 so adequately by naming the fragment fields and their citation use. The prerequisite is stated, so an agent can sequence index_documents before this call. Missing only edge-case behavior such as an unindexed or empty folder.

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?

Schema description coverage is 100%, so all four parameters are already documented, including top_k default and the 'none' option for rerank_model. The description only indirectly contextualizes rerank_model by mentioning the POST /rerank step, adding little beyond the schema. Baseline 3 is appropriate.

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?

Names a specific verb and resource ('Ищет в проиндексированной папке фрагменты') and adds the mechanism (embedding + cosine similarity, then rerank), so an agent knows exactly what class of operation this is. It also separates itself from index_documents by declaring that tool a prerequisite rather than an alternative.

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 prerequisite 'Сначала нужен index_documents' tells the agent the ordering condition that must hold before calling. It also directs how to use the output ('используйте их как цитаты'). There is no explicit when-not guidance, but no sibling competes for the same retrieval task, so the gap is minor.

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