MCP server for extracting text, images, tables, links, annotations, and metadata from PDF files
Three tools with complete schemas and detailed descriptions in Chinese. All parameters have types and descriptions. Output schemas are documented in descriptions. However, descriptions are verbose (200-400+ chars, exceeding the 10-1024 baseline sweet spot of 50-200), and error handling lacks recovery guidance. No tool annotations (readOnlyHint, destructiveHint, idempotentHint). Parameter descriptions are functional but could be more concise. All tools are read-only file operations with no destructive risk, which is a strength.
获取PDF文件的基本信息。 Args: file_path: PDF文件的完整路径 Returns: 包含以下信息的字典: - page_count: 页数 - title: 标题 - author: 作者 - subject: 主题 - creator: 创建程序 - producer: 生成程序 - creation_date: 创建日期 - modification_date: 修改日期 - file_size: 文件大小(字节) - file_size_mb: 文件大小(MB) - is_encrypted: 是否加密
将PDF页面转换为图片(base64编码)返回。适合需要保留原始排版、图表、公式的场景。 Args: file_path: PDF文件的完整路径 pages: 要读取的页码,支持多种格式: - 不传或"all": 所有页面 - "1": 单页 - "1-5": 页码范围 - "1-": 从第1页到末尾 - "-5": 从开头到第5页 - "1,3,5": 指定多页 - "1-3,5,7-9": 混合格式 dpi: 图片分辨率,默认150。72=低质量小文件,150=平衡,300=高清大文件 image_format: 图片格式,"jpeg"(默认,文件小)或"png"(无损,文件大) quality: JPEG压缩质量(1-100),默认85。仅对jpeg格式有效,值越低文件越小但质量越差 max_total_bytes_mb: 单次调用允许返回的最大图片负载(MB),默认20 Returns: 图片列表,每个元素包含: - page_number: 页码(从1开始) - image_base64: 图片的base64编码 - width: 图片宽度(像素) - height: 图片高度(像素) - format: 图片格式 - truncated: 是否因大小限制被截断 - warning: 截断或限制提示(可选)
提取PDF的文本内容。适合纯文本PDF,速度快,消耗token少。 注意:对于扫描版PDF(图片PDF),此方法可能无法提取文本,建议使用read_pdf_as_images。 Args: file_path: PDF文件的完整路径 pages: 要读取的页码,支持多种格式: - 不传或"all": 所有页面 - "1": 单页 - "1-5": 页码范围 - "1-": 从第1页到末尾 - "-5": 从开头到第5页 - "1,3,5": 指定多页 - "1-3,5,7-9": 混合格式 max_pages: 单次调用最多返回的页数,默认50 max_chars: 单次调用最多返回的总字符数,默认200000 Returns: 包含以下信息的字典: - total_pages: 总页数 - extracted_pages: 提取的页码列表 - pages: 每页内容列表,包含page_number和text - full_text: 所有页面的合并文本 - warning: 警告信息(如检测到可能是扫描版PDF或结果被截断)
Descriptions are verbose (200-400+ chars) and written in Chinese, reducing LLM clarity. Baseline sweet spot is 50-200 chars in English. Descriptions should be concise and language-agnostic.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) present. All three tools are read-only and idempotent, these should be declared via annotations for agent safety.
Error handling lacks recovery guidance. FileNotFoundError, ValueError, and encrypted PDF errors are raised but do not suggest next steps (e.g., 'Try checking the file path' or 'Use an unencrypted PDF').
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | 2026-07-28+ | v2 |
Parameter 'pages' accepts free-form strings with complex parsing logic (ranges, lists, mixed formats). No enum or strict format constraint. LLMs may pass invalid formats like '1-2-3' or 'all-pages'.
read_pdf_as_images caps at 20 pages with a hard error. No graceful degradation or pagination guidance. LLMs cannot request pages 21-40 without restructuring the call.