Skip to main content
Glama
ESPChong

context-retrieval

by ESPChong

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CONTEXT_RETRIEVAL_DATA_DIRNoWhere index.faiss / vectors.npy / meta.json persist~/.context_retrieval
CONTEXT_RETRIEVAL_CHUNK_SIZENoLangChain splitter parameters1000
CONTEXT_RETRIEVAL_IVF_NPROBENoIVF clusters probed per query16
CONTEXT_RETRIEVAL_EMBED_MODELNoLocal fastembed model (384-dim)BAAI/bge-small-en-v1.5
CONTEXT_RETRIEVAL_ALLOWED_ROOTSNoComma-separated directory allow-list for tool paths
CONTEXT_RETRIEVAL_CHUNK_OVERLAPNoLangChain splitter parameters150
CONTEXT_RETRIEVAL_IVF_THRESHOLDNoVectors above this switch Flat → IVF index256

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

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 7 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessNo issues