Skip to main content
Glama
Paperless-NGX MCP Server

Paperless-NGX MCP Server

search_passages

Search documents full-text and return bounded passages around each hit. Locate and skim evidence across many documents without flooding context, then page further using returned offsets.

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 first verbatim 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.

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. First observedv2.2.1

TDQS

A4.1/5.0
Behavior5/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 does so: it discloses window anchoring logic and the fallback chain ('highlighted phrase, falling back to the first verbatim term, then the document head'), a retry-on-HTTP-400 behavior with defensively rewritten queries, and the resulting 'query_sanitized: true' signal. These are non-obvious behaviors an agent could not infer from the schema.

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 core purpose, then behavior, edge case, return shape, and usage in a logical progression; each sentence carries distinct information. It is dense but not padded, though the retry/sanitization sentence is niche relative to the length it occupies.

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?

Return fields are enumerated despite no output schema, and the passage-windowing behavior is fully explained, which covers what an agent needs to interpret results. However, for a 13-parameter tool with a nested object and no annotations, roughly ten filter parameters are left undocumented anywhere, leaving real gaps.

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 23% across 13 parameters, so the description must compensate and largely does not — tag, ordering, page_size, storage_path, correspondent, document_type, paperless_filters, both date bounds, and custom_fields__icontains are unexplained. It does add meaning for 'window' by explaining the anchoring that determines passage content, but that is one of many undocumented parameters, including a free-form nested paperless_filters object.

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?

States a specific verb and resource ('Search documents full-text') and immediately distinguishes itself from whole-document retrieval ('return bounded text passages around each hit instead of whole documents'). An agent can tell this apart from search_documents/query_documents by output shape without opening the 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 an explicit use case ('locate and skim evidence across many documents without flooding context') and names the follow-up path ('page further with get_document_content offsets'). It stops short of an explicit when-not rule against the sibling search_documents or query_documents, so the boundary is implied rather than stated.

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