Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

trim-video

Cut video clips to specific start and end timestamps using a URL. Specify exact time ranges in HH:MM:SS format to extract segments.

Instructions

Trim videos to a specific duration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
videoUrlYesURL of the video
startTimestampYesStart time in HH:MM:SS
endTimestampYesEnd time in HH:MM:SS

Implementation Reference

  • Handler function that proxies the trim-video request to the external Dumpling AI API endpoint, authenticates with API key, and returns the response as MCP content.
    async ({ videoUrl, startTimestamp, endTimestamp }) => {
      const apiKey = process.env.DUMPLING_API_KEY;
      if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
      const response = await fetch(`${NWS_API_BASE}/api/v1/trim-video`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        body: JSON.stringify({
          videoUrl,
          startTimestamp,
          endTimestamp,
          requestSource: "mcp",
        }),
      });
      if (!response.ok)
        throw new Error(`Failed: ${response.status} ${await response.text()}`);
      const data = await response.json();
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • Zod schema defining the input parameters for the trim-video tool: video URL and start/end timestamps.
    {
      videoUrl: z.string().url().describe("URL of the video"),
      startTimestamp: z.string().describe("Start time in HH:MM:SS"),
      endTimestamp: z.string().describe("End time in HH:MM:SS"),
    },
  • src/index.ts:622-651 (registration)
    Registration of the 'trim-video' tool using server.tool(), including name, description, input schema, and handler function.
    server.tool(
      "trim-video",
      "Trim videos to a specific duration.",
      {
        videoUrl: z.string().url().describe("URL of the video"),
        startTimestamp: z.string().describe("Start time in HH:MM:SS"),
        endTimestamp: z.string().describe("End time in HH:MM:SS"),
      },
      async ({ videoUrl, startTimestamp, endTimestamp }) => {
        const apiKey = process.env.DUMPLING_API_KEY;
        if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
        const response = await fetch(`${NWS_API_BASE}/api/v1/trim-video`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({
            videoUrl,
            startTimestamp,
            endTimestamp,
            requestSource: "mcp",
          }),
        });
        if (!response.ok)
          throw new Error(`Failed: ${response.status} ${await response.text()}`);
        const data = await response.json();
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );

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/DumplingAI/mcp-server-dumplingai'

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