/** * ┌─────────────────────────────────────────────────────────────────────────┐ * │ COUNT PDF PAGES TOOL - MCP Tool Implementation │ * ├─────────────────────────────────────────────────────────────────────────┤ * │ Filename: count-pages.tool.ts │ * │ Language: TypeScript │ * │ MCP Server: PDF Operations Server │ * │ │ * │ Purpose: │ * │ Implements an MCP tool that counts the total number of pages in a │ * │ PDF file. Provides quick page count without full text extraction. │ * │ │ * │ Why this tool exists: │ * │ - Enables AI to quickly determine PDF length │ * │ - Useful for estimating processing time │ * │ - Helps decide whether to process entire document │ * │ - Foundation for page-range based operations │ * │ │ * │ MCP Tool Information: │ * │ Tool Name: count-pdf-pages │ * │ Category: pdf-operations │ * │ Input: { filePath: string } │ * │ Output: { pageCount: number, filePath: string } │ * │ │ * │ Dependencies: │ * │ - @modelcontextprotocol/sdk: MCP server SDK │ * │ - zod: Input validation and schema definition │ * │ - ../utils/pdf-utils: PDF parsing and validation │ * │ │ * │ Author: PDF MCP Team │ * │ Created: 2025-10-29 │ * │ Version: 1.0.0 │ * └─────────────────────────────────────────────────────────────────────────┘ */ import { z } from 'zod'; import type { PageCountResult } from '../types.js'; /** * Zod schema for count-pdf-pages tool input validation */ export declare const CountPagesInputSchema: { filePath: z.ZodString; }; /** * Zod schema for count-pdf-pages tool output */ export declare const CountPagesOutputSchema: { pageCount: z.ZodNumber; filePath: z.ZodString; }; /** * Counts the total number of pages in a PDF file * * @param filePath - Path to the PDF file * @returns Object containing page count and file path * @throws Error if file cannot be read or is not a valid PDF */ export declare function countPDFPages(filePath: string): Promise; /** * Tool handler for count-pdf-pages * Formats the result for MCP protocol */ export declare const countPagesToolHandler: ({ filePath }: { filePath: string; }) => Promise<{ content: { type: "text"; text: string; }[]; structuredContent: PageCountResult; }>; //# sourceMappingURL=count-pages.tool.d.ts.map