Skip to main content
Glama

query_documents

Query Paperless documents using full-text search and structured filters, including custom fields and documented API parameters for complex retrieval.

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.

Input Schema

TableJSON 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. Addedv2.2.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations the description carries the full burden, and it does disclose one important behavior (document content is excluded by default) plus the custom_field_query grammar. It omits pagination behavior, result shape, and auth/permission requirements, so significant behavioral ground is left uncovered.

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?

Purpose is front-loaded, followed by usage, syntax detail, and a closing caveat. Sentences are dense and mostly earn their place, though the two 'prefer top-level arguments' statements feel slightly redundant.

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 purpose, usage, one behavioral caveat, and query grammar. It still leaves the majority of the parameters and the pagination/return behavior unexplained, so it is adequate but incomplete.

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 description coverage is only 12% across 17 parameters, so the description must compensate. It explains custom_field_query leaf/group syntax and paperless_filters purpose well, but the many first-class args (tag, correspondent, document_type, ordering, page_size, date bounds) remain undocumented in both schema and description.

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?

States a specific verb+resource ('Query documents') and scopes it to the full-text engine plus structured Paperless filters, routing the agent to get_document_content for text. It does not, however, differentiate itself from the very similar siblings list_documents and search_documents.

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?

Explicitly says to use it for complex filtering, custom field conditions, and undocumented /api/documents/ parameters, and to prefer dedicated top-level arguments when available. It lacks any exclusion against the closest alternatives (search_documents, list_documents), leaving the primary routing decision to inference.

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