Self-hosted Telegram bot that turns any SANE/eSCL network scanner into a scan-to-PDF service and any CUPS printer into a print-from-chat service
Strong tool definitions with clear naming, comprehensive descriptions, and well-structured schemas. All 6 tools follow verb_noun convention (scan, list_scans, get_scan, delete_scan, print_file, print_text). Descriptions are detailed (100-250 chars) and explain WHAT, WHEN, and consequences. Input schemas use Zod with proper enums, defaults, and validation. However, output schemas are not formally documented in the tool registration, responses are inferred from code. Error handling is present but recovery guidance is minimal. Tool composition is clean: each tool has one responsibility, and chaining is supported via returned file names/paths.
Delete a stored scan (PDF and page images)
A stored scan as download links (as=links, default), as page images you can read (as=images, optional page), or as the PDF bytes (as=pdf, base64-encoded)
List scans previously produced by `scan`, newest first, with download links.
Print a file from a URL or server path. Prefer URLs (any http(s) file, including this server's own links) or a server path; the file is downloaded and sent to the printer queue.
Print plain text
Scan the page on the scanner glass (source=flatbed, default) or every sheet in the automatic document feeder (source=feeder). The result is stored on the server as a PDF plus per-page images; you get download links (and paths). Set include_images=true only when you need to read the pages yourself. Modes: Color, Gray. Resolutions: 200, 300, 600 dpi (low dpi for reading text, high for archiving). The document feeder is available.
Output schemas not formally documented in tool registration. Responses are inferred from code (describeScan, pageImages, textResult). LLMs cannot predict return structure without explicit schema documentation.
print_file has mutually exclusive parameters (url vs path) but no explicit constraint in description. LLMs may pass both or neither, causing ambiguous failures.
Error handling returns raw error messages via errorResult() but does not categorize errors as retryable, user-fixable, or fatal. LLMs lack guidance on recovery strategy.
Inferred effective spec: 2025-06-18+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 67 | 2025-06-18+ | v2 |
delete_scan is destructive but lacks confirmation/dry-run pattern. No warning in description that deletion is irreversible. Agents may delete scans without user consent.
scan tool description mentions 'Scanning takes 10 - 60 seconds per page; do not retry while a scan is in progress' but no timeout or progress tracking mechanism is exposed. LLMs cannot monitor scan duration.