/** * ┌─────────────────────────────────────────────────────────────────────────┐ * │ ADD HEADER/FOOTER TOOL - MCP Tool Implementation │ * ├─────────────────────────────────────────────────────────────────────────┤ * │ Filename: add-header-footer.tool.ts │ * │ Language: TypeScript │ * │ MCP Server: PDF Operations Server │ * │ │ * │ Purpose: │ * │ Implements an MCP tool that adds headers and/or footers to PDF files. │ * │ Supports dynamic variables like page numbers, dates, and titles. │ * │ Optimized for large PDFs (300+ pages). │ * │ │ * │ Why this tool exists: │ * │ - Enables AI to add professional headers/footers to PDFs │ * │ - Supports document organization and navigation │ * │ - Provides dynamic content with variable substitution │ * │ - Handles large PDFs efficiently with batch processing │ * │ │ * │ MCP Tool Information: │ * │ Tool Name: add-pdf-header-footer │ * │ Category: pdf-operations │ * │ Input: { filePath, headerText, footerText, alignment, fontSize, │ * │ color, margin, pageRange, outputPath, useBatchProcessing } │ * │ Output: { outputPath, pagesProcessed, originalPath, config } │ * │ │ * │ Features: │ * │ - Dynamic variables: {page}, {totalPages}, {date}, {title} │ * │ - Alignment options: left, center, right │ * │ - Custom colors using RGB values (0-1 range) │ * │ - Page range support (apply to specific pages or all) │ * │ - Margin control │ * │ - Batch processing for large PDFs (optional) │ * │ │ * │ Dependencies: │ * │ - @modelcontextprotocol/sdk: MCP server SDK │ * │ - zod: Input validation and schema definition │ * │ - ../utils/header-footer-utils: Header/footer processing functions │ * │ │ * │ Author: PDF MCP Team │ * │ Created: 2025-10-29 │ * │ Version: 1.0.0 │ * └─────────────────────────────────────────────────────────────────────────┘ */ import { z } from 'zod'; import type { HeaderFooterResult } from '../types.js'; /** * Zod schema for add-pdf-header-footer tool input validation * Uses object shape (not z.object()) for MCP protocol compatibility */ export declare const AddHeaderFooterInputSchema: { filePath: z.ZodString; headerText: z.ZodOptional; footerText: z.ZodOptional; alignment: z.ZodOptional>; fontSize: z.ZodOptional; font: z.ZodOptional; style: z.ZodOptional; color: z.ZodOptional>; margin: z.ZodOptional; startPage: z.ZodOptional; endPage: z.ZodOptional; outputPath: z.ZodOptional; useBatchProcessing: z.ZodOptional; }; /** * Zod schema for add-pdf-header-footer tool output * Uses object shape (not z.object()) for MCP protocol compatibility */ export declare const AddHeaderFooterOutputSchema: { outputPath: z.ZodString; pagesProcessed: z.ZodNumber; originalPath: z.ZodString; config: z.ZodObject<{ headerText: z.ZodOptional; footerText: z.ZodOptional; alignment: z.ZodOptional; fontSize: z.ZodOptional; font: z.ZodOptional; style: z.ZodOptional; color: z.ZodOptional>; margin: z.ZodOptional; startPage: z.ZodOptional; endPage: z.ZodOptional; }, "strip", z.ZodTypeAny, { fontSize?: number | undefined; color?: { r: number; g: number; b: number; } | undefined; margin?: number | undefined; font?: string | undefined; style?: string | undefined; headerText?: string | undefined; footerText?: string | undefined; alignment?: string | undefined; startPage?: number | undefined; endPage?: number | undefined; }, { fontSize?: number | undefined; color?: { r: number; g: number; b: number; } | undefined; margin?: number | undefined; font?: string | undefined; style?: string | undefined; headerText?: string | undefined; footerText?: string | undefined; alignment?: string | undefined; startPage?: number | undefined; endPage?: number | undefined; }>; }; /** * Adds headers and/or footers to a PDF file * * @param params - Header/footer configuration parameters * @returns Object containing output path, pages processed, and configuration * @throws Error if file cannot be processed */ export declare function addHeaderFooter(params: { filePath: string; headerText?: string | undefined; footerText?: string | undefined; alignment?: 'left' | 'center' | 'right' | undefined; fontSize?: number | undefined; font?: string | undefined; style?: string | undefined; color?: { r: number; g: number; b: number; } | undefined; margin?: number | undefined; startPage?: number | undefined; endPage?: number | undefined; outputPath?: string | undefined; useBatchProcessing?: boolean | undefined; }): Promise; /** * Tool handler for add-pdf-header-footer * Formats the result for MCP protocol with base64-encoded file for download */ export declare const addHeaderFooterToolHandler: (params: { filePath: string; headerText?: string | undefined; footerText?: string | undefined; alignment?: "left" | "center" | "right" | undefined; fontSize?: number | undefined; color?: { r: number; g: number; b: number; } | undefined; margin?: number | undefined; startPage?: number | undefined; endPage?: number | undefined; outputPath?: string | undefined; useBatchProcessing?: boolean | undefined; }) => Promise<{ content: ({ type: "text"; text: string; resource?: never; } | { type: "resource"; resource: { uri: string; mimeType: string; text: string; }; text?: never; })[]; structuredContent: HeaderFooterResult; }>; //# sourceMappingURL=add-header-footer.tool.d.ts.map