/** * Tool: all_emails * * Retrieves all emails across all Firefox Relay addresses with comprehensive * filtering, pagination, and search capabilities. * * Follows golden-standard programming practices: * - Zod v4 validation for input parameters * - Comprehensive error handling with custom error classes * - Database persistence with PQC encryption at rest * - Pagination support for large datasets * - Audit logging for security and traceability */ import { z } from 'zod/v4'; import { MCPTool, ToolResult } from '../types'; import { RetrievedEmail } from './read_emails'; /** * Schema for validating all_emails tool input */ export declare const AllEmailsInputSchema: z.ZodObject<{ limit: z.ZodDefault>; cursor: z.ZodOptional; extractOtp: z.ZodDefault>; otpOnly: z.ZodDefault>; unreadOnly: z.ZodDefault>; relayAddressId: z.ZodOptional; searchQuery: z.ZodOptional; sortOrder: z.ZodDefault>>; }, z.core.$strip>; /** * Type for validated input */ export type AllEmailsInput = z.infer; /** * Response type for the all_emails tool */ export interface AllEmailsResponse { success: boolean; emails: RetrievedEmail[]; count: number; total: number; page: number; pageSize: number; hasMore: boolean; nextCursor: string | null; previousCursor: string | null; requestId: string; timestamp: string; error?: string; } /** * Custom error for email retrieval failures */ export declare class AllEmailsRetrievalError extends Error { readonly code: string; readonly details?: Record | undefined; constructor(message: string, code?: string, details?: Record | undefined); } /** * Retrieves all emails across all relay addresses * * This function: * 1. Validates input using Zod v4 * 2. Retrieves emails from the database with pagination * 3. Applies filters (OTP only, unread only, relay address, search) * 4. Extracts OTP codes if requested * 5. Performs security analysis on email content * 6. Logs all operations to audit trail * * @param input - Validated input parameters * @param context - MCP tool execution context * @returns Tool result with paginated email results */ export declare function allEmailsHandler(input: unknown, context?: Record): Promise; /** * MCP Tool definition for all_emails */ export declare const allEmailsTool: MCPTool; export default allEmailsTool; //# sourceMappingURL=all_emails.d.ts.map