Skip to main content
Glama

assign_to_bus

Route an event's master track output to a specific mixer bus by providing the event path and bus path.

Instructions

Route the event's master track output to a mixer bus.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_pathYes
bus_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of the assign_to_bus tool. Uses studio.project.lookup() to find the event and bus by path, then sets evt.masterTrack.mixerGroup.output = bus to route the event's master track output to the specified mixer bus.
    async def assign_to_bus(
        client: StudioClient,
        event_path: str,
        bus_path: str,
    ) -> dict[str, Any]:
        js = f"""
            var evt = studio.project.lookup({json.dumps(event_path)});
            if (!evt) throw new Error("Event not found: " + {json.dumps(event_path)});
            var bus = studio.project.lookup({json.dumps(bus_path)});
            if (!bus) throw new Error("Bus not found: " + {json.dumps(bus_path)});
            evt.masterTrack.mixerGroup.output = bus;
            return {{ path: evt.getPath(), bus: bus.getPath() }};
        """
        return await client.eval(js)
  • Server-side registration of the assign_to_bus tool via the @mcp.tool() decorator. Wraps the core handler from events module, accepting event_path and bus_path strings, and returns a dict.
    @mcp.tool()
    async def assign_to_bus(event_path: str, bus_path: str) -> dict[str, Any]:
        """Route the event's master track output to a mixer bus."""
        return await events.assign_to_bus(_studio(), event_path, bus_path)
  • The function signature defines the schema: event_path (str) and bus_path (str) as inputs, returning a dict with 'path' and 'bus' keys.
    async def assign_to_bus(
        client: StudioClient,
        event_path: str,
        bus_path: str,
    ) -> dict[str, Any]:
        js = f"""
            var evt = studio.project.lookup({json.dumps(event_path)});
            if (!evt) throw new Error("Event not found: " + {json.dumps(event_path)});
            var bus = studio.project.lookup({json.dumps(bus_path)});
            if (!bus) throw new Error("Bus not found: " + {json.dumps(bus_path)});
            evt.masterTrack.mixerGroup.output = bus;
            return {{ path: evt.getPath(), bus: bus.getPath() }};
        """
        return await client.eval(js)
  • Test registration: 'assign_to_bus' is listed in the EXPECTED_TOOLS set to verify it is properly registered on the server.
        "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}"
  • Test for the assign_to_bus tool, verifying that the JavaScript sent includes 'masterTrack.mixerGroup.output'.
    async def test_assign_to_bus(
        client: StudioClient, mock_studio: MockStudio
    ):
        mock_studio.responder = responder_sequence([("OK", {"path": "event:/a", "bus": "bus:/SFX"})])
        await events.assign_to_bus(client, "event:/a", "bus:/SFX")
        js = _last_sent_js(mock_studio)
        assert "masterTrack.mixerGroup.output" in js
Behavior2/5

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

With no annotations, the description carries full burden. It does not disclose behavior like whether routing replaces existing, effects on other outputs, or error conditions. Output schema exists but is unused in description.

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

Conciseness3/5

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

The description is a single short sentence, making it concise but lacking structure like enumeration of parameters or behavioral 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?

Given no annotations and minimal description, important context is missing: reversibility, prerequisites, return value (despite output schema), and edge cases like non-existent bus or event.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not explain the two parameters (event_path, bus_path) beyond their names. No format, examples, or required structure provided.

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

Purpose5/5

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

The description clearly states the verb 'route', the resource 'event's master track output', and the target 'mixer bus', effectively distinguishing it from sibling tools like add_effect or list_buses.

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 guidance is provided on when to use this tool vs alternatives (e.g., list_buses for checking available buses, create_event for creating events). Missing prerequisites or context.

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