Skip to main content
Glama
jneless
by jneless

tos_video_info

Retrieve video metadata and details from TOS object storage by specifying bucket name and object key for media processing workflows.

Instructions

获取视频信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes存储桶名称
object_keyYes视频对象键名

Implementation Reference

  • The core handler function implementing tos_video_info tool logic. Uses TOS SDK to fetch video information via process='video/info', parses JSON response, handles errors, and returns formatted metadata.
    async def video_info(args: Dict[str, Any]) -> List[TextContent]:
        """获取视频信息"""
        bucket_name = args["bucket_name"]
        object_key = args["object_key"]
        
        try:
            # 使用 get_object 方法通过 style 参数获取视频信息
            # 设置处理参数为 video/info
            resp = tos_client.get_object(bucket_name, object_key, process="video/info")
            video_info_data = resp.read().decode('utf-8')
            
            # 尝试解析JSON响应
            try:
                video_info_json = json.loads(video_info_data)
                result = {
                    "bucket": bucket_name,
                    "key": object_key,
                    "video_info": video_info_json,
                    "status": "success"
                }
            except json.JSONDecodeError:
                # 如果不是JSON格式,直接返回原始数据
                result = {
                    "bucket": bucket_name,
                    "key": object_key,
                    "video_info": video_info_data,
                    "status": "success",
                    "note": "返回原始格式数据"
                }
            
            return [TextContent(type="text", text=json.dumps(result, indent=2, ensure_ascii=False))]
        except Exception as e:
            return [TextContent(type="text", text=f"获取视频信息失败: {str(e)}")]
  • Input schema validation for tos_video_info tool, defining properties and requirements for bucket_name and object_key parameters.
    inputSchema={
        "type": "object",
        "properties": {
            "bucket_name": {
                "type": "string",
                "description": "存储桶名称"
            },
            "object_key": {
                "type": "string",
                "description": "视频对象键名"
            }
        },
        "required": ["bucket_name", "object_key"]
    }
  • Registers the tos_video_info tool in the MCP server's list_tools() by defining its Tool object with name, description, and schema.
    Tool(
        name="tos_video_info",
        description="获取视频信息",
        inputSchema={
            "type": "object",
            "properties": {
                "bucket_name": {
                    "type": "string",
                    "description": "存储桶名称"
                },
                "object_key": {
                    "type": "string",
                    "description": "视频对象键名"
                }
            },
            "required": ["bucket_name", "object_key"]
        }
    )
  • Tool dispatching logic in call_tool() that routes tos_video_info calls to the video_info handler function.
    elif name == "tos_video_info":
        return await video_info(arguments)
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 only states the action ('获取视频信息') without detailing traits like whether it's read-only (implied but not explicit), what permissions are needed, rate limits, error handling, or the format of returned information. This is inadequate for a tool with parameters and no output schema.

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 a single phrase ('获取视频信息'), which is appropriately concise and front-loaded with the core action. However, it's overly brief, bordering on under-specification, as it lacks necessary details for a tool with parameters and no output schema, slightly reducing its effectiveness.

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 tool has 2 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what video information is returned (e.g., metadata, duration, format), how errors are handled, or any behavioral context. This leaves significant gaps for an agent to invoke the tool correctly.

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 clear descriptions for 'bucket_name' and 'object_key' in the input schema. The description adds no additional meaning beyond the schema, such as explaining how these parameters relate to video retrieval or any constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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

Purpose3/5

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

The description '获取视频信息' (Get video information) states a clear verb ('获取' - get) and resource ('视频信息' - video information), but it's vague about what specific information is retrieved. It doesn't distinguish this tool from sibling tools like 'tos_image_info' or 'tos_get_object', which suggests similar information retrieval for different resources.

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 prerequisites (e.g., needing a bucket and object key), exclusions, or comparisons to sibling tools like 'tos_get_object' (which might handle general objects) or 'tos_video_snapshot' (which might extract frames). This leaves the agent without context for selection.

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/jneless/tos-mcp'

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