Documentation
¶
Index ¶
- type PDFRequest
- type PDFResponse
- type PDFTool
- func (t *PDFTool) Definition() mcp.Tool
- func (t *PDFTool) Execute(ctx context.Context, logger *logrus.Logger, cache *sync.Map, ...) (*mcp.CallToolResult, error)
- func (t *PDFTool) ExtractTextFromPDFOperation(operation string) []string
- func (t *PDFTool) ParsePageSelection(pages string, maxPage int) ([]int, error)
- func (t *PDFTool) ParseRequest(args map[string]interface{}) (*PDFRequest, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PDFRequest ¶
type PDFRequest struct {
// FilePath is the absolute path to the PDF file to process
FilePath string `json:"file_path"`
// OutputDir is the directory where markdown and images will be saved
OutputDir string `json:"output_dir"`
// ExtractImages indicates whether to extract images from the PDF
ExtractImages bool `json:"extract_images"`
// Pages specifies which pages to process (e.g., "1-5", "1,3,5", "all")
Pages string `json:"pages"`
}
PDFRequest represents a request to process a PDF file
type PDFResponse ¶
type PDFResponse struct {
// FilePath is the original PDF file that was processed
FilePath string `json:"file_path"`
// MarkdownFile is the path to the generated markdown file
MarkdownFile string `json:"markdown_file"`
// ExtractedImages is a list of extracted image file paths
ExtractedImages []string `json:"extracted_images"`
// PagesProcessed is the number of pages that were processed
PagesProcessed int `json:"pages_processed"`
// TotalPages is the total number of pages in the PDF
TotalPages int `json:"total_pages"`
// OutputDir is the directory where files were saved
OutputDir string `json:"output_dir"`
}
PDFResponse represents the result of PDF processing
type PDFTool ¶
type PDFTool struct{}
PDFTool implements PDF processing with pdfcpu
func (*PDFTool) Definition ¶
Definition returns the tool's definition for MCP registration
func (*PDFTool) Execute ¶
func (t *PDFTool) Execute(ctx context.Context, logger *logrus.Logger, cache *sync.Map, args map[string]interface{}) (*mcp.CallToolResult, error)
Execute processes the PDF file
func (*PDFTool) ExtractTextFromPDFOperation ¶ added in v0.18.0
ExtractTextFromPDFOperation extracts all text strings from a PDF operation line
func (*PDFTool) ParsePageSelection ¶ added in v0.18.0
ParsePageSelection parses page selection string into a slice of page numbers
func (*PDFTool) ParseRequest ¶ added in v0.18.0
func (t *PDFTool) ParseRequest(args map[string]interface{}) (*PDFRequest, error)
ParseRequest parses and validates the tool arguments
Click to show internal directories.
Click to hide internal directories.