Skip to main content
Glama

search_documents

Search document content, titles, and metadata in your Paperless-NGX instance using a full-text query for precise and comprehensive results.

Instructions

Full text search for documents. This tool is for searching document content, title, and metadata using a full text query. For general document listing or filtering by fields, use 'list_documents' instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • Handler function that executes the 'search_documents' tool logic: checks API, calls PaperlessAPI.searchDocuments with the input query, processes response with convertDocsWithNames, wrapped in error handling.
    withErrorHandling(async (args, extra) => { if (!api) throw new Error("Please configure API connection first"); const docsResponse = await api.searchDocuments(args.query); return convertDocsWithNames(docsResponse, api); })
  • Zod input schema for the tool, defining a required 'query' string parameter.
    { query: z.string(), },
  • MCP tool registration call via server.tool(), including name, description, schema, and handler for 'search_documents'.
    server.tool( "search_documents", "Full text search for documents. This tool is for searching document content, title, and metadata using a full text query. For general document listing or filtering by fields, use 'list_documents' instead.", { query: z.string(), }, withErrorHandling(async (args, extra) => { if (!api) throw new Error("Please configure API connection first"); const docsResponse = await api.searchDocuments(args.query); return convertDocsWithNames(docsResponse, api); }) );
  • Core helper method in PaperlessAPI class that performs the HTTP request to the Paperless-ngx API endpoint /documents/?query=... to retrieve search results.
    async searchDocuments(query: string): Promise<DocumentsResponse> { const response = await this.request<DocumentsResponse>( `/documents/?query=${encodeURIComponent(query)}` ); return response; }
  • src/index.ts:69-69 (registration)
    Top-level call to register all document tools, including 'search_documents', on the MCP server instance.
    registerDocumentTools(server, api);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baruchiro/paperless-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server