Image preview

This commit is contained in:
2026-07-23 00:24:29 -07:00
parent d3d0ab9c63
commit da5fdc3e4f
2 changed files with 165 additions and 0 deletions
+15
View File
@@ -20,6 +20,7 @@ from .read_image import handle as read_image_handler
from .read_metadata import handle as read_png_metadata_handler
from .contact_sheet import handle as contact_sheet_handler
from .list_directory import handle as list_directory_details_handler
from .preview_image import handle as preview_image_handler
# Central registry of all available tools
TOOL_REGISTRY = [
@@ -72,4 +73,18 @@ TOOL_REGISTRY = [
},
handler=list_directory_details_handler
),
Tool(
name="preview_image",
description="Generates small thumbnails (~70 tokens) and detailed info for images. Can take file paths, or indices/ranges from a contact sheet.",
schema={
"type": "object",
"properties": {
"path": {"type": "string", "description": "Path to an image file or a directory containing images"},
"indices": {"type": "string", "description": "1-based indices or ranges (e.g., '1, 3-5, 10') to preview from the directory. Required if path is a directory."},
"sort_by": {"type": "string", "description": "Sort order to resolve indices: 'mtime' (default), 'name', or 'size'."},
},
"required": ["path"],
},
handler=preview_image_handler
),
]