GameFoundry

Help Center/Code & engines

Long-running MCP generations — music and 3D

Music and 3D generations run asynchronously through MCP. Your agent submits the job and polls for the result rather than blocking.

Some AI generations take longer than most MCP clients wait before timing out. Music tracks run 30-90 seconds and 3D models 60-180 seconds. To make these reliable, GameFoundry uses a submit-then-poll pattern for both.

When your agent calls generate_music or generate_3d_model, it gets back { job_id, status: "starting" } almost immediately. Credits are charged at submission. The agent then calls get_generation_job every few seconds until it returns status: "succeeded" with the R2 URL for the audio or GLB file.

Polling is free. The first successful poll persists the output and writes the Generation row; subsequent polls with the same job_id return the cached result without re-work. If the provider fails terminally, the first poll that observes it fires an automatic refund back to your credit balance.

Tip

Ask your agent "generate the music track and tell me when it is ready" — the polling loop is invisible to you, and your agent will surface the result the moment it comes back.