A video that is not ready when the MCP server stops waiting: get_generation

All in One AIAI Video & Voice·· 7 views· 3 min read

In short: the generate_* tools of the MCP server wait up to about 50 seconds. Many videos take longer. In that case, the tool returns the generation id, and the video keeps being made on the server. To get it, ask the agent to check it with get_generation, which costs nothing.

What happens

1 You ask the agent for the video, for example: "Make a 5-second 720p video of a drone flying over a city at sunset."
2 The agent uses generate_video. If the video is not ready in about 50 seconds, the tool returns the generation id.
3 The generation keeps running on the server, even if the agent has stopped waiting, and it is charged when it finishes.

Asking for the result later

A little later, tell the agent: "Check if the video is ready." It uses get_generation with the id and tells you the status:

Status What it means
processing It is still being made. Ask again in a little while.
completed Ready. The links to the files and the real cost come back.
failed It failed. The reason comes back, nothing is charged and the reservation goes back to your balance.

If you move to another conversation, the agent may no longer know the id. Ask for it as soon as the agent returns it, and keep it.

Do not ask for the same video again. Each generate_video is a new generation, charged separately. For a video that is still being made, always use get_generation.

In Codex: giving the tool time

Codex gives up on a tool after 60 seconds. To give the generation tools their 50 or so seconds with room to spare, put tool_timeout_sec in ~/.codex/config.toml:

[mcp_servers.mozout-ai]
url = "https://api.mozout.co.mz/mcp"
bearer_token_env_var = "MOZOUT_API_KEY"
tool_timeout_sec = 120

Without the agent

The same id works in the aio command, which also downloads the files, and in the API, at GET /v1/media/generations/{id}:

aio status <id>
aio status <id> --download --out videos/

The file links are not permanent. When the video is ready, ask the agent to download it into the project. See keeping your AI videos and voice files.

Want to see what each second of video costs before you ask? It is in All in One AI.

See All in One AI

SEE ALSO

The All in One AI MCP server: images, video and voice inside Claude Code, Codex and ChatGPT

An AI video or voice is taking long or has failed: the statuses and what to do

Keeping your AI videos and voice files: download them, the links are not permanent

Asking for an image inside ChatGPT or Claude Code with the MCP generate_image tool

All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 396,00 MT/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.