Skip to main content
Glama
ilhankilic

YaparAI MCP Server

by ilhankilic

generate_music_video

Describe a genre, mood, or theme to produce an original music track and matching video. The AI composes music and visuals that align with your input.

Instructions

Generate a music video — AI music + video combined.

Creates both an original music track and a matching video in one go. The AI composes music and generates visuals that match the mood. Cost: ~364 credits (music + video).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the music video (genre, mood, theme)
styleNoMusic genre (pop, rock, electronic, classical, lo-fi, ambient)pop

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function for the generate_music_video tool. It takes a prompt and style (pop/rock/electronic/classical/lo-fi/ambient), sends a request to the YaparAI API with mode 'suno_music_video', waits for the result, and returns a dict with video_url, job_id, credits_used, and balance_remaining.
    async def generate_music_video(
        prompt: str,
        style: Literal["pop", "rock", "electronic", "classical", "lo-fi", "ambient"] = "pop",
    ) -> dict:
        """
        Generate a music video — AI music + video combined.
    
        Creates both an original music track and a matching video in one go.
        The AI composes music and generates visuals that match the mood.
        Cost: ~364 credits (music + video).
    
        Args:
            prompt: Description of the music video (genre, mood, theme)
            style: Music genre (pop, rock, electronic, classical, lo-fi, ambient)
    
        Returns:
            Dict with video_url, job_id, credits_used, and balance_remaining.
        """
        client = YaparAIClient()
        full_prompt = f"[{style}] {prompt}" if style else prompt
    
        job = await client.generate({
            "type": "music",
            "prompt": full_prompt,
            "mode": "suno_music_video",
        })
    
        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"),
        }
  • Registration of the generate_music_video tool with the FastMCP server via mcp.tool(generate_music_video).
    mcp.tool(generate_music_video)
  • Import of generate_music_video from yaparai.tools.generate into the server module.
    from yaparai.tools.generate import (
        generate_image,
        generate_video,
        generate_music,
        generate_music_video,
    )
  • The YaparAIClient.generate() method used by the handler to start the generation job.
    async def generate(self, request: dict) -> dict:
        """Start a generation job."""
        return await self._request("POST", "/v1/public/generate", json=request)
  • The YaparAIClient.wait_for_result() method used by the handler to poll for job completion.
    async def wait_for_result(
        self,
        job_id: str,
        timeout: int = 120,
        poll_interval: int = 3,
    ) -> dict:
        """Poll job status until completed or timeout."""
        elapsed = 0
        while elapsed < timeout:
            job = await self.get_job(job_id)
            status = job.get("status", "")
            if status == "succeeded":
                return job
            if status == "failed":
                error = job.get("error_message") or job.get("error") or "Unknown error"
                raise RuntimeError(f"Generation failed: {error}")
            await asyncio.sleep(poll_interval)
            elapsed += poll_interval
        raise TimeoutError(
            f"Job {job_id} is still processing after {timeout}s. "
            f"Use get_job_status('{job_id}') to check later."
        )
Behavior3/5

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

Discloses cost and that music and video are generated together, but lacks details on rate limits, authentication needs, asynchronous behavior, or output format. With no annotations, more transparency expected.

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?

Four sentences, first sentence clear and direct. No redundancy, but slightly verbose in later sentences. Efficient overall.

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?

Adequately covers key aspects: combined output, cost, parameter purposes. Could mention output format but output schema exists so not required. Reasonably complete for tool with two params.

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 coverage is 100% and descriptions are clear. Description adds no new parameter information beyond schema. Baseline 3 is appropriate.

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?

Clearly states verb 'generate' and resource 'music video', and differentiates from siblings generate_music and generate_video by emphasizing combined creation. Distinction is explicit and unambiguous.

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?

Implies usage for combined music+video creation, mentions cost, but does not explicitly state when to use alternatives or when not to use. No exclusion criteria provided.

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