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
| Field | Type | Required | Description |
|---|---|---|---|
| queries | string[] | Yes | 1-3 search queries, ordered from most to least specific |
| similarityTopK | number | No | Number of similarity search results |
| scoreThreshold | number | No | Minimum similarity score |
| rerankTopK | number | No | Number of results after reranking |
| rerankScore | number | No | Minimum rerank score |
Example
{
"name": "search_documents",
"arguments": {
"queries": [
"kubernetes pod scheduling algorithm",
"kubernetes scheduling",
"container orchestration"
],
"similarityTopK": 15,
"rerankTopK": 5
}
}
How It Works
- Takes the first query from the list
- Calls the RAG service to perform similarity search + reranking
- If results meet the score threshold, returns them
- If not, tries the next query
- 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.