Skip to main content
Glama

getVideoInfo

Extract video metadata like duration, resolution, and format details from files to analyze content properties and verify specifications.

Instructions

获取视频文件的详细信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYes视频文件路径

Implementation Reference

  • MCP tool handler that receives arguments, calls VideoEngine.getVideoInfo, and returns the result as a formatted text response.
    private async handleGetVideoInfo(args: MCPToolParams['getVideoInfo']) {
      const result = await this.videoEngine.getVideoInfo(args.filePath);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Core implementation using FFprobe to extract comprehensive video metadata including duration, dimensions, FPS, bitrate, container format, video codec, and file size.
    public async getVideoInfo(filePath: string): Promise<VideoInfo> {
      return new Promise((resolve, reject) => {
        ffmpeg.ffprobe(filePath, (err: any, metadata: any) => {
          if (err) {
            reject(new Error(`获取视频信息失败: ${err.message}`));
            return;
          }
    
          const videoStream = metadata.streams.find((s: any) => s.codec_type === 'video');
          if (!videoStream) {
            reject(new Error('未找到视频流'));
            return;
          }
    
          const audioStream = metadata.streams.find((s: any) => s.codec_type === 'audio');
          
          resolve({
            duration: metadata.format.duration || 0,
            width: videoStream.width || 0,
            height: videoStream.height || 0,
            fps: this.parseFps(videoStream.r_frame_rate || '0/1'),
            bitrate: parseInt(metadata.format.bit_rate || '0'),
            format: metadata.format.format_name || '',
            codec: videoStream.codec_name || '',
            size: parseInt(metadata.format.size || '0')
          });
        });
      });
    }
  • Tool registration definition including name, description, and JSON input schema requiring 'filePath'.
    {
      name: 'getVideoInfo',
      description: '获取视频文件的详细信息',
      inputSchema: {
        type: 'object',
        properties: {
          filePath: {
            type: 'string',
            description: '视频文件路径'
          }
        },
        required: ['filePath']
      }
    },
  • TypeScript type definition for getVideoInfo input parameters.
    getVideoInfo: {
      filePath: string;
    };
  • TypeScript type definition for getVideoInfo output returning VideoInfo.
    getVideoInfo: VideoInfo;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves—such as whether it's read-only, what kind of information is returned, error handling, or performance characteristics. This leaves significant gaps for a tool that presumably reads and processes video metadata.

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?

The description is a single, efficient sentence in Chinese that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns complex video metadata. It doesn't hint at the structure or type of information returned (e.g., duration, resolution, codec), which could be critical for an agent to understand the tool's utility and integration into workflows.

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?

The schema description coverage is 100%, with the single parameter 'filePath' clearly documented in the schema as '视频文件路径' (video file path). The description doesn't add any additional meaning beyond this, such as format examples or constraints, but the schema provides adequate baseline information.

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

Purpose4/5

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

The description clearly states the verb ('获取' meaning 'get') and resource ('视频文件的详细信息' meaning 'detailed information of video files'), making the purpose immediately understandable. It doesn't specifically distinguish from siblings like 'getTaskStatus' or 'getSupportedFormats', but the focus on video file details is reasonably clear.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context for usage, or differentiate it from sibling tools like 'getTaskStatus' or 'getSupportedFormats', leaving the agent to infer appropriate usage scenarios.

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/pickstar-2002/video-clip-mcp'

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