Skip to main content
Glama

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
NameRequiredDescriptionDefault
tagNoOptional tag to filter: only list documents that have this tag.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full disclosure burden. Successfully adds behavioral context: explains ID format variants (PDF filenames, video IDs, GitHub paths), discloses total chunk counting behavior, notes server config dependency for vector store location, and specifies return dictionary structure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections: purpose statement, Returns block, and Args block. Information is front-loaded. Minor verbosity in Returns section documenting fields, though this adds value by example ID patterns. 'ctx' parameter mention in Args is extraneous (not in schema) but marked as unused.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Appropriately complete for a 1-parameter listing tool. Output schema exists (per context signals), so verbose return documentation in description is optional but helpful. Includes concrete examples of document ID formats which aids LLM comprehension of return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% description coverage for the single 'tag' parameter. Description includes Args section that essentially duplicates schema information. Baseline 3 is appropriate since schema is self-documenting; description adds no new semantic meaning beyond schema but accurately reflects it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States specific verb 'List' with resource 'indexed documents' and scope 'PinRAG index'. Clear distinction from siblings: contrasts with add/remove by focusing on retrieval of existing index, and implicitly differs from query_tool by emphasizing enumeration ('all indexed documents') rather than semantic search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides implicit usage context through detailed return value description (document IDs, chunk counts), but lacks explicit when-to-use guidance. Does not clarify when to choose this over query_tool (listing/enumeration vs. content search) or whether to check existence before calling add_document_tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ndjordjevic/pinrag'

If you have feedback or need assistance with the MCP directory API, please join our Discord server