Skip to main content
Glama

papercortex_query

Read-only

Answers questions from your local Paperless-ngx document index by retrieving relevant excerpts and generating a grounded response with source IDs, titles, and relevance scores.

Instructions

Answer a question using Ollama and the closest matching excerpts from the local search index. Returns an answer with source IDs, titles and relevance scores, or a message when no sources match. Use papercortex_search to browse matches. For exact archive-wide totals, a sample of retrieved excerpts is insufficient.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "question": "<question>"
    },
    "name": "papercortex_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
questionYesQuestion used both to retrieve related excerpts and to generate the answer.
maxDocumentsNoMaximum matching documents to use as evidence. Each contributes up to 2,000 characters of indexed text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / maxDocuments / default
      Added value: +5
    • changedInput schema / properties / maxDocuments / description
      Previous value: -"Maximum documents to include in context (default: 5)"New value: +"Maximum matching documents to use as evidence. Each contributes up to 2,000 characters of indexed text."
    • addedInput schema / properties / maxDocuments / minimum
      Added value: +1
    • changedInput schema / properties / maxDocuments / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / question / description
      Previous value: -"Natural language question about your documents"New value: +"Question used both to retrieve related excerpts and to generate the answer."
    • addedInput schema / properties / question / minLength
      Added value: +1
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint, so safety is covered. The description usefully adds return shape (answer plus source IDs, titles, relevance scores) and the no-match fallback message, but says nothing about the cost, latency, or non-determinism of running a local LLM, which is the main behavioral risk here.

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?

Front-loaded with the purpose, then the return contract, then the routing alternative — a sensible order with no filler. The closing sentence about archive-wide totals is slightly oblique but still earns its place as a misuse guard.

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

Completeness3/5

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

No output schema exists, and the description does cover return values and the empty-result case, which is the biggest gap filled. It leaves out whether the answer is grounded strictly in the retrieved excerpts or can be hallucinated, and nothing about performance, which matters for a generation tool.

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?

Schema coverage is 100% and both parameters are fully documented, so baseline is 3. The description frames the excerpts as 'evidence' for answering, which reinforces intent, but adds no format, syntax, or tuning guidance for 'question' or 'maxDocuments' beyond what the schema states.

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?

Names a specific verb and resource ('Answer a question') plus the mechanism ('Ollama and the closest matching excerpts from the local search index'), and explicitly separates itself from the browsing sibling: 'Use papercortex_search to browse matches.' An agent can pick between them without opening a schema.

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?

Gives a clear routing rule to papercortex_search for browsing, and an implicit exclusion ('For exact archive-wide totals, a sample of retrieved excerpts is insufficient') that steers counting tasks elsewhere. It stops short of saying what to use for exact totals, so the when-not is directional rather than complete.

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