Repository navigation
v0.1.3
v0.1.3
Internal refactor for code reuse, code quality, and efficiency, plus
a new triage_inbox prompt and a small set of efficiency wins. No
breaking changes — all existing tools accept the same arguments and
return the same response shapes as v0.1.2.
New
- triage_inbox prompt: an MCP prompt that walks an LLM agent
through reviewing the Paperless inbox, proposing
correspondent / document type / tag metadata that prefers existing
items, and gating execution on explicit user confirmation before
any writes.
Changed
- Heavy deduplication across tool files: shared zod field schemas
(pagination, name filters, matching algorithm, permissions),
shared helpers for confirmation guards / "deleted" responses /
Content-Disposition parsing, and aregisterBulkEditToolfactory
that collapses three near-identical bulk-edit registrations. list_documents,search_autocomplete, andlist_tasksnow
build query strings via the shared helper instead of hand-rolling
URLSearchParams.PaperlessAPI.request<T>defaults tounknowninstead ofany;
bulkEditObjectsgained proper type annotations;postDocument
metadata is typed; unreachable axios status checks removed.documentEnhancer.tsdeduplicated against the shared
CustomFieldInstancetype, dead null-input branch removed,
two-pass map collapsed to one.post_documentswitched from synchronousfs.readFileSyncto
fs.promises.readFileand tightened base64 validation.- Section-divider and dead inline comments removed across the
codebase; ~50 deadif (!api) throwguards deleted from tool
handlers.
Performance
fetchAllPagesparallelizes pages 2..N when the result set
exceeds one page (Math.ceil(count / 100)pages issued via
Promise.all). Sequential fallback preserved for small or
count-less responses.convertDocsWithNamesnow skips fetching correspondents /
document types / tags / custom fields when no document in the
response references that entity type. Aget_documenton a
thin record can drop from 4 metadata calls to 0.
Internal
- New shared helpers in
src/tools/utils:schemas.ts,
responses.ts,bulkEdit.ts,listFilter.ts. - Net diff vs v0.1.2: ~800 lines removed, ~350 added.