|
374339a15d
|
🔧 Fix verbose base64 output in image extraction functions
Resolve MCP client context overflow by saving images to files instead of
returning base64-encoded data that fills client message windows.
Key Changes:
• extract_images(): Save images to CACHE_DIR with file paths in response
• pdf_to_markdown(): Save embedded images to files with path references
• Add format_file_size() utility for human-readable file sizes
• Update function descriptions to clarify file-based output
Benefits:
✅ Prevents context message window overflow in MCP clients
✅ Returns clean, concise metadata with file paths
✅ Maintains full image access through saved files
✅ Improves user experience with readable file sizes
✅ Reduces memory usage and response payload sizes
Response Format Changes:
- Remove: "data": "<base64_string>" (verbose)
+ Add: "file_path": "/tmp/mcp-pdf-processing/image.png"
+ Add: "filename": "page_1_image_0.png"
+ Add: "size_bytes": 12345
+ Add: "size_human": "12.1 KB"
This resolves the issue where image extraction caused excessive verbose
output that overwhelmed MCP client interfaces.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-08-20 11:34:42 -06:00 |
|