get_event
Retrieve tracks, instruments, and bank assignments for a specific event in FMOD Studio using AI coding agents.
Instructions
Return tracks, instruments, and bank assignments for one event.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- fmod_mcp/tools/discovery.py:72-106 (handler)The core handler for get_event — builds a JavaScript snippet that uses studio.project.lookup() to find the event by path, then extracts tracks (master + group), modules (with audioFile and loopMode), and assigned banks. Returns path, guid, name, tracks, and banks as a dict.
async def get_event(client: StudioClient, event_path: str) -> dict[str, Any]: """Return tracks, instruments, and bank/bus assignments for a single event.""" js = f""" var evt = studio.project.lookup({json.dumps(event_path)}); if (!evt) throw new Error("No object at path: " + {json.dumps(event_path)}); if (evt.entity !== "Event") throw new Error("Not an event: " + {json.dumps(event_path)} + " (is " + evt.entity + ")"); var tracks = []; var allTracks = []; if (evt.masterTrack) allTracks.push(evt.masterTrack); if (evt.groupTracks) for (var i = 0; i < evt.groupTracks.length; i++) allTracks.push(evt.groupTracks[i]); allTracks.forEach(function(t) {{ var mods = []; if (t.modules) for (var j = 0; j < t.modules.length; j++) {{ var m = t.modules[j]; var info = {{ type: m.entity || null, guid: m.id || null }}; try {{ if (m.audioFile) info.audioFile = m.audioFile.getPath ? m.audioFile.getPath() : String(m.audioFile.id); }} catch (e) {{}} try {{ if (typeof m.loopMode !== 'undefined') info.loopMode = m.loopMode; }} catch (e) {{}} mods.push(info); }} tracks.push({{ name: t.name || null, guid: t.id || null, modules: mods }}); }}); var banks = []; try {{ var dests = evt.relationships && evt.relationships.banks ? evt.relationships.banks.destinations : null; if (dests && dests.length) for (var k = 0; k < dests.length; k++) banks.push(dests[k].getPath()); }} catch (e) {{}} return {{ path: evt.getPath(), guid: evt.id, name: evt.name, tracks: tracks, banks: banks }}; """ return await client.eval(js) - fmod_mcp/server.py:59-62 (handler)FastMCP tool registration — decorates an async function with @mcp.tool() that delegates to discovery.get_event(). Defines the public tool signature (event_path: str) and docstring.
@mcp.tool() async def get_event(event_path: str) -> dict[str, Any]: """Return tracks, instruments, and bank assignments for one event.""" return await discovery.get_event(_studio(), event_path) - fmod_mcp/tools/discovery.py:72-106 (schema)Input: event_path (str). Output: dict with keys path (str), guid (str), name (str), tracks (list of dicts with name, guid, modules), banks (list of bank paths).
async def get_event(client: StudioClient, event_path: str) -> dict[str, Any]: """Return tracks, instruments, and bank/bus assignments for a single event.""" js = f""" var evt = studio.project.lookup({json.dumps(event_path)}); if (!evt) throw new Error("No object at path: " + {json.dumps(event_path)}); if (evt.entity !== "Event") throw new Error("Not an event: " + {json.dumps(event_path)} + " (is " + evt.entity + ")"); var tracks = []; var allTracks = []; if (evt.masterTrack) allTracks.push(evt.masterTrack); if (evt.groupTracks) for (var i = 0; i < evt.groupTracks.length; i++) allTracks.push(evt.groupTracks[i]); allTracks.forEach(function(t) {{ var mods = []; if (t.modules) for (var j = 0; j < t.modules.length; j++) {{ var m = t.modules[j]; var info = {{ type: m.entity || null, guid: m.id || null }}; try {{ if (m.audioFile) info.audioFile = m.audioFile.getPath ? m.audioFile.getPath() : String(m.audioFile.id); }} catch (e) {{}} try {{ if (typeof m.loopMode !== 'undefined') info.loopMode = m.loopMode; }} catch (e) {{}} mods.push(info); }} tracks.push({{ name: t.name || null, guid: t.id || null, modules: mods }}); }}); var banks = []; try {{ var dests = evt.relationships && evt.relationships.banks ? evt.relationships.banks.destinations : null; if (dests && dests.length) for (var k = 0; k < dests.length; k++) banks.push(dests[k].getPath()); }} catch (e) {{}} return {{ path: evt.getPath(), guid: evt.id, name: evt.name, tracks: tracks, banks: banks }}; """ return await client.eval(js)