Skip to main content
Glama

get_video_info

Retrieve detailed metadata and technical specifications from a video file, including resolution, codec, duration, and bitrate, to analyze or process media content effectively.

Instructions

Get detailed information about a video file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the video file

Implementation Reference

  • Switch case in handleToolCall function that executes the get_video_info tool by validating input and calling getVideoInfo helper.
    case "get_video_info": { const filePath = validatePath(String(args?.filePath), true); const info = await getVideoInfo(filePath); return { content: [{ type: "text", text: info }] }; }
  • Tool definition including name, description, and input schema (filePath: string) for get_video_info.
    { name: "get_video_info", description: "Get detailed information about a video file", inputSchema: { type: "object", properties: { filePath: { type: "string", description: "Path to the video file" } }, required: ["filePath"] } },
  • src/index.ts:46-50 (registration)
    Registers the list of available tools via ListToolsRequestHandler, exposing get_video_info schema from toolDefinitions.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions }; });
  • src/index.ts:56-68 (registration)
    Registers the CallToolRequestHandler which dispatches tool calls to handleToolCall based on name, handling get_video_info.
    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}` }] }; } });
  • Implementation of getVideoInfo using ffprobe to fetch JSON-formatted video file information.
    export async function getVideoInfo(filePath: string): Promise<string> { try { validatePath(filePath, true); console.log(`Getting video info for: ${filePath}`); const { stdout, stderr } = await execPromise(`ffprobe -v error -show_format -show_streams -print_format json "${filePath}"`); return stdout || stderr; } catch (error: any) { console.error("FFprobe error:", error.message); if (error.stderr) { return error.stderr; } throw new Error(`FFprobe 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