Skip to main content

MCP RAG Tool

Provides semantic document search through the RAG pipeline. Searches uploaded documents for content relevant to the query.

  • Tech: TypeScript, MCP SDK
  • Port: 3002
  • Tool name: search_documents

Tool: search_documents​

Accepts 1-3 query candidates ordered by specificity. Tries each query sequentially until results are found.

Input Schema​

FieldTypeRequiredDescription
queriesstring[]Yes1-3 search queries, ordered from most to least specific
similarityTopKnumberNoNumber of similarity search results
scoreThresholdnumberNoMinimum similarity score
rerankTopKnumberNoNumber of results after reranking
rerankScorenumberNoMinimum rerank score

Example​

{
"name": "search_documents",
"arguments": {
"queries": [
"kubernetes pod scheduling algorithm",
"kubernetes scheduling",
"container orchestration"
],
"similarityTopK": 15,
"rerankTopK": 5
}
}

How It Works​

  1. Takes the first query from the list
  2. Calls the RAG service to perform similarity search + reranking
  3. If results meet the score threshold, returns them
  4. If not, tries the next query
  5. Returns the best results found

Connection​

Connects to the RAG service backend to perform the actual retrieval. The RAG service URL is configured via environment variables.