build_banks
Build audio banks for the default platform in FMOD Studio via TCP scripting, compiling imported sounds and events into deployable assets.
Instructions
Build banks for the default platform. Can take a minute or two.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- fmod_mcp/tools/project.py:18-35 (handler)Core handler that executes the FMOD Studio project build via JavaScript eval and collects built bank paths.
async def build_banks(client: StudioClient) -> dict[str, Any]: """Build banks for the currently open project. Uses Studio's default build platform (the one selected in the project preferences). Returns the list of bank paths that were built, if Studio exposes them; otherwise just a success flag. """ js = """ studio.project.build(); var banks = []; try { var all = studio.project.model.Bank.findInstances(); for (var i = 0; i < all.length; i++) banks.push(all[i].getPath()); } catch (e) {} return { ok: true, built: true, banks: banks }; """ # Building can take a while on large projects; allow 10 minutes. return await client.eval(js, timeout=600.0) - fmod_mcp/server.py:190-193 (registration)MCP tool registration that wraps the project.build_banks handler as a FastMCP tool.
@mcp.tool() async def build_banks() -> dict[str, Any]: """Build banks for the default platform. Can take a minute or two.""" return await project.build_banks(_studio()) - Test asserting that build_banks is registered as a tool on the MCP server.
EXPECTED_TOOLS = { # discovery "ping", "list_banks", "list_events", "list_buses", "get_event", # audio + events "import_audio", "create_event", "add_single_sound", "set_event_property", "assign_to_bank", "assign_to_bus", # effects "list_effect_types", "add_effect", "list_effects", "get_effect", "set_effect_param", "remove_effect", "bypass_effect", # project "save_project", "build_banks", # escape "run_js", } - tests/test_tools.py:183-187 (helper)Unit test for the build_banks tool, verifying it sends correct JS and returns expected result.
async def test_build_banks(client: StudioClient, mock_studio: MockStudio): mock_studio.responder = responder_sequence([("OK", {"ok": True, "built": True, "banks": ["bank:/Master"]})]) result = await project.build_banks(client) assert result["built"] is True assert "studio.project.build" in _last_sent_js(mock_studio)