context-retrieval
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CONTEXT_RETRIEVAL_DATA_DIR | No | Where index.faiss / vectors.npy / meta.json persist | ~/.context_retrieval |
| CONTEXT_RETRIEVAL_CHUNK_SIZE | No | LangChain splitter parameters | 1000 |
| CONTEXT_RETRIEVAL_IVF_NPROBE | No | IVF clusters probed per query | 16 |
| CONTEXT_RETRIEVAL_EMBED_MODEL | No | Local fastembed model (384-dim) | BAAI/bge-small-en-v1.5 |
| CONTEXT_RETRIEVAL_ALLOWED_ROOTS | No | Comma-separated directory allow-list for tool paths | |
| CONTEXT_RETRIEVAL_CHUNK_OVERLAP | No | LangChain splitter parameters | 150 |
| CONTEXT_RETRIEVAL_IVF_THRESHOLD | No | Vectors above this switch Flat → IVF index | 256 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| extract_document_textA | Extract structured text from a PDF, page by page (PyMuPDF). Returns JSON: page count, document metadata, and each page's text with 1-based page numbers — use pages='1-3' or '1,5' to limit output. |
| extract_document_imagesA | Extract embedded images from a PDF as base64 PNG (PyMuPDF). Each image carries page, width, height and byte size. Set include_data=false to inventory images without transferring payloads; oversized images return metadata only. |
| extract_document_tablesA | Extract tabular data from a PDF (Camelot lattice/stream with a PyMuPDF fallback; flavor='auto' picks the first strategy that finds tables). Returns JSON with rows, columns and CSV per table. |
| index_documentA | Index a PDF into the local RAG store: PyMuPDF text -> LangChain chunking -> local fastembed embeddings -> FAISS. Call once per document, then use search_context for queries. Re-indexing a changed file replaces its chunks (set replace=false to append). |
| search_contextA | Semantic search over indexed documents (FAISS + local embeddings). Returns the top-k chunks ranked by cosine similarity with source file and page provenance — feed these to your answer generation. Optional source_filter narrows hits to one document. |
| index_infoA | Report vector store status: documents, chunk count, dimension, FAISS index type. |
| reset_indexA | Drop every indexed document and clear the persisted vector store. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 7 tools
Each tool targets a distinct operation: reset/index/status/retrieval are clearly separated from the three extraction tools, which differ by output type (text/images/tables). Even though extract_document_text and index_document both process PDFs, one returns extracted text while the other persists chunks into the vector store, so an agent can choose unambiguously.
Most tools follow a verb_noun pattern (reset_index, index_document, search_context), and the extract_document_* family is perfectly consistent. index_info is slightly off-pattern because it reads as a noun phrase rather than verb + object, but this is a minor deviation.
Seven tools is a well-scoped size for a PDF extraction and RAG retrieval server. Each tool earns its place and there is no redundant duplication.
The core workflow is covered: documents can be extracted, indexed, searched, and the entire index can be reset. The main gap is the lack of a way to delete a single document from the index, with only reset_index for the whole store, and no explicit list of indexed file names.