openalmanac 0.2.14 → 0.2.16
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/server.js +3 -3
- package/dist/tools/articles.js +10 -5
- package/dist/tools/research.js +32 -7
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -48,9 +48,9 @@ export function createServer() {
|
|
|
48
48
|
"create_stub with the image_url from the  line in the scraped markdown. " +
|
|
49
49
|
"For topics/orgs/events: use descriptive kebab-case slugs (e.g. 'reinforcement-learning', 'openai').\n\n" +
|
|
50
50
|
"## Images\n\n" +
|
|
51
|
-
"Use search_images to find images
|
|
52
|
-
"
|
|
53
|
-
"
|
|
51
|
+
"Use search_images to find images, then view_image to verify candidates before using them. " +
|
|
52
|
+
"Syntax: `` where position is 'right' (default), 'left', or 'center'. " +
|
|
53
|
+
"The caption (alt text) is displayed below the image — make it descriptive. Use 1-3 images per major section. " +
|
|
54
54
|
"For the infobox hero image, set infobox.header.image_url in frontmatter. " +
|
|
55
55
|
"External image URLs are auto-persisted on push — no extra steps needed.\n\n" +
|
|
56
56
|
"After creating an article, always share the exact URL from the push response with the user. " +
|
package/dist/tools/articles.js
CHANGED
|
@@ -84,22 +84,27 @@ Include an infobox for any article about a person, place, organization, event, o
|
|
|
84
84
|
|
|
85
85
|
## Images
|
|
86
86
|
|
|
87
|
-
Use search_images to find relevant images.
|
|
87
|
+
Use search_images to find relevant images. Images render as figures with visible captions.
|
|
88
|
+
|
|
89
|
+
**Syntax:** \`\`
|
|
90
|
+
|
|
91
|
+
Positions: \`"right"\` (default if omitted), \`"left"\`, \`"center"\`
|
|
88
92
|
|
|
89
93
|
\`\`\`markdown
|
|
90
94
|

|
|
91
95
|
|
|
92
96
|
The early life of Alan Turing began...
|
|
93
|
-
\`\`\`
|
|
94
97
|
|
|
95
|
-
|
|
98
|
+

|
|
99
|
+
\`\`\`
|
|
96
100
|
|
|
97
101
|
**Caption rules:**
|
|
98
|
-
- Every image MUST have a descriptive caption
|
|
102
|
+
- Every image MUST have a descriptive caption — it is displayed below the image
|
|
99
103
|
- Describe what the image shows: "Alan Turing in 1930, aged 18" not "Photo"
|
|
100
|
-
-
|
|
104
|
+
- Include dates, context, or attribution when relevant
|
|
101
105
|
|
|
102
106
|
**Placement:** 1-3 images per major section, spread throughout. First image near the top.
|
|
107
|
+
For the infobox hero image, use \`infobox.header.image_url\` in frontmatter instead.
|
|
103
108
|
|
|
104
109
|
External image URLs are auto-persisted on push — no extra steps needed.
|
|
105
110
|
|
package/dist/tools/research.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { imageContent } from "fastmcp";
|
|
2
3
|
import { request } from "../auth.js";
|
|
3
4
|
export function registerResearchTools(server) {
|
|
4
5
|
server.addTool({
|
|
@@ -44,16 +45,24 @@ export function registerResearchTools(server) {
|
|
|
44
45
|
name: "search_images",
|
|
45
46
|
description: "Search for images to include in articles. Returns image URLs, titles, dimensions, and licensing info. " +
|
|
46
47
|
"Two sources: 'wikimedia' (free, open-licensed images from Wikimedia Commons — preferred) and 'google' (broader web images via Google). " +
|
|
47
|
-
"Use descriptive search terms.
|
|
48
|
+
"Use descriptive search terms. After searching, call view_image on promising candidates to see what they actually show before using them. " +
|
|
48
49
|
"External image URLs are automatically persisted when you push the article — no extra steps needed.\n\n" +
|
|
49
50
|
"## Using images in articles\n\n" +
|
|
50
|
-
"
|
|
51
|
-
"
|
|
51
|
+
"Images render as figures with visible captions. The alt text becomes the caption — make it descriptive.\n\n" +
|
|
52
|
+
"**Syntax:** ``\n\n" +
|
|
53
|
+
"Position options (in the title/quotes):\n" +
|
|
54
|
+
"- `\"right\"` — float right (DEFAULT if omitted)\n" +
|
|
55
|
+
"- `\"left\"` — float left\n" +
|
|
56
|
+
"- `\"center\"` — full-width, centered\n\n" +
|
|
57
|
+
"**Examples:**\n" +
|
|
58
|
+
"- `` — floats right (default)\n" +
|
|
59
|
+
"- `` — floats left\n" +
|
|
60
|
+
"- `` — full-width\n\n" +
|
|
52
61
|
"**Caption rules:**\n" +
|
|
53
|
-
"- Every image MUST have a descriptive caption
|
|
54
|
-
"-
|
|
55
|
-
"-
|
|
56
|
-
"- Bad: `` — Good: ``\n\n" +
|
|
57
66
|
"**Placement rules:**\n" +
|
|
58
67
|
"- Place 1-3 images per major section — don't overload\n" +
|
|
59
68
|
"- First image should appear near the top, illustrating the article's subject\n" +
|
|
@@ -73,4 +82,20 @@ export function registerResearchTools(server) {
|
|
|
73
82
|
return JSON.stringify(await resp.json(), null, 2);
|
|
74
83
|
},
|
|
75
84
|
});
|
|
85
|
+
server.addTool({
|
|
86
|
+
name: "view_image",
|
|
87
|
+
description: "View an image to verify it's suitable for an article. Use after search_images to inspect candidate images " +
|
|
88
|
+
"before including them. Returns the image so you can see what it actually shows and write an accurate caption.",
|
|
89
|
+
parameters: z.object({
|
|
90
|
+
url: z.string().describe("Image URL to view (use image_url or thumbnail_url from search_images results)"),
|
|
91
|
+
}),
|
|
92
|
+
async execute({ url }) {
|
|
93
|
+
return {
|
|
94
|
+
content: [
|
|
95
|
+
await imageContent({ url }),
|
|
96
|
+
{ type: "text", text: `Image URL: ${url}` },
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
});
|
|
76
101
|
}
|