Skip to main content
Glama
mcp-server-paperless

mcp-server-paperless

Upload document

upload_document

Upload a base64-encoded file to Paperless as a new document, set metadata by name, and optionally wait for Paperless to return the document ID or task ID.

Instructions

Upload a file, sent as base64 content, to Paperless as a new document. The type comes from the content, not the name: PDF, images, plain text and CSV (Office, OpenDocument and RTF only if Paperless runs Tika). Metadata is given by name as in search_documents; an unknown name is an error and nothing is uploaded; tags are never created. Paperless consumes the file later: the result holds the task_id and, with wait_seconds, the new document_id and web_url; a problem found only then (a taken archive serial number) shows as state failure. Each call adds a document, also for content Paperless already holds (no duplicate check).

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": {
      "content_base64": "<content_base64>",
      "filename": "<filename>"
    },
    "name": "upload_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoTag names or ids; they must exist (none is created).
titleNoTitle (at most 128 characters); default: the file name without extension.
createdNoCreation date (YYYY-MM-DD); default: Paperless reads it.
filenameYesThe file's name, e.g. 'Rechnung März.pdf'. Directories are dropped, other characters (non-ASCII too) are kept; Paperless keeps it as the original name.
storage_pathNoName or id; see list_taxonomy.
wait_secondsNoWait up to this many seconds for Paperless to consume the file and return the new document_id; more than 30 is cut to 30. 0 returns the task id at once; follow it with get_task.
correspondentNoName or id; see list_taxonomy.
custom_fieldsNoCustom field values keyed by field name or id. Values by data type: string/longtext text; url with scheme; date 'YYYY-MM-DD'; boolean true/false; integer; float; monetary 'EUR12.50' (or 12.5); documentlink a list of document ids; select the option's label.
document_typeNoName or id; see list_taxonomy.
content_base64YesThe file's bytes as standard base64 (RFC 4648) on one line, without a data: prefix. The server refuses files over its size limit (10 MiB by default).
archive_serial_numberNoArchive serial number; it must be unused.

Output Schema

NameRequiredDescriptionDefault
waitYesnot_requested: wait_seconds was 0; finished: consumption ended within the wait (see state); timed_out: still running, ask get_task later.
stateYespending, started, success, failure or revoked; unknown when the task could not be read after the upload (e.g. this user may not view tasks): the upload was accepted all the same.
messageYesWhy consumption failed, or why the state is unknown.
task_idYesFollow it with get_task; Paperless consumes later.
web_urlYesLink to the new document, once known.
filenameYesThe name the file was uploaded under.
mime_typeYesThe type found in the content.
size_bytesYes
document_idYesThe new document once consumption succeeded; else null.
waited_secondsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.2

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already declare this is a non-readonly, non-destructive, non-idempotent write, and the description correctly reinforces the non-idempotency ('each call adds a document ... no duplicate check'). It adds genuine behavioral context beyond annotations: Paperless consumes the file asynchronously, the result carries a task_id which resolves to document_id and web_url only with wait_seconds, and a late conflict such as a taken archive serial number surfaces as state failure. It stops short of stating what happens to the task if consumption fails permanently.

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 action and resource, then layered: format rules, metadata rules, async behavior, duplicate caveat. Every sentence carries information, though the middle 'Paperless consumes the file later' passage is syntactically dense and could be split for faster scanning.

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

Completeness5/5

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

For an 11-parameter mutation tool with an output schema, the description covers the parts an agent must reason about: type inference, metadata-by-name resolution and failure semantics, asynchronous task handling, and non-idempotency. Return-value shape is referenced only to the extent needed to explain wait_seconds behavior, leaving detail to the output schema.

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

Parameters4/5

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

Schema description coverage is 100%, so parameters are already documented; the description still adds meaning the schema cannot, notably that the accepted format is determined by content rather than filename (with the Tika caveat for Office/OpenDocument/RTF) and that metadata names behave as in search_documents. It does not restate wait_seconds truncation or base64 rules, which the schema already covers.

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 concrete verb and resource ('Upload a file ... to Paperless as a new document') and immediately distinguishes itself from near-siblings by explaining that the document type is derived from content, not the filename. An agent can tell this apart from download_document, update_document and search_documents without opening any 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 strong situational context: metadata is given by name as in search_documents, an unknown name aborts the upload, tags are never created, and there is no duplicate check so repeat uploads still add documents. It also routes the async case to the get_task sibling when wait_seconds is 0. What it lacks is an explicit 'do not use this when...' exclusion naming an alternative tool for an existing document.

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