@baruchiro/paperless-mcp
Version:
Model Context Protocol (MCP) server for interacting with Paperless-NGX document management system. Enables AI assistants to manage documents, tags, correspondents, and document types through the Paperless-NGX API.
72 lines (71 loc) • 5.99 kB
TypeScript
import { z } from "zod";
declare const CUSTOM_FIELD_QUERY_GROUP_OPERATORS: readonly ["AND", "OR"];
export type CustomFieldQueryValue = string | number | boolean | null | Array<string | number | boolean | null>;
export type CustomFieldQuery = [fieldNameOrId: string | number, operator: string, value: CustomFieldQueryValue] | [
groupOperator: (typeof CUSTOM_FIELD_QUERY_GROUP_OPERATORS)[number],
clauses: CustomFieldQuery[]
];
export declare const customFieldQuerySchema: z.ZodType<CustomFieldQuery>;
export declare const paperlessFilterValueSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">]>;
export declare const paperlessFiltersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">]>>;
export declare const LIST_DOCUMENTS_ARGS_SHAPE: {
custom_field_query: z.ZodOptional<z.ZodString>;
page: z.ZodOptional<z.ZodNumber>;
page_size: z.ZodOptional<z.ZodNumber>;
search: z.ZodOptional<z.ZodString>;
correspondent: z.ZodOptional<z.ZodNumber>;
document_type: z.ZodOptional<z.ZodNumber>;
tag: z.ZodOptional<z.ZodNumber>;
storage_path: z.ZodOptional<z.ZodNumber>;
created__date__gte: z.ZodOptional<z.ZodString>;
created__date__lte: z.ZodOptional<z.ZodString>;
ordering: z.ZodOptional<z.ZodString>;
archive_serial_number: z.ZodOptional<z.ZodNumber>;
archive_serial_number__isnull: z.ZodOptional<z.ZodBoolean>;
custom_fields__icontains: z.ZodOptional<z.ZodString>;
};
export declare const QUERY_DOCUMENTS_ARGS_SHAPE: {
query: z.ZodOptional<z.ZodString>;
more_like_id: z.ZodOptional<z.ZodNumber>;
custom_field_query: z.ZodOptional<z.ZodType<CustomFieldQuery, z.ZodTypeDef, CustomFieldQuery>>;
paperless_filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">]>>>;
page: z.ZodOptional<z.ZodNumber>;
page_size: z.ZodOptional<z.ZodNumber>;
search: z.ZodOptional<z.ZodString>;
correspondent: z.ZodOptional<z.ZodNumber>;
document_type: z.ZodOptional<z.ZodNumber>;
tag: z.ZodOptional<z.ZodNumber>;
storage_path: z.ZodOptional<z.ZodNumber>;
created__date__gte: z.ZodOptional<z.ZodString>;
created__date__lte: z.ZodOptional<z.ZodString>;
ordering: z.ZodOptional<z.ZodString>;
archive_serial_number: z.ZodOptional<z.ZodNumber>;
archive_serial_number__isnull: z.ZodOptional<z.ZodBoolean>;
custom_fields__icontains: z.ZodOptional<z.ZodString>;
};
export declare const SEARCH_DOCUMENTS_ARGS_SHAPE: {
query: z.ZodString;
};
export type PaperlessFilterValue = z.infer<typeof paperlessFilterValueSchema>;
export type BuildDocumentQueryArgs = {
page?: number;
page_size?: number;
ordering?: string;
query?: string;
search?: string;
more_like_id?: number;
correspondent?: number;
document_type?: number;
tag?: number;
storage_path?: number;
created__date__gte?: string;
created__date__lte?: string;
archive_serial_number?: number;
archive_serial_number__isnull?: boolean;
custom_field_query?: string | CustomFieldQuery;
custom_fields__icontains?: string;
paperless_filters?: Record<string, PaperlessFilterValue>;
};
export declare const DOCUMENT_QUERY_PAPERLESS_FILTER_KEYS: readonly ["added__date__gt", "added__date__gte", "added__date__lt", "added__date__lte", "added__day", "added__gt", "added__gte", "added__lt", "added__lte", "added__month", "added__year", "archive_serial_number", "archive_serial_number__gt", "archive_serial_number__gte", "archive_serial_number__isnull", "archive_serial_number__lt", "archive_serial_number__lte", "checksum__icontains", "checksum__iendswith", "checksum__iexact", "checksum__istartswith", "content__icontains", "content__iendswith", "content__iexact", "content__istartswith", "correspondent__id", "correspondent__id__in", "correspondent__id__none", "correspondent__isnull", "correspondent__name__icontains", "correspondent__name__iendswith", "correspondent__name__iexact", "correspondent__name__istartswith", "created__date__gt", "created__date__gte", "created__date__lt", "created__date__lte", "created__day", "created__gt", "created__gte", "created__lt", "created__lte", "created__month", "created__year", "custom_field_query", "custom_fields__icontains", "custom_fields__id__all", "custom_fields__id__in", "custom_fields__id__none", "document_type__id", "document_type__id__in", "document_type__id__none", "document_type__isnull", "document_type__name__icontains", "document_type__name__iendswith", "document_type__name__iexact", "document_type__name__istartswith", "fields", "full_perms", "has_custom_fields", "id", "id__in", "is_in_inbox", "is_tagged", "mime_type", "modified__date__gt", "modified__date__gte", "modified__date__lt", "modified__date__lte", "modified__day", "modified__gt", "modified__gte", "modified__lt", "modified__lte", "modified__month", "modified__year", "ordering", "original_filename__icontains", "original_filename__iendswith", "original_filename__iexact", "original_filename__istartswith", "owner__id", "owner__id__in", "owner__id__none", "owner__isnull", "page", "page_size", "query", "search", "shared_by__id", "storage_path__id", "storage_path__id__in", "storage_path__id__none", "storage_path__isnull", "storage_path__name__icontains", "storage_path__name__iendswith", "storage_path__name__iexact", "storage_path__name__istartswith", "tags__id", "tags__id__all", "tags__id__in", "tags__id__none", "tags__name__icontains", "tags__name__iendswith", "tags__name__iexact", "tags__name__istartswith", "title__icontains", "title__iendswith", "title__iexact", "title__istartswith", "title_content"];
export declare function buildDocumentQueryString(args: BuildDocumentQueryArgs): string;
export {};