@clipform/mcp-server 1.8.0 → 1.9.0
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/README.md +3 -2
- package/dist/auth-context.js +9 -0
- package/dist/auth-context.js.map +1 -0
- package/dist/chunk-BWCZX7XY.js +3824 -0
- package/dist/chunk-BWCZX7XY.js.map +1 -0
- package/dist/chunk-MYWOSQ66.js +15 -0
- package/dist/chunk-MYWOSQ66.js.map +1 -0
- package/dist/index.js +15 -10
- package/dist/index.js.map +1 -1
- package/dist/server.js +7 -72
- package/dist/server.js.map +1 -1
- package/package.json +5 -4
- package/dist/__tests__/api-parity.test.d.ts +0 -1
- package/dist/__tests__/api-parity.test.js +0 -157
- package/dist/__tests__/api-parity.test.js.map +0 -1
- package/dist/__tests__/config-sync.test.d.ts +0 -1
- package/dist/__tests__/config-sync.test.js +0 -16
- package/dist/__tests__/config-sync.test.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/lib/api-client.d.ts +0 -36
- package/dist/lib/api-client.js +0 -129
- package/dist/lib/api-client.js.map +0 -1
- package/dist/lib/auth-context.d.ts +0 -17
- package/dist/lib/auth-context.js +0 -9
- package/dist/lib/auth-context.js.map +0 -1
- package/dist/lib/config.d.ts +0 -23
- package/dist/lib/config.js +0 -6
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/format-form.d.ts +0 -2
- package/dist/lib/format-form.js +0 -32
- package/dist/lib/format-form.js.map +0 -1
- package/dist/lib/render-jobs.d.ts +0 -13
- package/dist/lib/render-jobs.js +0 -38
- package/dist/lib/render-jobs.js.map +0 -1
- package/dist/lib/schemas.d.ts +0 -64
- package/dist/lib/schemas.js +0 -140
- package/dist/lib/schemas.js.map +0 -1
- package/dist/lib/session-context.d.ts +0 -1
- package/dist/lib/session-context.js +0 -38
- package/dist/lib/session-context.js.map +0 -1
- package/dist/prompts.d.ts +0 -2
- package/dist/prompts.js +0 -272
- package/dist/prompts.js.map +0 -1
- package/dist/resources.d.ts +0 -2
- package/dist/resources.js +0 -336
- package/dist/resources.js.map +0 -1
- package/dist/server.d.ts +0 -2
- package/dist/tools/add-node.d.ts +0 -2
- package/dist/tools/add-node.js +0 -50
- package/dist/tools/add-node.js.map +0 -1
- package/dist/tools/attach-node-audio.d.ts +0 -2
- package/dist/tools/attach-node-audio.js +0 -37
- package/dist/tools/attach-node-audio.js.map +0 -1
- package/dist/tools/check-render.d.ts +0 -2
- package/dist/tools/check-render.js +0 -47
- package/dist/tools/check-render.js.map +0 -1
- package/dist/tools/create-form.d.ts +0 -2
- package/dist/tools/create-form.js +0 -217
- package/dist/tools/create-form.js.map +0 -1
- package/dist/tools/delete-form.d.ts +0 -2
- package/dist/tools/delete-form.js +0 -28
- package/dist/tools/delete-form.js.map +0 -1
- package/dist/tools/delete-node-media.d.ts +0 -2
- package/dist/tools/delete-node-media.js +0 -29
- package/dist/tools/delete-node-media.js.map +0 -1
- package/dist/tools/delete-node.d.ts +0 -2
- package/dist/tools/delete-node.js +0 -32
- package/dist/tools/delete-node.js.map +0 -1
- package/dist/tools/generate-slideshow.d.ts +0 -2
- package/dist/tools/generate-slideshow.js +0 -155
- package/dist/tools/generate-slideshow.js.map +0 -1
- package/dist/tools/generate-tts.d.ts +0 -2
- package/dist/tools/generate-tts.js +0 -73
- package/dist/tools/generate-tts.js.map +0 -1
- package/dist/tools/generate-video.d.ts +0 -2
- package/dist/tools/generate-video.js +0 -119
- package/dist/tools/generate-video.js.map +0 -1
- package/dist/tools/get-form.d.ts +0 -2
- package/dist/tools/get-form.js +0 -31
- package/dist/tools/get-form.js.map +0 -1
- package/dist/tools/get-node-media.d.ts +0 -2
- package/dist/tools/get-node-media.js +0 -39
- package/dist/tools/get-node-media.js.map +0 -1
- package/dist/tools/list-assets.d.ts +0 -2
- package/dist/tools/list-assets.js +0 -45
- package/dist/tools/list-assets.js.map +0 -1
- package/dist/tools/list-compositions.d.ts +0 -2
- package/dist/tools/list-compositions.js +0 -34
- package/dist/tools/list-compositions.js.map +0 -1
- package/dist/tools/log-generation.d.ts +0 -2
- package/dist/tools/log-generation.js +0 -34
- package/dist/tools/log-generation.js.map +0 -1
- package/dist/tools/render-composition.d.ts +0 -2
- package/dist/tools/render-composition.js +0 -50
- package/dist/tools/render-composition.js.map +0 -1
- package/dist/tools/search-media.d.ts +0 -2
- package/dist/tools/search-media.js +0 -40
- package/dist/tools/search-media.js.map +0 -1
- package/dist/tools/search-music.d.ts +0 -2
- package/dist/tools/search-music.js +0 -40
- package/dist/tools/search-music.js.map +0 -1
- package/dist/tools/search-news.d.ts +0 -2
- package/dist/tools/search-news.js +0 -47
- package/dist/tools/search-news.js.map +0 -1
- package/dist/tools/set-node-logic.d.ts +0 -2
- package/dist/tools/set-node-logic.js +0 -56
- package/dist/tools/set-node-logic.js.map +0 -1
- package/dist/tools/update-form.d.ts +0 -2
- package/dist/tools/update-form.js +0 -140
- package/dist/tools/update-form.js.map +0 -1
- package/dist/tools/update-node.d.ts +0 -2
- package/dist/tools/update-node.js +0 -71
- package/dist/tools/update-node.js.map +0 -1
- package/dist/tools/upload-node-media.d.ts +0 -2
- package/dist/tools/upload-node-media.js +0 -109
- package/dist/tools/upload-node-media.js.map +0 -1
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callInternalApi, textResult } from "../lib/api-client.js";
|
|
3
|
-
import { createJob, completeJob, failJob } from "../lib/render-jobs.js";
|
|
4
|
-
const slideshowStyleSchema = z.object({
|
|
5
|
-
preset: z.enum(["cinematic", "dramatic", "calm", "documentary", "dreamy", "moody"]).optional(),
|
|
6
|
-
zoom: z.object({ from: z.number().optional(), to: z.number().optional() }).optional(),
|
|
7
|
-
pan: z.object({ range: z.number().optional(), scale: z.number().optional() }).optional(),
|
|
8
|
-
zoomPan: z.object({
|
|
9
|
-
from: z.number().optional(), to: z.number().optional(), rangeFraction: z.number().optional(),
|
|
10
|
-
}).optional(),
|
|
11
|
-
easing: z.enum(["ease-in-out", "ease-in", "ease-out", "linear"]).optional(),
|
|
12
|
-
blurPad: z.object({
|
|
13
|
-
blurPx: z.number().optional(), brightness: z.number().optional(),
|
|
14
|
-
saturate: z.number().optional(), overscale: z.number().optional(),
|
|
15
|
-
foregroundScale: z.number().optional(),
|
|
16
|
-
}).optional(),
|
|
17
|
-
vignette: z.union([
|
|
18
|
-
z.literal(false),
|
|
19
|
-
z.object({ opacity: z.number().optional(), innerRadiusPercent: z.number().optional() }),
|
|
20
|
-
]).optional(),
|
|
21
|
-
backgroundColor: z.string().optional(),
|
|
22
|
-
autoBlurPadThreshold: z.number().optional(),
|
|
23
|
-
});
|
|
24
|
-
export function registerGenerateVideoTool(server) {
|
|
25
|
-
server.registerTool("clipform_generate_video", {
|
|
26
|
-
title: "Generate Video",
|
|
27
|
-
description: `Generate a video from images, video clips, or a mix of both, synced to audio. Creates a 9:16 (720x1280) video with transitions, uploaded to storage. Returns a public URL.
|
|
28
|
-
|
|
29
|
-
## Workflow
|
|
30
|
-
|
|
31
|
-
1. Source media with clipform_search_media (kind: "image" or "video")
|
|
32
|
-
2. Source audio with clipform_generate_tts (narration) or clipform_search_music (background)
|
|
33
|
-
3. Call this tool with items + audio_url
|
|
34
|
-
4. Attach the returned URL to a node via clipform_upload_node_media with media_type "video"
|
|
35
|
-
|
|
36
|
-
## Items
|
|
37
|
-
|
|
38
|
-
Each item is an image or video clip:
|
|
39
|
-
- **type: "image"** - still image with Ken Burns motion (pan/zoom). Supports effect, fit, and style overrides.
|
|
40
|
-
- **type: "video"** - video clip, cover-cropped to fill 9:16 frame. Audio muted by default (set volume: 1 to mix in). Use start_from to trim.
|
|
41
|
-
|
|
42
|
-
## Style presets (image items)
|
|
43
|
-
|
|
44
|
-
Pick one via default_style.preset (all images) or per-image style.preset:
|
|
45
|
-
- **cinematic** (default) - smooth ease-in-out, subtle zoom/pan, subtle vignette
|
|
46
|
-
- **dramatic** - big zoom, wide pan, ease-out, strong vignette. Reveals, climactic moments.
|
|
47
|
-
- **calm** - minimal motion, linear easing, no vignette. Educational, reflective.
|
|
48
|
-
- **documentary** - near-static, tiny pan, no vignette. Historical photos, talking-heads context.
|
|
49
|
-
- **dreamy** - heavy blur-pad, soft vignette. Aspirational, nostalgic.
|
|
50
|
-
- **moody** - desaturated, dark, strong vignette. Mystery, somber.
|
|
51
|
-
|
|
52
|
-
## Effects (image items)
|
|
53
|
-
|
|
54
|
-
zoom-in, zoom-out, pan-left, pan-right, pan-up, pan-down, zoom-in-pan-left, zoom-in-pan-right, random, static.
|
|
55
|
-
Set per-image or use random_effects: true to shuffle.
|
|
56
|
-
|
|
57
|
-
## Transitions
|
|
58
|
-
|
|
59
|
-
fade (default), slide, wipe, none. Duration in seconds.
|
|
60
|
-
|
|
61
|
-
## Duration
|
|
62
|
-
|
|
63
|
-
Matches audio when audio_url is provided. Use duration_seconds for videos without audio.`,
|
|
64
|
-
inputSchema: {
|
|
65
|
-
items: z.array(z.object({
|
|
66
|
-
type: z.enum(["image", "video"]).describe("'image' for still images with Ken Burns effects, 'video' for video clips"),
|
|
67
|
-
url: z.string().url().describe("Media URL"),
|
|
68
|
-
effect: z.string().optional().describe("Ken Burns effect (image only): zoom-in, zoom-out, pan-left, pan-right, pan-up, pan-down, zoom-in-pan-left, zoom-in-pan-right, random, static"),
|
|
69
|
-
aspect_ratio: z.number().positive().optional().describe("Image width/height ratio (image only). Enables auto blur-pad for landscape images."),
|
|
70
|
-
fit: z.enum(["cover", "blur-pad", "auto"]).optional().describe("Framing mode (image only). auto = cover for portrait, blur-pad for landscape."),
|
|
71
|
-
style: slideshowStyleSchema.optional().describe("Creative style overrides (image only)"),
|
|
72
|
-
start_from: z.number().min(0).optional().describe("Start time in seconds (video only). Trims the clip."),
|
|
73
|
-
volume: z.number().min(0).max(1).optional().describe("Clip audio volume 0-1 (video only, default 0 = muted)"),
|
|
74
|
-
})).min(1).max(20).describe("Media items (images, video clips, or a mix)"),
|
|
75
|
-
audio_url: z.string().url().optional().describe("Audio track URL. Video duration matches audio duration."),
|
|
76
|
-
duration_seconds: z.number().positive().optional().describe("Video duration in seconds (required if no audio_url)"),
|
|
77
|
-
random_effects: z.boolean().optional().default(true).describe("Shuffle Ken Burns effects across image items (default: true)"),
|
|
78
|
-
transition: z.object({
|
|
79
|
-
type: z.string().optional().default("fade").describe("Transition: fade (default), slide, wipe, none"),
|
|
80
|
-
duration: z.number().optional().default(1).describe("Transition duration in seconds (default: 1)"),
|
|
81
|
-
}).optional(),
|
|
82
|
-
default_style: slideshowStyleSchema.optional().describe("Style applied to all image items unless overridden per-item"),
|
|
83
|
-
background_color: z.string().optional().describe("Background color (default '#000')"),
|
|
84
|
-
},
|
|
85
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
86
|
-
}, async ({ items, audio_url, duration_seconds, random_effects, transition, default_style, background_color }) => {
|
|
87
|
-
const workspace_id = process.env.MCP_WORKSPACE_ID;
|
|
88
|
-
const job = createJob("clipform_generate_video");
|
|
89
|
-
callInternalApi("/internal/generate-video", {
|
|
90
|
-
body: {
|
|
91
|
-
items,
|
|
92
|
-
audio_url,
|
|
93
|
-
duration_seconds,
|
|
94
|
-
random_effects: random_effects ?? true,
|
|
95
|
-
transition: transition ?? { type: "fade", duration: 1 },
|
|
96
|
-
default_style,
|
|
97
|
-
background_color,
|
|
98
|
-
workspace_id,
|
|
99
|
-
},
|
|
100
|
-
}).then((result) => {
|
|
101
|
-
if (!result.ok) {
|
|
102
|
-
failJob(job.id, result.error);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
completeJob(job.id, result.data);
|
|
106
|
-
}
|
|
107
|
-
}).catch((err) => {
|
|
108
|
-
failJob(job.id, err instanceof Error ? err.message : String(err));
|
|
109
|
-
});
|
|
110
|
-
return textResult([
|
|
111
|
-
`Render started (${items.length} item${items.length > 1 ? "s" : ""}).`,
|
|
112
|
-
``,
|
|
113
|
-
`Job ID: ${job.id}`,
|
|
114
|
-
``,
|
|
115
|
-
`Renders typically take 1-3 minutes. Use clipform_check_render with this job ID to check status.`,
|
|
116
|
-
].join("\n"));
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=generate-video.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-video.js","sourceRoot":"","sources":["../../src/tools/generate-video.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAe,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9F,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrF,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxF,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAA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AQ,EAAE,CAAC,EAAE;gBACvD,aAAa;gBACb,gBAAgB;gBAChB,YAAY;aACb;SACF,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CACf;YACE,mBAAmB,KAAK,CAAC,MAAM,QAAQ,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI;YACtE,EAAE;YACF,WAAW,GAAG,CAAC,EAAE,EAAE;YACnB,EAAE;YACF,iGAAiG;SAClG,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/get-form.d.ts
DELETED
package/dist/tools/get-form.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
import { formatFormState } from "../lib/format-form.js";
|
|
4
|
-
export function registerGetFormTool(server) {
|
|
5
|
-
server.registerTool("clipform_get_form", {
|
|
6
|
-
title: "Get Clipform",
|
|
7
|
-
description: `Retrieve a form's details including all questions in sequential order. Use this to see the current state of a form before making changes.`,
|
|
8
|
-
inputSchema: {
|
|
9
|
-
form_id: z.string().uuid().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)"),
|
|
10
|
-
edit_token: z
|
|
11
|
-
.string()
|
|
12
|
-
.optional()
|
|
13
|
-
.describe("The edit token. Required for anonymous (non-OAuth) sessions; omit when connected via an authenticated MCP client like claude.ai."),
|
|
14
|
-
},
|
|
15
|
-
annotations: {
|
|
16
|
-
readOnlyHint: true,
|
|
17
|
-
destructiveHint: false,
|
|
18
|
-
idempotentHint: true,
|
|
19
|
-
openWorldHint: true,
|
|
20
|
-
},
|
|
21
|
-
}, async ({ form_id, edit_token }) => {
|
|
22
|
-
const result = await callApi(`/forms/${form_id}`, {
|
|
23
|
-
token: edit_token,
|
|
24
|
-
});
|
|
25
|
-
if (!result.ok) {
|
|
26
|
-
return errorResult(result.error);
|
|
27
|
-
}
|
|
28
|
-
return textResult(formatFormState(result.data));
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=get-form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-form.js","sourceRoot":"","sources":["../../src/tools/get-form.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,2IAA2I;QACxJ,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,uFAAuF,CAAC;YAC5H,UAAU,EAAE,CAAC;iBACV,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,kIAAkI,CAAC;SAChJ;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;QAChC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,OAAO,EAAE,EAAE;YAChD,KAAK,EAAE,UAAU;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,UAAU,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
export function registerGetNodeMediaTool(server) {
|
|
4
|
-
server.registerTool("clipform_get_node_media", {
|
|
5
|
-
title: "Get Node Media",
|
|
6
|
-
description: `Get the media attached to a node, including processing status. Useful for checking if a video upload has finished processing.`,
|
|
7
|
-
inputSchema: {
|
|
8
|
-
form_id: z.string().uuid().describe("The form UUID (returned by clipform_create_form, not the short share_id from the URL)"),
|
|
9
|
-
edit_token: z.string().optional().describe("The edit token. Required for anonymous (non-OAuth) sessions; omit when connected via an authenticated MCP client like claude.ai."),
|
|
10
|
-
node_id: z.string().describe("The node ID"),
|
|
11
|
-
},
|
|
12
|
-
annotations: {
|
|
13
|
-
readOnlyHint: true,
|
|
14
|
-
destructiveHint: false,
|
|
15
|
-
idempotentHint: true,
|
|
16
|
-
openWorldHint: true,
|
|
17
|
-
},
|
|
18
|
-
}, async ({ form_id, edit_token, node_id }) => {
|
|
19
|
-
const result = await callApi(`/forms/${form_id}/nodes/${node_id}/media`, {
|
|
20
|
-
method: "GET",
|
|
21
|
-
token: edit_token,
|
|
22
|
-
});
|
|
23
|
-
if (!result.ok) {
|
|
24
|
-
return errorResult(result.error);
|
|
25
|
-
}
|
|
26
|
-
const media = result.data.media;
|
|
27
|
-
if (!media) {
|
|
28
|
-
return textResult("No media attached to this node.");
|
|
29
|
-
}
|
|
30
|
-
return textResult(`Media ID: ${media.id}\n` +
|
|
31
|
-
`Type: ${media.media_type}\n` +
|
|
32
|
-
`Status: ${media.status}\n` +
|
|
33
|
-
(media.playback_id ? `Playback ID: ${media.playback_id}\n` : "") +
|
|
34
|
-
(media.storage_path ? `Storage path: ${media.storage_path}\n` : "") +
|
|
35
|
-
(media.duration ? `Duration: ${media.duration}s\n` : "") +
|
|
36
|
-
`Transcription: ${media.transcription_status}`);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=get-node-media.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-node-media.js","sourceRoot":"","sources":["../../src/tools/get-node-media.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,yBAAyB,EACzB;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,+HAA+H;QAC5I,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,uFAAuF,CAAC;YAC5H,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kIAAkI,CAAC;YAC9K,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;SAC5C;QACD,WAAW,EAAE;YACX,YAAY,EAA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export function registerListAssetsTool(server) {
|
|
4
|
-
server.registerTool("clipform_list_assets", {
|
|
5
|
-
title: "List Assets",
|
|
6
|
-
description: `List available creative assets (sound effects, animations, fonts). Use this to discover what assets are available for use in compositions.`,
|
|
7
|
-
inputSchema: {
|
|
8
|
-
type: z.enum(["sfx", "animation", "font", "all"]).default("all").optional()
|
|
9
|
-
.describe("Asset type to list (default: all)"),
|
|
10
|
-
},
|
|
11
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
12
|
-
}, async ({ type }) => {
|
|
13
|
-
const result = await callInternalApi("/internal/assets", {
|
|
14
|
-
method: "GET",
|
|
15
|
-
params: { type: type ?? "all" },
|
|
16
|
-
});
|
|
17
|
-
if (!result.ok)
|
|
18
|
-
return errorResult(result.error);
|
|
19
|
-
const data = result.data;
|
|
20
|
-
const lines = [];
|
|
21
|
-
if (data.sfx?.length) {
|
|
22
|
-
lines.push(`## Sound Effects (${data.sfx.length})\n`);
|
|
23
|
-
for (const sfx of data.sfx) {
|
|
24
|
-
lines.push(`- ${sfx.name}: ${sfx.description || sfx.path}`);
|
|
25
|
-
}
|
|
26
|
-
lines.push("");
|
|
27
|
-
}
|
|
28
|
-
if (data.animations?.length) {
|
|
29
|
-
lines.push(`## Animations (${data.animations.length})\n`);
|
|
30
|
-
for (const anim of data.animations) {
|
|
31
|
-
lines.push(`- ${anim.name}: ${anim.description || anim.path}`);
|
|
32
|
-
}
|
|
33
|
-
lines.push("");
|
|
34
|
-
}
|
|
35
|
-
if (data.fonts?.length) {
|
|
36
|
-
lines.push(`## Fonts (${data.fonts.length})\n`);
|
|
37
|
-
for (const font of data.fonts) {
|
|
38
|
-
lines.push(`- ${font.name}: weights ${font.weights?.join(", ") || "default"}`);
|
|
39
|
-
}
|
|
40
|
-
lines.push("");
|
|
41
|
-
}
|
|
42
|
-
return textResult(lines.length ? lines.join("\n") : "No assets found.");
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
//# s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C"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
2
|
-
export function registerListCompositionsTool(server) {
|
|
3
|
-
server.registerTool("clipform_list_compositions", {
|
|
4
|
-
title: "List Compositions",
|
|
5
|
-
description: `List all available Remotion compositions and their expected props schemas. Use clipform_render_composition to render them.`,
|
|
6
|
-
inputSchema: {},
|
|
7
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
8
|
-
}, async () => {
|
|
9
|
-
const result = await callInternalApi("/internal/compositions", {
|
|
10
|
-
method: "GET",
|
|
11
|
-
});
|
|
12
|
-
if (!result.ok) {
|
|
13
|
-
if (result.status === 0 || result.status === 404) {
|
|
14
|
-
return errorResult("Remotion compositions are not available (API server may not be running). Start the API with 'npm run dev --workspace=apps/api'.");
|
|
15
|
-
}
|
|
16
|
-
return errorResult(result.error);
|
|
17
|
-
}
|
|
18
|
-
const compositions = result.data.compositions;
|
|
19
|
-
if (!compositions.length)
|
|
20
|
-
return textResult("No compositions found.");
|
|
21
|
-
const lines = [`Available compositions (${compositions.length}):\n`];
|
|
22
|
-
for (const comp of compositions) {
|
|
23
|
-
lines.push(`## ${comp.id}`);
|
|
24
|
-
lines.push(` Duration: ${comp.durationInFrames} frames @ ${comp.fps}fps (${(comp.durationInFrames / comp.fps).toFixed(1)}s)`);
|
|
25
|
-
lines.push(` Size: ${comp.width}x${comp.height}`);
|
|
26
|
-
if (comp.defaultProps) {
|
|
27
|
-
lines.push(` Default props: ${JSON.stringify(comp.defaultProps, null, 2)}`);
|
|
28
|
-
}
|
|
29
|
-
lines.push("");
|
|
30
|
-
}
|
|
31
|
-
return textResult(lines.join("\n"));
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=list-compositions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-compositions.js","sourceRoot":"","sources":["../../src/tools/list-compositions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C,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC/H,KAAK,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACnD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC/E,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
export function registerLogGenerationTool(server) {
|
|
4
|
-
server.registerTool("clipform_log_generation", {
|
|
5
|
-
title: "Log Form Generation Audit",
|
|
6
|
-
description: `Save an audit trail for a generated form. Records where content came from - the sources and image attributions. Call this as the final step after building a form or quiz.`,
|
|
7
|
-
inputSchema: {
|
|
8
|
-
form_id: z.string().uuid().describe("The form ID (UUID format, not the share ID)"),
|
|
9
|
-
edit_token: z.string().optional().describe("The edit token. Required for anonymous (non-OAuth) sessions; omit when connected via an authenticated MCP client like claude.ai."),
|
|
10
|
-
summary: z.string().describe("Short description of what was generated"),
|
|
11
|
-
details: z.object({
|
|
12
|
-
sources: z.array(z.object({
|
|
13
|
-
title: z.string(),
|
|
14
|
-
url: z.string().optional(),
|
|
15
|
-
type: z.string().optional(),
|
|
16
|
-
})).optional().describe("Knowledge sources used"),
|
|
17
|
-
images: z.array(z.object({
|
|
18
|
-
url: z.string(),
|
|
19
|
-
attribution: z.string().optional(),
|
|
20
|
-
license: z.string().optional(),
|
|
21
|
-
})).optional().describe("Images used with attribution"),
|
|
22
|
-
}).describe("Content sources and attributions"),
|
|
23
|
-
},
|
|
24
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
25
|
-
}, async ({ form_id, edit_token, summary, details }) => {
|
|
26
|
-
const result = await callInternalApi("/internal/log-generation", {
|
|
27
|
-
body: { form_id, summary, details },
|
|
28
|
-
});
|
|
29
|
-
if (!result.ok)
|
|
30
|
-
return errorResult(result.error);
|
|
31
|
-
return textResult(`Audit log saved for form ${form_id}\nSummary: ${summary}`);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=log-generation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-generation.js","sourceRoot":"","sources":["../../src/tools/log-generation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,yBAAyB,EACzB;QACE,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE,4KAA4K;QACzL,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YAClF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kIAAkI,CAAC;YAC9K,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;YACvE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;gBAChB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;oBACxB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE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/render-jobs.js";
|
|
4
|
-
export function registerRenderCompositionTool(server) {
|
|
5
|
-
server.registerTool("clipform_render_composition", {
|
|
6
|
-
title: "Render Composition",
|
|
7
|
-
description: `Render a Remotion composition to MP4, PNG, or GIF. MP4 renders use AWS Lambda in production for fast, scalable rendering. PNG and GIF render locally.
|
|
8
|
-
|
|
9
|
-
Output formats:
|
|
10
|
-
- mp4: Video file (H.264 codec, best for social media)
|
|
11
|
-
- png: Still image (single frame)
|
|
12
|
-
- gif: Animated GIF (looping)
|
|
13
|
-
|
|
14
|
-
For narrated quiz slideshows, prefer clipform_generate_slideshow which handles the full workflow (focal point detection, audio sync, storage upload). Use this tool for custom compositions like ScorecardQuiz, ShortFormQuiz, or PresenterDirected.`,
|
|
15
|
-
inputSchema: {
|
|
16
|
-
compositionId: z.string().describe("The composition ID (e.g. 'ScorecardQuiz', 'ShortFormQuiz', 'PresenterDirected')"),
|
|
17
|
-
outputFormat: z.enum(["mp4", "png", "gif"]).default("mp4").describe("Output format (default: mp4)"),
|
|
18
|
-
inputProps: z.record(z.unknown()).optional().describe("Props object matching the composition's expected schema"),
|
|
19
|
-
},
|
|
20
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
21
|
-
}, async ({ compositionId, outputFormat, inputProps }) => {
|
|
22
|
-
const job = createJob("clipform_render_composition");
|
|
23
|
-
callInternalApi("/internal/render", {
|
|
24
|
-
body: {
|
|
25
|
-
compositionId,
|
|
26
|
-
outputFormat,
|
|
27
|
-
inputProps: inputProps ?? {},
|
|
28
|
-
},
|
|
29
|
-
}).then((result) => {
|
|
30
|
-
if (!result.ok) {
|
|
31
|
-
failJob(job.id, result.error);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
completeJob(job.id, result.data);
|
|
35
|
-
}
|
|
36
|
-
}).catch((err) => {
|
|
37
|
-
failJob(job.id, err instanceof Error ? err.message : String(err));
|
|
38
|
-
});
|
|
39
|
-
return textResult([
|
|
40
|
-
`Render started.`,
|
|
41
|
-
``,
|
|
42
|
-
`Composition: ${compositionId}`,
|
|
43
|
-
`Format: ${outputFormat}`,
|
|
44
|
-
`Job ID: ${job.id}`,
|
|
45
|
-
``,
|
|
46
|
-
`Renders typically take 1-3 minutes. Use clipform_check_render with this job ID to check status.`,
|
|
47
|
-
].join("\n"));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=render-composition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-composition.js","sourceRoot":"","sources":["../../src/tools/render-composition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAe,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,MAAM,CAAC,YAAY,CACjB,6BAA6B,EAC7B;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE;;;;;;;qPAOkO;QAC/O,WAAW,EAAE;YACX,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iFAAiF,CAAC;YACrH,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,8BAA8B,CAAC;YACnG,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;SACjH;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;KAC1G,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE;QACpD,MAAM,GAAG,GAAG,SAAS,CAAC,6BAA6B,CAAC,CAAC;QAErD,eAAe,CAAC,kBAAkB,EAAE;YAClC,IAAI,EAAE;gBACJ,aAAa;gBACb,YAAY;gBACZ,UAAU,EAAE,UAAU,IAAI,EAAE;aAC7B;SACF,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CACf;YACE,iBAAiB;YACjB,EAAE;YACF,gBAAgB,aAAa,EAAE;YAC/B,WAAW,YAAY,EAAE;YACzB,WAAW,GAAG,CAAC,EAAE,EAAE;YACnB,EAAE;YACF,iGAAiG;SAClG,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
export function registerSearchMediaTool(server) {
|
|
4
|
-
server.registerTool("clipform_search_media", {
|
|
5
|
-
title: "Search Media",
|
|
6
|
-
description: `Search royalty-free images or stock video clips to attach to a node. Routes across Pexels, Unsplash, Pixabay, Wikimedia, NASA, and iNaturalist for images; Pexels and Pixabay for video. The router picks relevant providers based on the topic (space → NASA, nature → iNaturalist, general → stock libraries). Returns URLs you can pass to clipform_upload_node_media or clipform_generate_slideshow.`,
|
|
7
|
-
inputSchema: {
|
|
8
|
-
query: z.string().describe("What to search for (e.g. 'african lion', 'saturn rings', 'city timelapse')"),
|
|
9
|
-
kind: z.enum(["image", "video"]).describe("image = stock photos, video = stock clips"),
|
|
10
|
-
count: z.number().min(1).max(20).default(6).optional()
|
|
11
|
-
.describe("Max results per provider (default 6 for image, 3 for video)"),
|
|
12
|
-
},
|
|
13
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
14
|
-
}, async ({ query, kind, count }) => {
|
|
15
|
-
const result = await callInternalApi("/internal/search-media", {
|
|
16
|
-
body: { query, kind, count },
|
|
17
|
-
});
|
|
18
|
-
if (!result.ok)
|
|
19
|
-
return errorResult(result.error);
|
|
20
|
-
const results = result.data.results;
|
|
21
|
-
if (!results.length)
|
|
22
|
-
return textResult(`No ${kind}s found for "${query}".`);
|
|
23
|
-
const lines = [`Found ${results.length} ${kind}s for "${query}":\n`];
|
|
24
|
-
for (const item of results.slice(0, 15)) {
|
|
25
|
-
lines.push(`- [${item.source}] ${item.title}`);
|
|
26
|
-
lines.push(` URL: ${item.url}`);
|
|
27
|
-
if (item.width && item.height)
|
|
28
|
-
lines.push(` Size: ${item.width}x${item.height}`);
|
|
29
|
-
if (kind === "video" && item.duration)
|
|
30
|
-
lines.push(` Duration: ${item.duration}s`);
|
|
31
|
-
if (item.attribution)
|
|
32
|
-
lines.push(` Attribution: ${item.attribution}`);
|
|
33
|
-
if (item.license)
|
|
34
|
-
lines.push(` License: ${item.license}`);
|
|
35
|
-
lines.push("");
|
|
36
|
-
}
|
|
37
|
-
return textResult(lines.join("\n"));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=search-media.js.map
|
|
@@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
3
|
-
export function registerSearchMusicTool(server) {
|
|
4
|
-
server.registerTool("clipform_search_music", {
|
|
5
|
-
title: "Search Music",
|
|
6
|
-
description: `Search for royalty-free music tracks and ambient sounds via Jamendo and Freesound. Returns download URLs for background music, quiz soundtracks, or ambient audio.`,
|
|
7
|
-
inputSchema: {
|
|
8
|
-
query: z.string().describe("What to search for (e.g. 'upbeat quiz background', 'calm ambient', 'playful pizzicato')"),
|
|
9
|
-
count: z.number().min(1).max(10).default(5).optional().describe("Max results (default: 5)"),
|
|
10
|
-
instrumentalOnly: z.boolean().optional().default(true).describe("Only instrumental tracks (default: true)"),
|
|
11
|
-
minDuration: z.number().optional().describe("Minimum duration in seconds"),
|
|
12
|
-
maxDuration: z.number().optional().describe("Maximum duration in seconds"),
|
|
13
|
-
tags: z.array(z.string()).optional().describe("Genre/mood tags to filter by"),
|
|
14
|
-
},
|
|
15
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
16
|
-
}, async ({ query, count, instrumentalOnly, minDuration, maxDuration, tags }) => {
|
|
17
|
-
const result = await callInternalApi("/internal/search-music", {
|
|
18
|
-
body: { query, count, instrumentalOnly, minDuration, maxDuration, tags },
|
|
19
|
-
});
|
|
20
|
-
if (!result.ok)
|
|
21
|
-
return errorResult(result.error);
|
|
22
|
-
const results = result.data.results;
|
|
23
|
-
if (!results.length)
|
|
24
|
-
return textResult(`No music found for "${query}".`);
|
|
25
|
-
const lines = [`Found ${results.length} tracks for "${query}":\n`];
|
|
26
|
-
for (const item of results) {
|
|
27
|
-
lines.push(`- ${item.title} by ${item.artist}`);
|
|
28
|
-
lines.push(` URL: ${item.url}`);
|
|
29
|
-
if (item.duration)
|
|
30
|
-
lines.push(` Duration: ${item.duration}s`);
|
|
31
|
-
if (item.source)
|
|
32
|
-
lines.push(` Source: ${item.source}`);
|
|
33
|
-
if (item.license)
|
|
34
|
-
lines.push(` License: ${item.license}`);
|
|
35
|
-
lines.push("");
|
|
36
|
-
}
|
|
37
|
-
return textResult(lines.join("\n"));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=search-music.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-music.js","sourceRoot":"","sources":["../../src/tools/search-music.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,MAAM,CAAC,YAAY,CACjB,uBAAuB,EACvB;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,oKAAoK;QACjL,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yFAAyF,CAAC;YACrH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YAC3F,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;YAC3G,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YAC1E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YAC1E,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;SAC9E;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,E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YAC3D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { callInternalApi, errorResult, textResult } from "../lib/api-client.js";
|
|
3
|
-
export function registerSearchNewsTool(server) {
|
|
4
|
-
server.registerTool("clipform_search_news", {
|
|
5
|
-
title: "Search News (fallback)",
|
|
6
|
-
description: `FALLBACK news lookup for clients without native web search. Returns structured current-news articles from NewsAPI and The Guardian.
|
|
7
|
-
|
|
8
|
-
WHEN TO USE:
|
|
9
|
-
- The user asks for a quiz about an event, person, or topic that is recent (post-May-2025) or that you are not confident you know accurately.
|
|
10
|
-
- Your client does NOT already expose a native web search / web fetch tool. If it does (e.g. WebSearch in Claude Code, web search in Claude Desktop), prefer that - it is broader and more current than this tool.
|
|
11
|
-
- You would otherwise be at risk of hallucinating facts.
|
|
12
|
-
|
|
13
|
-
DO NOT USE for timeless topics you already know well (history, geography, science, general knowledge) - write those from your own knowledge, it is faster and the result is better.
|
|
14
|
-
|
|
15
|
-
If neither native web search nor this tool is available and the topic is post-cutoff or uncertain, REFUSE rather than fabricate.`,
|
|
16
|
-
inputSchema: {
|
|
17
|
-
query: z.string().describe("News search query (e.g. 'Iran war 2026', 'Australian Open final', 'UK election')"),
|
|
18
|
-
count: z.number().min(1).max(15).default(5).optional()
|
|
19
|
-
.describe("Max results per provider (default 5)"),
|
|
20
|
-
},
|
|
21
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
22
|
-
}, async ({ query, count }) => {
|
|
23
|
-
const result = await callInternalApi("/internal/search-news", {
|
|
24
|
-
body: { query, count },
|
|
25
|
-
});
|
|
26
|
-
if (!result.ok)
|
|
27
|
-
return errorResult(result.error);
|
|
28
|
-
const results = result.data.results;
|
|
29
|
-
if (!results.length)
|
|
30
|
-
return textResult(`No news articles found for "${query}".`);
|
|
31
|
-
const lines = [`Found ${results.length} articles for "${query}":\n`];
|
|
32
|
-
for (const article of results) {
|
|
33
|
-
lines.push(`- [${article.source}] ${article.title}`);
|
|
34
|
-
if (article.description)
|
|
35
|
-
lines.push(` ${article.description}`);
|
|
36
|
-
if (article.author)
|
|
37
|
-
lines.push(` Author: ${article.author}`);
|
|
38
|
-
lines.push(` Date: ${article.publishedAt}`);
|
|
39
|
-
lines.push(` URL: ${article.url}`);
|
|
40
|
-
if (article.imageUrl)
|
|
41
|
-
lines.push(` Image: ${article.imageUrl}`);
|
|
42
|
-
lines.push("");
|
|
43
|
-
}
|
|
44
|
-
return textResult(lines.join("\n"));
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=search-news.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-news.js","sourceRoot":"","sources":["../../src/tools/search-news.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,MAAM,CAAC,YAAY,CACjB,sBAAsB,EACtB;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE;;;;;;;;;iIAS8G;QAC3H,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kFAAkF,CAAC;YAC9G,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;iBACnD,QAAQ,CAAC,sCAAsC,CAAC;SACpD;QACD,WAAW,EAAE,EAAE,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