Skip to main content
Glama

create_event

Create an empty event, assign to a bank, optionally route to a bus. Missing folders in event path are created automatically.

Instructions

Create an empty event, assign it to a bank, optionally route to a bus.

Missing parent folders in event_path are created automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_pathYes
bank_pathYes
bus_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler: creates an event, assigns it to a bank, optionally routes to a bus. Builds JS with _FOLDER_HELPER to ensure ancestor folders exist, then sends it to the FMOD Studio client.
    async def create_event(
        client: StudioClient,
        event_path: str,
        bank_path: str,
        bus_path: str | None = None,
    ) -> dict[str, Any]:
        """Create a new event, assign it to a bank, and optionally route to a bus.
    
        ``event_path`` is the full path including the event name, e.g.
        ``event:/bumpers/hit_soft``. Any missing ancestor folders are created.
        ``bank_path`` like ``bank:/pinball_sound_effects``. ``bus_path`` like
        ``bus:/SFX`` (optional).
        """
        if "/" not in event_path or not event_path.startswith("event:/"):
            raise ValueError("event_path must look like 'event:/folder/name'")
        parent_prefix, _, name = event_path.rpartition("/")
        # Ensure trailing slash on parent for the helper
        parent_with_slash = parent_prefix + "/"
        js = (
            _FOLDER_HELPER
            + f"""
            var parent = __mcp_ensureEventFolder({json.dumps(parent_with_slash)});
            var existing = studio.project.lookup({json.dumps(event_path)});
            if (existing) throw new Error("Event already exists: " + {json.dumps(event_path)});
            var evt = studio.project.create("Event");
            evt.name = {json.dumps(name)};
            evt.folder = parent;
            var bank = studio.project.lookup({json.dumps(bank_path)});
            if (!bank) throw new Error("Bank not found: " + {json.dumps(bank_path)});
            evt.relationships.banks.add(bank);
            var busPath = {json.dumps(bus_path) if bus_path else "null"};
            if (busPath) {{
                var bus = studio.project.lookup(busPath);
                if (!bus) throw new Error("Bus not found: " + busPath);
                try {{ evt.masterTrack.mixerGroup.output = bus; }} catch (e) {{ throw new Error("Could not route to bus: " + e.message); }}
            }}
            return {{ guid: evt.id, path: evt.getPath(), bank: bank.getPath(), bus: busPath }};
        """
        )
        return await client.eval(js)
  • JavaScript helper function __mcp_ensureEventFolder that walks/creates nested EventFolders under the master event folder.
    _FOLDER_HELPER = r"""
    function __mcp_ensureEventFolder(pathPrefix) {
        if (pathPrefix.indexOf("event:/") !== 0) throw new Error("Event path must start with 'event:/'");
        var remainder = pathPrefix.substring("event:/".length);
        if (remainder.charAt(remainder.length - 1) === "/") remainder = remainder.substring(0, remainder.length - 1);
        var segments = remainder.length > 0 ? remainder.split("/") : [];
        var cur = studio.project.workspace.masterEventFolder;
        if (!cur) throw new Error("Could not locate masterEventFolder");
        var builtPath = "event:/";
        for (var i = 0; i < segments.length; i++) {
            var seg = segments[i];
            if (!seg) continue;
            builtPath += seg + "/";
            var next = studio.project.lookup(builtPath);
            if (!next) {
                next = studio.project.create("EventFolder");
                next.name = seg;
                next.folder = cur;
            }
            cur = next;
        }
        return cur;
    }
    """
  • FastMCP @mcp.tool() decorator that registers 'create_event' as an MCP tool, delegating to events.create_event.
    @mcp.tool()
    async def create_event(
        event_path: str,
        bank_path: str,
        bus_path: str | None = None,
    ) -> dict[str, Any]:
        """Create an empty event, assign it to a bank, optionally route to a bus.
    
        Missing parent folders in event_path are created automatically.
        """
        return await events.create_event(_studio(), event_path, bank_path, bus_path)
  • Input schema defined via function parameters: event_path (str), bank_path (str), bus_path (str | None).
    @mcp.tool()
    async def create_event(
        event_path: str,
        bank_path: str,
        bus_path: str | None = None,
    ) -> dict[str, Any]:
        """Create an empty event, assign it to a bank, optionally route to a bus.
    
        Missing parent folders in event_path are created automatically.
        """
        return await events.create_event(_studio(), event_path, bank_path, bus_path)
  • Test registration confirms 'create_event' is in the expected tool set.
        "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",
    }
    
    
    def test_all_tools_registered():
        tools = set(mcp._tool_manager._tools.keys())
        missing = EXPECTED_TOOLS - tools
        extra = tools - EXPECTED_TOOLS
        assert not missing, f"Missing tools: {missing}"
        assert not extra, f"Unexpected extra tools: {extra}"
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description adds one behavioral detail: auto-creation of missing parent folders in event_path. However, does not disclose idempotency, error handling, or permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with main purpose. Second sentence adds useful behavior. Concise but omits some important details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No annotations, no output schema description. Missing details on return value, error conditions, and prerequisites for a creation tool. Incomplete for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description references parameter names but adds minimal meaning beyond names. Only event_path gains some context from 'missing parent folders created automatically'. No format or constraints explained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Describes creating an empty event and assigning to a bank/bus, clearly indicating the action and resource. Distinguishes from siblings like get_event, list_events, set_event_property.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use versus alternatives like assign_to_bank or assign_to_bus separately. Does not mention prerequisites or when not to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jmperez127/fmod-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server