Skip to main content
Glama
menyoung

paperqa-mcp-server

by menyoung

paper_qa

Search and synthesize answers from scientific papers in your library. Get detailed responses with citations for complex research questions requiring analysis across multiple documents.

Instructions

Search and synthesize across all papers in the library.

Use this for questions that require deep reading and synthesis across multiple scientific papers — e.g. "What methods have been used to recycle lithium from spent batteries?" or "Compare the thermal stability of PEEK vs PTFE in the literature."

Returns a detailed answer with inline citations. Each citation includes a file path containing an 8-character Zotero storage key (e.g. ABC123DE from storage/ABC123DE/paper.pdf). You can use these keys with zotero-mcp tools to look up the full bibliographic record, read annotations, or find related items.

Not for quick metadata lookups or library browsing — use Zotero tools for that.

If this tool returns "Index incomplete", the paper index has not been fully built yet. Tell the user to run the index build command from the terminal (see the paperqa-mcp-server README, step 6). Do not retry the query — it will give the same result until the index is built.

This tool can take 30–90 seconds to respond when working normally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'paper_qa' tool handler is defined using @mcp.tool() in src/paperqa_mcp_server/__init__.py. It validates the index status before performing an agent_query using the paperqa library.
    @mcp.tool()
    async def paper_qa(query: str) -> str:
        """Search and synthesize across all papers in the library.
    
        Use this for questions that require deep reading and synthesis
        across multiple scientific papers — e.g. "What methods have been
        used to recycle lithium from spent batteries?" or "Compare the
        thermal stability of PEEK vs PTFE in the literature."
    
        Returns a detailed answer with inline citations. Each citation
        includes a file path containing an 8-character Zotero storage key
        (e.g. ABC123DE from storage/ABC123DE/paper.pdf). You can use these
        keys with zotero-mcp tools to look up the full bibliographic record,
        read annotations, or find related items.
    
        Not for quick metadata lookups or library browsing — use Zotero
        tools for that.
    
        If this tool returns "Index incomplete", the paper index has not
        been fully built yet. Tell the user to run the index build command
        from the terminal (see the paperqa-mcp-server README, step 6).
        Do not retry the query — it will give the same result until the
        index is built.
    
        This tool can take 30–90 seconds to respond when working normally.
        """
        settings = _settings()
        status = _index_status(settings)
        if not status["ready"]:
            return f"Index incomplete: {status['message']}"
    
        try:
            response = await agent_query(query=query, settings=settings)
        except Exception as e:
            return f"PaperQA error: {e}"
        if not response.session.formatted_answer:
            return f"PaperQA could not answer (status: {response.status})."
        return response.session.formatted_answer
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: the tool returns detailed answers with inline citations and specific file path formats, can return an 'Index incomplete' error with instructions for resolution, and has a long response time (30–90 seconds). It does not mention error handling beyond the index issue or rate limits, but covers essential operational aspects.

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 well-structured and front-loaded with the core purpose, followed by usage guidelines, output details, error handling, and performance notes. Each sentence adds value without redundancy, making it efficient and easy to parse for an AI agent.

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

Completeness5/5

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

Given the tool's complexity (synthesis across papers, citations, potential errors, long runtime) and the presence of an output schema (which handles return values), the description is complete. It covers purpose, usage, output format, error scenarios, and performance, providing all necessary context for effective tool invocation without needing to repeat schema details.

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

Parameters4/5

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

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It implies the 'query' parameter is for complex research questions requiring synthesis, as shown in the examples, adding meaningful context beyond the schema's basic type definition. However, it does not specify format constraints or length limits for the query.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('search and synthesize') and resource ('across all papers in the library'), distinguishing it from sibling tools like 'index_status'. It provides concrete examples of appropriate queries, making the purpose unambiguous and well-defined.

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

Usage Guidelines5/5

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

The description explicitly defines when to use this tool ('for questions that require deep reading and synthesis across multiple scientific papers') and when not to use it ('Not for quick metadata lookups or library browsing — use Zotero tools for that'). It also provides an alternative ('Zotero tools') for excluded use cases, offering comprehensive guidance.

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/menyoung/paperqa-mcp-server'

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