makereels-mcp
Version:
MakeReels MCP Server
78 lines (77 loc) • 3.13 kB
JavaScript
import z from "zod";
import { createTool } from "./utils.js";
import { createAuthedClient } from "../lib/api.js";
import { BASE_URL } from "../config.js";
export const create_reel_tool = createTool({
id: "create_reel",
name: "Create Reel",
description: "Create a short form video",
inputSchema: z.object({
reelData: z.object({
title: z.object({
text: z
.string()
.describe("Will be displayed at the beginning of the reel. Should be catchy and short between 10 to 16 words. Eg, `The 5 best ways to lose weight`."),
bgLookupKeyword: z
.string()
.describe("Keyword to lookup title background image"),
}),
contents: z
.array(z.object({
text: z
.string()
.describe("Main content of the reel (each item about 15 - 18 words)"),
bgLookupKeyword: z
.string()
.describe("Keyword to lookup background image"),
}))
.max(5)
.min(3),
endText: z.object({
text: z
.string()
.describe("Will be displayed at the end of the reel. Should be catchy and short between 10 to 16 words. Eg, `Subscribe to our channel`."),
bgLookupKeyword: z
.string()
.describe("Keyword to lookup end text background image"),
}),
language: z
.string()
.min(2)
.max(2)
.default("en")
.describe("Preferred language for the video (eg: en, es, fr, etc.)"),
contentNumbering: z
.object({
style: z
.enum([
"border-square",
"border-circle",
"solid-square",
"solid-circle",
])
.default("solid-circle")
.describe("Preferred numbering style"),
type: z
.enum(["cap-alphabet", "small-alphabet", "numeric", "stepped"])
.default("numeric")
.describe("Preferred numbering type"),
reversed: z
.boolean()
.describe("Whether to reverse the numbering (eg. reversed = 5 4 3 2 1 | not reversed = 1 2 3 4 5)"),
sound: z
.boolean()
.describe("Whether to play a sound when the numbering is shown"),
})
.optional(),
}),
}),
execute: async (args) => {
const api = createAuthedClient();
const response = await api.post("/reels/create-structured-reel", args.reelData);
return {
message: `Reel created successfully. You can edit the reel or publish it to your channel.`,
editUrl: `${BASE_URL}/reels/${response.data.reel._id}`,
};
},
});