Skip to main content
Glama

index_library_pdfs

Index PDFs from your library to enable querying with page-level citations. Supports selective indexing by topic and scope.

Instructions

Build or rebuild a PaperQA2 index over the user's PDF library.

Walks knowledge/library/ (all subdirectories), collects PDFs, and indexes
them with PaperQA2 + Claude Haiku. The index is persisted so that
ask_library() can query it without re-reading every PDF.

Run once after adding new papers, or with force_reindex=True to rebuild.

Args:
    force_reindex: Rebuild from scratch even if an index already exists.
    topic_filter: If given, only index PDFs whose parent folder name
                  contains this string (e.g. "NTD", "Epidemiology", "Methods").
    scope: Which library to index. "default" = knowledge/library/ (all PDFs).
           "ph_library" = knowledge/library/ph-background/ (public health background).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
force_reindexNo
topic_filterNo
scopeNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Without annotations, the description explains the indexing process and persistence, but does not disclose potential side effects like long runtime, disk usage, or permission requirements.

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

Conciseness5/5

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

The description is concise, front-loaded with the main purpose, and uses a clear structure with separate paragraphs for the overview and parameter details. Every sentence adds value.

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?

The description covers the tool's operation, parameters, and relationship to ask_library(), but does not describe the return value or potential errors. The output schema likely fills this gap.

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

Parameters5/5

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

The description includes an 'Args' section that thoroughly explains all three parameters (force_reindex, topic_filter, scope) with concrete examples, fully compensating for the 0% schema coverage.

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?

The description clearly states the tool builds or rebuilds a PaperQA2 index over PDFs, specifying the resource and action. However, it does not differentiate itself from the sibling tool 'index_pdf_library', which may have similar functionality.

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

Usage Guidelines4/5

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

The description provides when to use the tool (after adding papers, with force_reindex) and explains scope and topic_filter options. It does not mention alternative tools or exclusions, but context is clear.

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/SVerITG/Metis_PH'

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