suno_get_mp4
Convert a generated song into an MP4 video with visualizations. Provide the audio ID to get a video suitable for social media and video platforms.
Instructions
Get an MP4 video version of a generated song.
Converts a generated audio into an MP4 video file with visualizations.
Useful for sharing on social media or video platforms.
Use this when:
- You want a video version of a generated song
- You need to share the song on video platforms
- You want a visual representation of the audio
Returns:
Task ID and MP4 video information.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_id | Yes | The song ID to get the MP4 video for. This is the 'id' field from a previous audio generation result. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- tools/media_tools.py:13-36 (handler)The MCP tool handler function for 'suno_get_mp4'. Defined as async function decorated with @mcp.tool(). It takes an 'audio_id' parameter (the song ID), calls client.get_mp4() to fetch the MP4 video, and formats the result via format_audio_result().
@mcp.tool() async def suno_get_mp4( audio_id: Annotated[ str, Field( description="The song ID to get the MP4 video for. This is the 'id' field from a previous audio generation result." ), ], ) -> str: """Get an MP4 video version of a generated song. Converts a generated audio into an MP4 video file with visualizations. Useful for sharing on social media or video platforms. Use this when: - You want a video version of a generated song - You need to share the song on video platforms - You want a visual representation of the audio Returns: Task ID and MP4 video information. """ result = await client.get_mp4(audio_id=audio_id) return format_audio_result(result) - core/client.py:188-191 (helper)The client helper method 'get_mp4' on the SunoClient class. It sends a POST request to the '/suno/mp4' endpoint with the audio_id, using an async callback pattern. This is the actual API call that the handler delegates to.
async def get_mp4(self, **kwargs: Any) -> dict[str, Any]: """Get MP4 video for a song.""" logger.info(f"🎥 Getting MP4 for audio: {kwargs.get('audio_id', '')}") return await self.request("/suno/mp4", self._with_async_callback(kwargs)) - core/utils.py:77-90 (helper)The 'format_audio_result' helper used by the handler to format the API response into a JSON string with submission/async polling guidance.
def format_audio_result(data: dict[str, Any]) -> str: """Format audio generation result as JSON. Args: data: API response dictionary Returns: JSON string representation of the result """ return json.dumps( _with_submission_guidance(data, "suno_get_task", "suno_get_tasks_batch"), ensure_ascii=False, indent=2, ) - main.py:258-261 (registration)Registration of 'suno_get_mp4' in the HTTP server card tool list (line 259). Also registered via @mcp.tool() decorator in media_tools.py.
{ "name": "suno_get_mp4", "description": "Get MP4 video of a generated song", },