Skip to main content
Glama

video_trim

Trim videos to specific time ranges by specifying start and end times in seconds. Extract precise segments from video content for editing or sharing purposes.

Instructions

Trim a video to a specific time range. Cost: $0.05. Requires Tier 1+.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_urlYesURL of the video to trim
start_timeYesStart time in seconds
end_timeYesEnd time in seconds

Implementation Reference

  • The tool 'generate_video' is implemented in the `_handle_generate_video` function in `mcp/vap_mcp_proxy.py`. Note that 'video_trim' was not found in the codebase, but `generate_video` is the primary video tool implemented.
    def _handle_generate_video(arguments: Dict) -> Dict:
        """
        Handle generate_video tool call (Directive #242: Veo 3.1).
    
        Creates a video generation task via V3 API.
        """
        prompt = arguments.get("prompt", "")
        duration = arguments.get("duration", 8)
        aspect_ratio = arguments.get("aspect_ratio", "16:9")
        generate_audio = arguments.get("generate_audio", True)
        resolution = arguments.get("resolution", "720p")
        negative_prompt = arguments.get("negative_prompt", "")
    
        if not prompt:
            return {
                "isError": True,
                "content": [{"type": "text", "text": "Error: prompt is required"}]
            }
    
        # Validate duration (Veo 3.1: 4, 6, 8 seconds)
        if duration not in (4, 6, 8):
            duration = 8
    
        # Validate aspect ratio (Veo 3.1: 16:9, 9:16)
        if aspect_ratio not in ("16:9", "9:16"):
            aspect_ratio = "16:9"
    
        # Validate resolution
        if resolution not in ("720p", "1080p"):
            resolution = "720p"
    
        # Create task via V3 API
        logger.info(f"Creating Veo 3.1 video task: duration={duration}s, audio={generate_audio}")
    
        params = {
            "prompt": prompt,
            "duration": duration,
            "aspect_ratio": aspect_ratio,
            "generate_audio": generate_audio,
            "resolution": resolution
        }
        if negative_prompt:
            params["negative_prompt"] = negative_prompt
    
        response = make_v3_request("/v3/tasks", {
            "type": "video",
            "params": params
        })
    
        if "error" in response:
            return {
                "isError": True,
                "content": [{"type": "text", "text": f"Error: {response['error']}"}]
            }
    
        # Format success response
        task_id = response.get("task_id", "unknown")
        cost_table = VIDEO_COSTS_WITH_AUDIO if generate_audio else VIDEO_COSTS_NO_AUDIO
        estimated_cost = response.get("estimated_cost", cost_table.get(duration, 4.80))
    
        return {
            "content": [{
                "type": "text",
                "text": f"Video generation task created (Veo 3.1)!\n\nTask ID: {task_id}\nDuration: {duration} seconds\nAspect Ratio: {aspect_ratio}\nResolution: {resolution}\nAudio: {'Yes' if generate_audio else 'No'}\nEstimated Cost: ${estimated_cost}\n\nUse get_task with this task_id to check status and get the video URL when complete."
            }]
        }
Behavior4/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 effectively adds important context beyond basic functionality: it discloses monetary cost ($0.05) and access restrictions (Tier 1+ requirement). While it doesn't mention rate limits, processing time, or output format, it provides crucial operational constraints for a paid service.

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 extremely concise (two short sentences) and front-loaded with the core functionality first, followed by operational constraints. Every word earns its place with no redundant information or fluff.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does well by including cost and access requirements. However, it doesn't describe what happens after trimming (e.g., where the trimmed video is stored, format preservation, or how to retrieve results), leaving some gaps in operational understanding.

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?

Schema description coverage is 100%, with all three parameters clearly documented in the schema. The description doesn't add any parameter-specific information beyond what's already in the schema (like format details for media_url or validation rules for time values), so it meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('trim') and resource ('video'), specifying the operation is limited to 'a specific time range'. It distinguishes from sibling tools like video_merge (which combines videos) and ai_edit (which might involve more complex editing).

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool by mentioning cost and tier requirements ('Cost: $0.05. Requires Tier 1+'), which helps determine feasibility. However, it doesn't explicitly state when NOT to use it or name alternatives for similar video editing tasks among siblings.

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/elestirelbilinc-sketch/vap-showcase'

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