Skip to main content
Glama
ilhankilic

YaparAI MCP Server

by ilhankilic

generate_video

Generate AI videos from text or images using models like Veo 3.1 and Kling. Choose style presets to create cinematic, realistic, or artistic videos.

Instructions

Generate a video using AI.

Text-to-video or image-to-video. Models: Veo 3.1, Kling. Cost: ~350 credits per video.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the video to generate
image_urlNoOptional source image URL (for image-to-video mode)
modelNoModel to use — "auto" (default, picks best), "veo" (Veo 3.1), or "kling" (Kling). Veo 3.1 is best for cinematic quality.auto
styleNoStyle preset (cinematic, realistic, artistic)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the generate_video tool. It accepts a prompt (text-to-video), optional image_url (image-to-video), a model selector (auto/veo/kling), and an optional style. Depending on the model choice and presence of image_url, it sets the 'mode' to 'gemini_video', 'img2video', or 'text2video', then calls the YaparAIClient to submit a generation job and polls for the result.
    async def generate_video(
        prompt: str,
        image_url: str | None = None,
        model: Literal["auto", "veo", "kling"] = "auto",
        style: Literal["cinematic", "realistic", "artistic"] | None = None,
    ) -> dict:
        """
        Generate a video using AI.
    
        Text-to-video or image-to-video. Models: Veo 3.1, Kling.
        Cost: ~350 credits per video.
    
        Args:
            prompt: Description of the video to generate
            image_url: Optional source image URL (for image-to-video mode)
            model: Model to use — "auto" (default, picks best), "veo" (Veo 3.1),
                or "kling" (Kling). Veo 3.1 is best for cinematic quality.
            style: Style preset (cinematic, realistic, artistic)
    
        Returns:
            Dict with video_url, job_id, credits_used, and balance_remaining.
        """
        client = YaparAIClient()
    
        if model == "veo":
            mode = "gemini_video"
        elif image_url:
            mode = "img2video"
        else:
            mode = "text2video"
    
        job = await client.generate({
            "type": "video",
            "prompt": prompt,
            "mode": mode,
            "image_url": image_url,
            "style": style,
        })
    
        result = await client.wait_for_result(job["job_id"], timeout=180)
        return {
            "status": "success",
            "video_url": result.get("result_url"),
            "job_id": result.get("job_id"),
            "credits_used": job.get("credits_used"),
            "balance_remaining": job.get("balance_remaining"),
        }
  • The function signature and docstring for generate_video, defining input parameters (prompt, image_url, model with Literal types, style) and the return type dict with video_url, job_id, credits_used, balance_remaining.
    async def generate_video(
        prompt: str,
        image_url: str | None = None,
        model: Literal["auto", "veo", "kling"] = "auto",
        style: Literal["cinematic", "realistic", "artistic"] | None = None,
    ) -> dict:
  • Import of generate_video from yaparai.tools.generate into the server module.
    generate_video,
  • Registration of generate_video as an MCP tool on the FastMCP server via mcp.tool(generate_video).
    mcp.tool(generate_video)
  • The YaparAIClient.generate method used by generate_video to POST to /v1/public/generate with the job payload.
    async def generate(self, request: dict) -> dict:
        """Start a generation job."""
        return await self._request("POST", "/v1/public/generate", json=request)
Behavior2/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 only discloses cost and model options but omits important behavioral traits like async vs sync, duration, storage, or failure modes. This is a significant gap for a generation tool.

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?

Two sentences, zero wasted words. All information is front-loaded and essential.

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?

The tool has an output schema, so return values need not be explained. However, the description lacks key context like async behavior, duration limits, or storage details, which are important for video generation. It is adequate but not complete.

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%, so the baseline is 3. The description adds context about the two modes and cost, but these are not parameter-specific enhancements beyond what the schema already provides.

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 'Generate a video using AI' and differentiates 'Text-to-video or image-to-video', making the purpose exact. Among siblings like generate_image, generate_music, etc., it is distinctively positioned.

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?

It explains the two modes (text-to-video vs. image-to-video) and mentions cost. While it doesn't explicitly state when not to use or name alternatives, it provides sufficient context for basic usage.

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/ilhankilic/yaparai-mcp'

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