Skip to main content
Glama
lumiclip

mcp-lumiclip

Official

generate_clips

Generate AI clips from a YouTube video. Specify optional start/end times for a segment. Returns project ID for polling or provide callback URL for webhook notification when clips with download URLs are ready.

Instructions

Start AI clip generation from a YouTube video. Returns a JSON object with project_id (string), status ('processing'), poll_url (string), and estimated_minutes (number). Processing is async -- use get_project_status to poll every 10-15 seconds, or provide a callback_url to receive a webhook POST when all clips are exported with download URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesFull YouTube video URL (e.g. https://www.youtube.com/watch?v=...)
start_timeNoStart time in seconds to clip only a segment of the video. Omit to process the full video.
end_timeNoEnd time in seconds to clip only a segment of the video. Omit to process the full video.
callback_urlNoWebhook URL to receive a POST when processing finishes. The payload includes an array of clips sorted by score, each with a download_url.

Implementation Reference

  • The handler function for the generate_clips tool. It calls the lumiclip API POST /clips/generate with url, start_time, end_time, and callback_url, then returns a JSON object with project_id, status, poll_url, estimated_minutes, and a message.
      async ({ url, start_time, end_time, callback_url }) => {
        try {
          const result = await apiCall(config, "POST", "/clips/generate", {
            url,
            start_time,
            end_time,
            callback_url,
          });
    
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(
                  {
                    project_id: result.project_id,
                    status: "processing",
                    poll_url: result.poll_url,
                    estimated_minutes: result.estimated_minutes,
                    message: callback_url
                      ? "Processing started. A webhook will be sent to your callback_url when ready."
                      : "Processing started. Poll with get_project_status every 10-15 seconds until status is 'completed'.",
                  },
                  null,
                  2
                ),
              },
            ],
          };
        } catch (err: unknown) {
          const message = err instanceof Error ? err.message : String(err);
          return {
            content: [{ type: "text" as const, text: `Error: ${message}` }],
            isError: true,
          };
        }
      }
    );
  • Zod schema for generate_clips tool input: url (required), start_time (optional number), end_time (optional number), callback_url (optional string).
    {
      url: z.string().describe("Full YouTube video URL (e.g. https://www.youtube.com/watch?v=...)"),
      start_time: z
        .number()
        .optional()
        .describe(
          "Start time in seconds to clip only a segment of the video. Omit to process the full video."
        ),
      end_time: z
        .number()
        .optional()
        .describe("End time in seconds to clip only a segment of the video. Omit to process the full video."),
      callback_url: z
        .string()
        .optional()
        .describe(
          "Webhook URL to receive a POST when processing finishes. The payload includes an array of clips sorted by score, each with a download_url."
        ),
    },
  • src/server.ts:47-113 (registration)
    Registration of the generate_clips tool via server.tool() on the McpServer instance, including name, description, zod schema, metadata hints, and handler.
    server.tool(
      "generate_clips",
      "Start AI clip generation from a YouTube video. Returns a JSON object with project_id (string), status ('processing'), poll_url (string), and estimated_minutes (number). Processing is async -- use get_project_status to poll every 10-15 seconds, or provide a callback_url to receive a webhook POST when all clips are exported with download URLs.",
      {
        url: z.string().describe("Full YouTube video URL (e.g. https://www.youtube.com/watch?v=...)"),
        start_time: z
          .number()
          .optional()
          .describe(
            "Start time in seconds to clip only a segment of the video. Omit to process the full video."
          ),
        end_time: z
          .number()
          .optional()
          .describe("End time in seconds to clip only a segment of the video. Omit to process the full video."),
        callback_url: z
          .string()
          .optional()
          .describe(
            "Webhook URL to receive a POST when processing finishes. The payload includes an array of clips sorted by score, each with a download_url."
          ),
      },
      {
        title: "Generate Clips",
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: true,
      },
      async ({ url, start_time, end_time, callback_url }) => {
        try {
          const result = await apiCall(config, "POST", "/clips/generate", {
            url,
            start_time,
            end_time,
            callback_url,
          });
    
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(
                  {
                    project_id: result.project_id,
                    status: "processing",
                    poll_url: result.poll_url,
                    estimated_minutes: result.estimated_minutes,
                    message: callback_url
                      ? "Processing started. A webhook will be sent to your callback_url when ready."
                      : "Processing started. Poll with get_project_status every 10-15 seconds until status is 'completed'.",
                  },
                  null,
                  2
                ),
              },
            ],
          };
        } catch (err: unknown) {
          const message = err instanceof Error ? err.message : String(err);
          return {
            content: [{ type: "text" as const, text: `Error: ${message}` }],
            isError: true,
          };
        }
      }
    );
  • src/http.ts:26-40 (registration)
    Server card registration of the generate_clips tool in the /.well-known/mcp/server-card.json endpoint, providing name, description, and JSON Schema inputSchema.
    {
      name: "generate_clips",
      description:
        "Start AI clip generation from a YouTube video. Returns {project_id, status, poll_url, estimated_minutes}. Poll with get_project_status every 10-15 seconds, or provide a callback_url for webhook notification.",
      inputSchema: {
        type: "object",
        properties: {
          url: { type: "string", description: "Full YouTube video URL (e.g. https://www.youtube.com/watch?v=...)" },
          start_time: { type: "number", description: "Start time in seconds to clip only a segment. Omit to process the full video." },
          end_time: { type: "number", description: "End time in seconds to clip only a segment. Omit to process the full video." },
          callback_url: { type: "string", description: "Webhook URL to receive a POST when all clips are ready with download links." },
        },
        required: ["url"],
      },
    },
  • Helper function used by the generate_clips handler to make HTTP requests to the Lumiclip API with authentication.
    async function apiCall(
      config: ApiConfig,
      method: string,
      path: string,
      body?: unknown
    ) {
      const base = config.apiBase || "https://api.lumiclip.ai";
      const url = `${base}/api/v1${path}`;
      const res = await fetch(url, {
        method,
        headers: {
          Authorization: `Bearer ${config.apiKey}`,
          "Content-Type": "application/json",
        },
        ...(body ? { body: JSON.stringify(body) } : {}),
      });
    
      const data = (await res.json()) as Record<string, unknown>;
    
      if (!res.ok) {
        throw new Error(
          (data.error as string) ||
            (data.message as string) ||
            `API error ${res.status}`
        );
      }
    
      return data;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds context beyond annotations by detailing the return JSON structure (project_id, status, poll_url, estimated_minutes) and the async behavior with optional callback. There is no contradiction with annotations. Minor missing details like error handling or rate limits prevent a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences: first states purpose, second describes return, third explains async usage. Front-loaded with key information, no redundant phrases.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description adequately covers the return structure, async nature, and polling/callback options. Without an output schema, it provides sufficient context for an async job initiation tool. Could mention error responses or limits, but not essential.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and parameters are well-described in the schema. The description does not add significant new meaning beyond what the schema provides, so score remains at baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Start' and the resource 'AI clip generation from a YouTube video', which precisely defines the tool's action. It is easily distinguished from sibling tools like get_clip and get_project_status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly explains that processing is asynchronous and provides two methods for obtaining results: polling via get_project_status every 10-15 seconds or providing a callback_url for a webhook. This gives clear when-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lumiclip/lumiclip-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server