Skip to main content
Glama
bbernstein

LacyLights MCP Server

by bbernstein

suggest_channel_assignment

Optimize channel assignments for multiple lighting fixtures by specifying project details, fixture specifications, and grouping strategies to streamline theatrical lighting design on the LacyLights MCP Server.

Instructions

Suggest optimal channel assignments for multiple fixtures

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fixtureSpecsYesList of fixtures to assign channels for
groupingStrategyNoHow to group fixture assignmentssequential
projectIdYesProject ID
startingChannelNoChannel to start assignments from
universeNoUniverse to assign channels in

Implementation Reference

  • The primary handler function for the 'suggest_channel_assignment' MCP tool. Parses input schema, retrieves project channel map, finds contiguous available channel blocks for each fixture specification, computes assignments sequentially or by grouping strategy, and returns suggested channel ranges with summary and recommendations.
    async suggestChannelAssignment(
      args: z.infer<typeof SuggestChannelAssignmentSchema>,
    ) {
      const {
        projectId,
        fixtureSpecs,
        universe,
        startingChannel,
        groupingStrategy,
      } = SuggestChannelAssignmentSchema.parse(args);
    
      try {
        const channelMap = await this.getChannelMap({ projectId, universe });
        const universeData = channelMap.universes.find(
          (u: any) => u.universe === universe,
        );
    
        if (!universeData) {
          throw new Error(`Universe ${universe} not found in project`);
        }
    
        const assignments = [];
        let currentChannel = startingChannel;
    
        for (const spec of fixtureSpecs) {
          // Estimate channel count (default to 4 if not provided)
          const channelCount = spec.channelCount || 4;
    
          // Find next available channel block
          const availableChannel = this.findNextAvailableChannelBlock(
            universeData.channelUsage,
            currentChannel,
            channelCount,
          );
    
          if (availableChannel + channelCount - 1 > 512) {
            throw new Error(
              `Not enough channels available in universe ${universe} for fixture ${spec.name}`,
            );
          }
    
          assignments.push({
            fixtureName: spec.name,
            manufacturer: spec.manufacturer,
            model: spec.model,
            mode: spec.mode,
            startChannel: availableChannel,
            endChannel: availableChannel + channelCount - 1,
            channelCount,
            channelRange: `${availableChannel}-${availableChannel + channelCount - 1}`,
          });
    
          // Update for next fixture based on grouping strategy
          switch (groupingStrategy) {
            case "sequential":
              currentChannel = availableChannel + channelCount;
              break;
            case "by_type":
              // Group similar fixture types together
              currentChannel = availableChannel + channelCount;
              break;
            case "by_function":
              // Group by function (e.g., all wash lights together)
              currentChannel = availableChannel + channelCount;
              break;
          }
        }
    
        return {
          projectId,
          universe,
          groupingStrategy,
          assignments,
          summary: {
            totalFixtures: assignments.length,
            channelsUsed: assignments.reduce((sum, a) => sum + a.channelCount, 0),
            startChannel: assignments[0]?.startChannel,
            endChannel: assignments[assignments.length - 1]?.endChannel,
          },
          recommendations: this.generateChannelRecommendations(
            assignments,
            universeData,
          ),
        };
      } catch (error) {
        throw new Error(`Failed to suggest channel assignment: ${error}`);
      }
    }
  • Zod schema defining input validation for the suggest_channel_assignment tool, including projectId, fixtureSpecs array with details, universe, startingChannel, and groupingStrategy.
    const SuggestChannelAssignmentSchema = z.object({
      projectId: z.string().describe("Project ID"),
      fixtureSpecs: z
        .array(
          z.object({
            name: z.string(),
            manufacturer: z.string(),
            model: z.string(),
            mode: z.string().optional(),
            channelCount: z
              .number()
              .optional()
              .describe("Number of channels (if known)"),
          }),
        )
        .describe("List of fixtures to assign channels for"),
      universe: z.number().default(1).describe("Universe to assign channels in"),
      startingChannel: z
        .number()
        .default(1)
        .describe("Channel to start assignments from"),
      groupingStrategy: z
        .enum(["sequential", "by_type", "by_function"])
        .default("sequential")
        .describe("How to group fixture assignments"),
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'suggests' assignments, implying a non-destructive, advisory operation, but doesn't clarify if this is a read-only analysis or if it modifies data (e.g., saves assignments to a project). It lacks details on permissions, rate limits, or what 'optimal' means (e.g., based on efficiency, grouping). The description adds minimal context beyond the basic action.

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

Conciseness5/5

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

The description is a single, efficient sentence: 'Suggest optimal channel assignments for multiple fixtures.' It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for the tool's complexity. Every part of the sentence contributes to understanding the tool's function.

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 the tool's complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'optimal' means, how suggestions are generated, what the output looks like (e.g., a list of assignments), or behavioral aspects like whether it's a read-only analysis. For a tool that likely involves algorithmic processing of fixture data, more context is needed to guide an AI agent effectively.

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

Parameters3/5

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

Schema description coverage is 100%, meaning all parameters are documented in the input schema. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain 'fixtureSpecs' or 'groupingStrategy' further). With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract from the schema's documentation.

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?

The description clearly states the tool's purpose: 'Suggest optimal channel assignments for multiple fixtures.' It specifies the action ('suggest'), the resource ('channel assignments'), and the scope ('for multiple fixtures'). However, it doesn't explicitly differentiate from sibling tools like 'get_channel_map' or 'create_fixture_instance,' which might also involve channel-related operations.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a project or fixture specs), exclusions, or comparisons to siblings like 'get_channel_map' (which might retrieve existing assignments) or 'create_fixture_instance' (which might create fixtures with channels). Usage is implied but not explicitly stated.

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

Related 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/bbernstein/lacylights-mcp'

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