openalmanac 0.2.16 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/research.js +12 -7
- package/package.json +1 -1
package/dist/tools/research.js
CHANGED
|
@@ -87,15 +87,20 @@ export function registerResearchTools(server) {
|
|
|
87
87
|
description: "View an image to verify it's suitable for an article. Use after search_images to inspect candidate images " +
|
|
88
88
|
"before including them. Returns the image so you can see what it actually shows and write an accurate caption.",
|
|
89
89
|
parameters: z.object({
|
|
90
|
-
url: z.string().describe("Image URL to view (use image_url or thumbnail_url from search_images results)"),
|
|
90
|
+
url: z.string().url().describe("Image URL to view (use image_url or thumbnail_url from search_images results)"),
|
|
91
91
|
}),
|
|
92
92
|
async execute({ url }) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
try {
|
|
94
|
+
return {
|
|
95
|
+
content: [
|
|
96
|
+
await imageContent({ url }),
|
|
97
|
+
{ type: "text", text: `Image URL: ${url}` },
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return `Failed to fetch image from ${url}. The URL may be invalid, inaccessible, or not an image.`;
|
|
103
|
+
}
|
|
99
104
|
},
|
|
100
105
|
});
|
|
101
106
|
}
|