Return type standardization

This commit is contained in:
2026-07-27 00:35:20 -07:00
parent baa48d7cec
commit f0e5267828
8 changed files with 47 additions and 48 deletions
+2 -2
View File
@@ -26,11 +26,11 @@ async def handle(args: Dict[str, Any]):
# Pillow parses PNG text chunks into the .info dictionary
metadata = img.info
if not metadata:
return {"text": "No metadata found in this PNG."}
return [{"type": "text", "text": "No metadata found in this PNG."}]
# Format as a simple key: value list
output = "\n".join([f"{k}: {v}" for k, v in metadata.items()])
return {"text": f"PNG Metadata:\n{output}"}
return [{"type": "text", "text": f"PNG Metadata:\n{output}"}]
except ToolError:
raise
except Exception as e: