Skip to main content
Glama
Paperless-NGX MCP Server

Paperless-NGX MCP Server

query_documents

Search Paperless-NGX documents with full-text queries and structured filters, including grouped custom field conditions; retrieve document text separately when needed.

Instructions

Query documents using the full-text query engine plus structured Paperless filters. Use this for complex filtering, custom field conditions, or any documented /api/documents/ query parameters that are not exposed as first-class arguments. Prefer the dedicated top-level arguments where available. custom_field_query supports [field_name_or_id, operator, value] leaves or ['AND'|'OR', [clause1, clause2]] groups. Note: Document content is excluded from results by default. Use 'get_document_content' when you need the document text.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "query_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNo
pageNo
queryNo
searchNo
orderingNo
page_sizeNo
more_like_idNo
storage_pathNo
correspondentNo
document_typeNo
paperless_filtersNoAdditional documented /api/documents/ Paperless filters. Keys must match Paperless query parameter names exactly. Prefer first-class arguments when available.
created__date__gteNo
created__date__lteNo
custom_field_queryNoPaperless custom field query. Use [field_name_or_id, operator, value] for a single clause or ['AND'|'OR', [clause1, clause2]] for grouped clauses.
archive_serial_numberNo
custom_fields__icontainsNo
archive_serial_number__isnullNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.1
    • changedInput schema / properties / paperless_filters / additionalProperties / anyOf
      Previous value: -[
      -  {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "number"
      -      },
      -      {
      -        "type": "boolean"
      -      }
      -    ]
      -  },
      -  {
      -    "items": {
      -      "anyOf": [
      -        {
      -          "type": "string"
      -        },
      -        {
      -          "type": "number"
      -        },
      -        {
      -          "type": "boolean"
      -        }
      -      ]
      -    },
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "anyOf": [
      +      {
      +        "maxLength": 1024,
      +        "type": "string"
      +      },
      +      {
      +        "type": "number"
      +      },
      +      {
      +        "type": "boolean"
      +      }
      +    ]
      +  },
      +  {
      +    "items": {
      +      "anyOf": [
      +        {
      +          "maxLength": 1024,
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        }
      +      ]
      +    },
      +    "maxItems": 500,
      +    "type": "array"
      +  }
      +]
  2. First observedv2.2.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose two useful traits: results exclude document content by default, and the tool passes through to the Paperless /api/documents/ API. It says nothing about pagination, result ordering, or the read-only/scale characteristics of a query over a large document set.

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?

Four sentences, front-loaded with the primary use case, with the most important caveat (content excluded) placed last where it is still likely to be read. The custom_field_query sentence largely restates the schema but the syntax example is non-trivial enough to justify the space.

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?

For a 17-parameter, nested-object tool with no annotations and no output schema, the description covers the conceptual model (structured filters plus a raw filter passthrough) and the content-exclusion caveat. It is thin on how the many first-class arguments behave and what a result record contains, which matters given the schema does little of that work.

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

Parameters2/5

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

Schema description coverage is only 12% across 17 parameters, so the description must compensate and largely does not. Only custom_field_query gets real explanation (and that duplicates the schema's own description); the critical ambiguity between `query` and `search`, plus page/page_size paging, ordering, more_like_id, storage_path, and the __isnull/__gte filters, are left entirely undocumented.

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 names a specific verb and resource ("Query documents") and scopes it to the full-text engine plus structured Paperless filters. It carves out a niche (complex filtering, custom fields, raw /api/documents/ params), though it never explicitly contrasts itself with the list_documents/search_documents siblings, so an agent must infer that boundary.

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?

It gives a clear positive trigger (complex filtering, custom field conditions, unexposed query params) and an explicit exclusion: "Prefer the dedicated top-level arguments where available." It also routes to get_document_content when document text is needed. Missing is any stated rule for choosing between this and the sibling search_documents/list_documents tools.

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