/** * ┌─────────────────────────────────────────────────────────────────────────┐ * │ SUMMARIZE PDF TOOL - MCP Tool Implementation │ * ├─────────────────────────────────────────────────────────────────────────┤ * │ Filename: summarize-pdf.tool.ts │ * │ Language: TypeScript │ * │ MCP Server: PDF Operations Server │ * │ │ * │ Purpose: │ * │ Implements an MCP tool that summarizes PDF content using LLM │ * │ sampling. Extracts text from PDF and generates a concise summary │ * │ of the main points and key information. │ * │ │ * │ Why this tool exists: │ * │ - Provides quick overview of lengthy PDF documents │ * │ - Saves time by condensing information │ * │ - Enables AI to understand PDF context efficiently │ * │ - Useful for document triage and prioritization │ * │ │ * │ MCP Tool Information: │ * │ Tool Name: summarize-pdf │ * │ Category: pdf-operations │ * │ Input: { filePath: string, maxTokens?: number } │ * │ Output: { summary: string, pageCount, originalLength, ... } │ * │ │ * │ Dependencies: │ * │ - @modelcontextprotocol/sdk: MCP server SDK (for LLM sampling) │ * │ - zod: Input validation and schema definition │ * │ - ../utils/pdf-utils: PDF text extraction │ * │ │ * │ Note: │ * │ This tool uses MCP sampling to call the LLM. The client must │ * │ support the sampling feature for this to work. │ * │ │ * │ Author: PDF MCP Team │ * │ Created: 2025-10-29 │ * │ Version: 1.0.0 │ * └─────────────────────────────────────────────────────────────────────────┘ */ import { z } from 'zod'; import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { SummaryResult } from '../types.js'; /** * Zod schema for summarize-pdf tool input validation */ export declare const SummarizePDFInputSchema: { filePath: z.ZodString; maxTokens: z.ZodOptional; }; /** * Zod schema for summarize-pdf tool output */ export declare const SummarizePDFOutputSchema: { summary: z.ZodString; pageCount: z.ZodNumber; originalLength: z.ZodNumber; summaryLength: z.ZodNumber; filePath: z.ZodString; }; /** * Summarizes PDF content using LLM sampling * * @param filePath - Path to the PDF file * @param mcpServer - MCP server instance for LLM sampling * @param maxTokens - Maximum tokens for summary (default: 500) * @returns Object containing summary and metadata * @throws Error if file cannot be read or LLM sampling fails */ export declare function summarizePDF(filePath: string, mcpServer: McpServer, maxTokens?: number): Promise; /** * Creates tool handler for summarize-pdf * * @param mcpServer - MCP server instance for LLM sampling * @returns Tool handler function */ export declare const createSummarizePDFToolHandler: (mcpServer: McpServer) => ({ filePath, maxTokens }: { filePath: string; maxTokens?: number | undefined; }) => Promise<{ content: { type: "text"; text: string; }[]; structuredContent: SummaryResult; }>; //# sourceMappingURL=summarize-pdf.tool.d.ts.map