Skip to main content
Glama

find_video_path

Locate the exact file path of a video by recursively searching a specified directory. Input the root directory and video file name (with or without extension) to retrieve the first matching video's full path or an empty string if not found.

Instructions

可以查找视频文件路径,查找文件路径,递归查找精确匹配文件名的视频文件路径(支持带或不带扩展名)
参数:
root_path - 要搜索的根目录
video_name - 视频文件名(可以带扩展名,但会忽略扩展名匹配)
返回:
首个匹配的视频文件完整路径,找不到时返回空字符串

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
root_pathYes
video_nameYes

Implementation Reference

  • The @mcp.tool() decorator registers the 'find_video_path' tool with the FastMCP server.
    @mcp.tool()
  • Implements the tool logic: recursively walks the directory tree starting from root_path to find the first video file whose stem matches video_name (case-insensitive), checking against common video extensions, and returns the full path or empty string if not found.
    def find_video_path(root_path, video_name):
        """
        可以查找视频文件路径,查找文件路径,递归查找精确匹配文件名的视频文件路径(支持带或不带扩展名)
        参数:
        root_path - 要搜索的根目录
        video_name - 视频文件名(可以带扩展名,但会忽略扩展名匹配)
        返回:
        首个匹配的视频文件完整路径,找不到时返回空字符串
        """
        VIDEO_EXTS = {'.mp4', '.avi', '.mov', '.mkv', '.flv', '.wmv', '.webm', '.ts'}
        target_stem, target_ext = os.path.splitext(video_name)
        if target_ext.lower() not in VIDEO_EXTS:
            target_stem = f"{target_stem}{target_ext}"
            target_ext = ""
    
        for root, dirs, files in os.walk(root_path):
            for file in files:
                stem, ext = os.path.splitext(file)
                if stem.lower() == target_stem.lower():
                    if (not target_ext or ext.lower() in VIDEO_EXTS):
                        return os.path.join(root, file)
        return ""
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses key behaviors: recursive search, exact filename matching, extension-agnostic matching, returns first match or empty string. However, it lacks details on permissions needed, error handling, performance (e.g., speed for large directories), or system-specific constraints. The description adds value but is incomplete for a tool with mutation-like file access.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by parameter and return details. It uses bullet-like structure for parameters and return value, making it easy to scan. There's minimal redundancy, though the Chinese phrasing '查找文件路径' is slightly repetitive. Overall, it's efficient and well-structured.

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

Completeness3/5

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

Given 2 parameters, no annotations, and no output schema, the description is moderately complete. It covers purpose, parameters, and return value adequately. However, for a tool that accesses filesystem (implied mutation risk), it lacks safety warnings, error details, or output format beyond '完整路径' (full path). With richer context needed for file operations, it's adequate but has clear gaps in behavioral transparency.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It adds meaning for both parameters: 'root_path - 要搜索的根目录' (root directory to search) and 'video_name - 视频文件名(可以带扩展名,但会忽略扩展名匹配)' (video filename, extension ignored). This clarifies semantics beyond the schema's basic string types, though it could detail format constraints (e.g., path syntax). With 2 parameters fully explained, it compensates well for the low coverage.

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 tool's purpose: '可以查找视频文件路径,查找文件路径,递归查找精确匹配文件名的视频文件路径(支持带或不带扩展名)' - it specifies the verb (find/locate), resource (video file paths), and scope (recursive search with exact filename matching). It distinguishes from siblings like 'get_video_info' (metadata) or 'play_video' (playback), though not explicitly. The purpose is specific but could be more distinct from generic file search tools.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_video_info' for metadata or 'play_video' for playback, nor does it specify prerequisites or exclusions (e.g., when not to use it). Usage is implied by the purpose but lacks explicit context for selection among video-related tools.

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

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/video-creator/ffmpeg-mcp'

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