wave_create_clip
Create a clip from a recorded stream by specifying start and end times, and optionally export to TikTok, YouTube Shorts, Instagram Reels, or Twitter.
Instructions
Create a clip from a recorded stream, optionally exporting to social platforms
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stream_id | Yes | The stream ID to clip from | |
| start_time | Yes | Clip start time in seconds | |
| end_time | Yes | Clip end time in seconds | |
| title | No | Clip title | |
| export_to | No | Social platforms to auto-export to |
Implementation Reference
- src/tools/production.ts:79-94 (handler)Handler function for wave_create_clip. Makes a POST to /api/v1/clips with streamId, startTime, endTime, and optional title/exportTo.
async ({ stream_id, start_time, end_time, title, export_to }) => { const payload: Record<string, unknown> = { streamId: stream_id, startTime: start_time, endTime: end_time, }; if (title !== undefined) payload["title"] = title; if (export_to !== undefined) payload["exportTo"] = export_to; const res = await waveFetch("/api/v1/clips", { method: "POST", body: JSON.stringify(payload), }); if (!res.ok) return errorContent(res.status, res.body); return textContent(res.body); }, - src/tools/production.ts:69-78 (schema)Zod schema for wave_create_clip inputs: stream_id (UUID), start_time, end_time, optional title, optional export_to array of social platforms.
{ stream_id: z.string().uuid().describe("The stream ID to clip from"), start_time: z.number().min(0).describe("Clip start time in seconds"), end_time: z.number().min(0).describe("Clip end time in seconds"), title: z.string().max(255).optional().describe("Clip title"), export_to: z .array(z.enum(["tiktok", "youtube_shorts", "instagram_reels", "twitter"])) .optional() .describe("Social platforms to auto-export to"), }, - src/tools/production.ts:66-95 (registration)Registration of wave_create_clip tool via server.tool() with name, description, schema, and handler.
server.tool( "wave_create_clip", "Create a clip from a recorded stream, optionally exporting to social platforms", { stream_id: z.string().uuid().describe("The stream ID to clip from"), start_time: z.number().min(0).describe("Clip start time in seconds"), end_time: z.number().min(0).describe("Clip end time in seconds"), title: z.string().max(255).optional().describe("Clip title"), export_to: z .array(z.enum(["tiktok", "youtube_shorts", "instagram_reels", "twitter"])) .optional() .describe("Social platforms to auto-export to"), }, async ({ stream_id, start_time, end_time, title, export_to }) => { const payload: Record<string, unknown> = { streamId: stream_id, startTime: start_time, endTime: end_time, }; if (title !== undefined) payload["title"] = title; if (export_to !== undefined) payload["exportTo"] = export_to; const res = await waveFetch("/api/v1/clips", { method: "POST", body: JSON.stringify(payload), }); if (!res.ok) return errorContent(res.status, res.body); return textContent(res.body); }, ); - src/server.ts:24-24 (registration)The wave_create_clip tool is registered via registerProductionTools() which is called during server startup.
registerProductionTools(server); - src/tools/production.ts:5-19 (helper)Helper function waveFetch used by the handler to make API calls with auth headers.
async function waveFetch( path: string, init?: RequestInit, ): Promise<{ ok: boolean; status: number; body: string }> { const url = `${getBaseUrl()}${path}`; const res = await fetch(url, { ...init, headers: { ...getAuthHeaders(), ...init?.headers, }, }); const body = await res.text(); return { ok: res.ok, status: res.status, body }; }