list_documents_tool
View all indexed documents in the PinRAG vector store, including PDFs, videos, GitHub repos, and Discord exports, with optional tag filtering.
Instructions
List all indexed documents in the PinRAG index.
Returns unique document IDs (PDF file names, video IDs, discord-alicia-1200-pcb, owner/repo/path for GitHub, etc.)
currently in the vector store, plus total chunk count. Uses server config
for vector store location and collection.
Args:
tag: Optional tag to filter: only list documents that have this tag.
ctx: MCP request context (injected by the server; unused).
Returns:
Dictionary containing documents, total_chunks, persist_directory,
collection_name, document_details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Optional tag to filter: only list documents that have this tag. |
Implementation Reference
- src/pinrag/mcp/server.py:242-274 (handler)The implementation of list_documents_tool which calls list_documents function in a separate thread.
async def list_documents_tool( tag: Annotated[ str, Field( description="Optional tag to filter: only list documents that have this tag." ), ] = "", ctx: Context | None = None, ) -> dict: """List all indexed documents in the PinRAG index. Returns unique document IDs (PDF file names, video IDs, discord-alicia-1200-pcb, owner/repo/path for GitHub, etc.) currently in the vector store, plus total chunk count. Uses server config for vector store location and collection. Args: tag: Optional tag to filter: only list documents that have this tag. ctx: MCP request context (injected by the server; unused). Returns: Dictionary containing documents, total_chunks, persist_directory, collection_name, document_details. """ def _run() -> dict: return list_documents( persist_dir=config.get_persist_dir(), collection=config.get_collection_name(), tag=tag or None, ) return await anyio.to_thread.run_sync(_run)