Skip to main content
Glama

convert_video

Convert video files to different formats using FFmpeg capabilities. Specify input and output paths, with optional FFmpeg settings for customized conversions.

Instructions

Convert a video file to a different format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputPathYesPath to the input video file
optionsNoAdditional FFmpeg options (optional)
outputPathYesPath for the output video file

Implementation Reference

  • Executes the convert_video tool: validates paths, ensures output directory, builds FFmpeg command with input, options, output, runs it, and returns completion message with result.
    case "convert_video": { const inputPath = validatePath(String(args?.inputPath), true); const outputPath = validatePath(String(args?.outputPath)); const options = String(args?.options || ""); await ensureDirectoryExists(outputPath); const command = `-i "${inputPath}" ${options} "${outputPath}" -y`; const result = await runFFmpegCommand(command); return { content: [{ type: "text", text: `Video conversion completed: ${inputPath} → ${outputPath}\n\n${result}` }] }; } case "extract_audio": {
  • Defines the input schema for the convert_video tool, specifying required inputPath and outputPath parameters, and optional FFmpeg options.
    { name: "convert_video", description: "Convert a video file to a different format", inputSchema: { type: "object", properties: { inputPath: { type: "string", description: "Path to the input video file" }, outputPath: { type: "string", description: "Path for the output video file" }, options: { type: "string", description: "Additional FFmpeg options (optional)" } }, required: ["inputPath", "outputPath"] } },
  • src/index.ts:46-50 (registration)
    Registers all tools, including convert_video, by providing the toolDefinitions in response to ListTools requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions }; });
  • src/index.ts:56-68 (registration)
    Registers the general tool call handler which routes 'convert_video' calls to the specific handler function based on the tool name.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { try { return await handleToolCall(request.params.name, request.params.arguments); } catch (error: any) { console.error("Tool execution error:", error.message); return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } });

Other Tools

Related 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/sworddut/mcp-ffmpeg-helper'

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