Skip to main content
Glama
Paperless-NGX MCP Server

Paperless-NGX MCP Server

search_passages

Find full-text matches across Paperless documents and return bounded text passages around each hit, so you can locate and skim evidence without flooding context.

Instructions

Search documents full-text and return bounded text passages around each hit instead of whole documents. The window is anchored on the server's own highlighted phrase (falling back to the LONGEST matching query term, then the document head), so the returned passage contains the actual hit even when stemming matched a word variant. Queries that the server rejects with an HTTP 400 are retried once with a defensively rewritten query (apostrophes and stray quotes removed); such responses carry query_sanitized: true. Returns document id, title, score, offset, content_length, and the highlighted snippet. Use this to locate and skim evidence across many documents without flooding context; page further with get_document_content offsets.

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": {
      "query": "<query>"
    },
    "name": "search_passages"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNo
queryYesFull-text query (same syntax as query_documents).
windowNoCharacters per passage (default 800).
orderingNo
page_sizeNo
max_passagesNoMaximum passages to return (default 5).
storage_pathNo
correspondentNo
document_typeNo
paperless_filtersNo
created__date__gteNo
created__date__lteNo
custom_fields__icontainsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.1
    • changedInput schema / properties / paperless_filters / additionalProperties / anyOf
      Previous value: -[
      -  {
      -    "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

A3.9/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the whole burden, and it discloses unusually valuable internals: window anchoring on the server's highlighted phrase with fallbacks to the longest matching term then the document head, plus a single automatic retry on HTTP 400 with a rewritten query signalled by query_sanitized: true. It does not state that the operation is read-only or describe rate-limit or failure behavior beyond the 400 retry, which keeps it from a 5.

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 dense sentences, front-loaded with purpose before the retrieval mechanics and return fields; nearly every clause carries information. It is slightly heavy in the middle where the anchoring fallback chain is described at length, but nothing is padding.

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 13-parameter, nested-object tool with no annotations and no output schema, the description does well on return fields and server behavior but leaves the large filter surface undocumented. An agent can call it with a query and window but must guess at filtering and paging semantics, so it is adequate rather than complete.

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?

With 13 parameters and only 23% schema description coverage, the description should compensate, but it only adds meaning to the passage window (bounded text around the hit) and hints at offsets. The filter parameters (tag, correspondent, document_type, storage_path, created__date__gte/lte, custom_fields__icontains, paperless_filters), plus ordering and page_size, get no explanation of type, defaults, or interaction anywhere.

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 names a specific verb and resource ('Search documents full-text') and states the distinguishing output shape: 'return bounded text passages around each hit instead of whole documents.' That contrast plus the pointer to get_document_content offsets lets an agent separate it from whole-document retrieval siblings 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?

It gives a concrete selection rule – 'Use this to locate and skim evidence across many documents without flooding context' – and routes follow-up paging to get_document_content offsets. It lacks an explicit statement of when to prefer search_documents or whole-document retrieval instead, so it stops short of full when/when-not guidance.

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