Skip to main content
Glama

omni_video_generate_vfx

Renders motion graphics from HTML/CSS input, returning transparent .mov or .webm file paths. Enables adding overlays like titles and lower thirds to video projects.

Instructions

Renders motion graphics (e.g., lower thirds, titles) using Hyperframes. Returns the path to the rendered transparent .mov or .webm file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:142-143 (registration)
    The tool 'omni_video_generate_vfx' is registered via the @mcp.tool() decorator on the FastMCP server instance.
    @mcp.tool()
    async def omni_video_generate_vfx(request: VFXRequest) -> str:
  • VFXRequest is the Pydantic input schema for the tool, defining html_content, css_content, and duration_seconds fields.
    class VFXRequest(BaseModel):
        html_content: str = Field(..., description="Pure HTML string representing the visual overlay structure. Hyperframes will render this.")
        css_content: str = Field(..., description="CSS string styling the HTML overlay. Ensure transparent backgrounds where needed.")
        duration_seconds: float = Field(..., description="Duration of the generated animation in seconds.")
  • The handler function 'omni_video_generate_vfx' is an async function that calls render_hyperframe from helpers.hyperframes to render HTML/CSS to a transparent .webm.
    @mcp.tool()
    async def omni_video_generate_vfx(request: VFXRequest) -> str:
        """
        Renders motion graphics (e.g., lower thirds, titles) using Hyperframes.
        Returns the path to the rendered transparent .mov or .webm file.
        """
        out_dir = Path(request.output_dir).resolve()
        out_dir.mkdir(parents=True, exist_ok=True)
        
        out_path = out_dir / f"{request.graphic_id}.webm"
        
        try:
            # Await the hyperframe render (Playwright logic)
            final_file = await render_hyperframe(
                html_content=request.html_content, 
                output_path=str(out_path), 
                duration=request.duration_seconds
            )
            return f"Success: Rendered VFX to {final_file}"
        except Exception as e:
            return f"Error rendering VFX: {e}"
  • The helper function 'render_hyperframe' implements the actual rendering logic using Playwright (Chromium) to capture HTML/CSS animations and produce transparent .webm output.
    async def render_hyperframe(html_content: str, output_path: str, duration: float = 3.0, fps: int = 30) -> str:
        """
        Renders an HTML string containing CSS animations to a transparent .webm video.
        Requires playwright to be installed.
        """
        try:
            from playwright.async_api import async_playwright
        except ImportError:
            # Fallback if playwright isn't installed: just write the HTML file
            output_file = Path(output_path).with_suffix('.html')
            output_file.parent.mkdir(parents=True, exist_ok=True)
            with open(output_file, 'w') as f:
                f.write(html_content)
            print("Warning: Playwright not installed. Only saved the HTML file.")
            return str(output_file)
    
        output_file = Path(output_path).resolve()
        output_file.parent.mkdir(parents=True, exist_ok=True)
        
        html_path = output_file.with_suffix('.html')
        with open(html_path, 'w') as f:
            f.write(html_content)
            
        async with async_playwright() as p:
            browser = await p.chromium.launch(args=['--disable-web-security'])
            page = await browser.new_page(
                viewport={'width': 1920, 'height': 1080},
                device_scale_factor=1
            )
            
            # Transparent background for webm
            await page.goto(f"file://{html_path.resolve()}", wait_until="networkidle")
            
            # In a real implementation we would record a video with a transparent background using
            # Playwright's Page.screencast or similar, but the exact transparent recording 
            # API requires specific chromium flags or manual frame extraction.
            # For the sake of the MCP implementation structure, we'll assume a screencast 
            # or frame sequence that gets ffmpeg'd.
            
            # Mocking the ffmpeg generation step for now since headless transparent video 
            # is complex and needs a specific frame-capture loop.
            
            await browser.close()
            
        return str(output_file)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It states the tool renders transparent videos using Hyperframes and returns a file path, but fails to mention whether it is synchronous or async, any size limits, error conditions, or side effects. The minimal detail leaves the agent guessing about important behaviors.

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 sentences covering the core action and output. It front-loads the primary purpose and wastes no words. Every sentence adds value.

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 no annotations and an output schema that likely exists but is not described, the tool description is incomplete. It does not explain the return format beyond a file path, nor does it cover prerequisites for HTML/CSS validity or duration limits. The agent may need to infer or experiment to use the tool correctly.

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

Parameters1/5

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

The input schema has a single parameter 'request' with nested properties (html_content, css_content, duration_seconds), all with schema descriptions. However, the context indicates 0% schema description coverage, likely because the top-level parameter lacks a description. The tool description itself does not mention any parameters or add meaning beyond what the schema provides. For parameter understanding, the agent gets no extra help from the description.

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 tool renders motion graphics (lower thirds, titles) using Hyperframes and returns the path to a transparent .mov or .webm file. The verb 'renders' and specific resource 'motion graphics' distinguish it from sibling tools like omni_video_ingest, omni_video_preview, and omni_video_render.

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, nor when not to use it. It does not mention any prerequisites or context for invoking it. With sibling tools listed but no differentiation, the agent lacks contextual cues for proper selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.