Convert PDF files to images with optional HTTP file server upload
Both tools have input schemas with proper JSON Schema structure and type definitions. However, descriptions are in Chinese and lack clarity on when/why to use each tool. Parameter descriptions exist but are minimal. No output schema is documented. Tool names lack clear verb-noun structure ('convert_pdfs' vs 'convert_pdf' is confusing, both do conversion, differ only in scope). Critical issues: no error handling guidance, no pagination support despite batch operations, no security considerations for file operations, and the format_output() function is broken (references undefined 'json' and 'r' variables). The server exposes HTTP file server URLs and concurrency settings as configuration rather than securing them.
将单个 PDF 文件转换为与该 PDF 同名的图片,并将这些图片保存到指定目录。 参数: pdf_name (str): 要转换的 PDF 文件的名称。 return_pic_url (bool): 是否上传图片到http 文件服务器,并返回图片的URL。默认为True。 返回: dict[str, Any]: 包含输出目录相对路径的字典。
将文件夹下(包括子文件夹)的所有 PDF 文件转换为图片。 参数: pdfs_dir str: PDF 文件夹路径,不包含子文件下的文件 return_pic_url bool: 是否上传图片到http 文件服务器,并返回图片的URL。默认为True。 返回: dict: 包含输出目录相对路径的字典。其中上传后,文件名会转为`相对路径_文件名-页码.png`的格式。例如,路径为`a/b/c.pdf`,则会生成`/a_b_c-1.png`、`/a_b_c-2.png`等文件。
Tool names lack clear distinction. Both 'convert_pdfs' and 'convert_pdf' perform the same action (PDF→image conversion) but differ only in scope (batch vs single). LLMs will struggle to choose between them. Consider 'convert_pdf_batch' and 'convert_single_pdf' or 'convert_pdf_directory' and 'convert_pdf_file'.
Descriptions are in Chinese and lack English translations. More critically, they do not explain WHEN to use each tool, what prerequisites exist, or what the return format means. Descriptions should be 50-200 chars, action-oriented, and in the LLM's language (typically English). Current descriptions are ~150 chars but lack clarity on use cases.
No output schema documented. Tools return dict[str, Any] with image paths, but the exact structure is unclear. LLMs cannot plan downstream operations without knowing: Are paths absolute or relative? Are they file:// URIs or HTTP URLs? What fields are guaranteed? Document the return type explicitly.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 39 | <=2025-11-25 | v2 |
No error handling or recovery guidance. If a PDF is corrupted, a directory doesn't exist, or the HTTP upload fails, the tool logs errors but returns no actionable message to the LLM. Errors should categorize as retryable/user-fixable/fatal and suggest next steps.
Security: HTTP_FILE_SERVER_URL and credentials are hardcoded in config.ini, exposed in logs, and passed to concurrent_upload(). Secrets must never appear in tool parameters or logs. Use server-side secret injection via environment variables or a secure vault.