Skip to main content
Glama
bbernstein

LacyLights MCP Server

by bbernstein

optimize_cue_timing

Enhance cue timing in theatrical lighting by applying strategy-based adjustments to smooth transitions, dramatic timing, technical precision, or energy efficiency. Input cue and project IDs for optimization.

Instructions

Optimize the timing of cues in a cue list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cueListIdYesCue list ID to optimize
optimizationStrategyNoOptimization strategy to applysmooth_transitions
projectIdYesProject ID containing the cue list

Implementation Reference

  • Main handler function for optimize_cue_timing tool. Parses input schema, validates project and cue list, generates timing optimizations using helper method, computes statistics, and returns optimization results including changes and reasoning.
    async optimizeCueTiming(args: z.infer<typeof OptimizeCueTimingSchema>) {
      const { cueListId, projectId, optimizationStrategy } =
        OptimizeCueTimingSchema.parse(args);
    
      try {
        const project = await this.graphqlClient.getProject(projectId);
        if (!project) {
          throw new Error(`Project with ID ${projectId} not found`);
        }
    
        const cueList = project.cueLists.find((cl) => cl.id === cueListId);
        if (!cueList) {
          throw new Error(`Cue list with ID ${cueListId} not found`);
        }
    
        const optimizations = this.generateTimingOptimizations(
          cueList.cues,
          optimizationStrategy,
        );
    
        return {
          cueListId,
          strategy: optimizationStrategy,
          originalTiming: {
            totalCues: cueList.cues.length,
            averageFadeIn: this.calculateAverageFadeTime(
              cueList.cues,
              "fadeInTime",
            ),
            averageFadeOut: this.calculateAverageFadeTime(
              cueList.cues,
              "fadeOutTime",
            ),
            followCues: cueList.cues.filter((cue) => cue.followTime !== undefined)
              .length,
          },
          optimizedTiming: optimizations.newTiming,
          changes: optimizations.changes,
          reasoning: optimizations.reasoning,
          estimatedImprovement: optimizations.improvement,
        };
      } catch (error) {
        throw new Error(`Failed to optimize cue timing: ${error}`);
      }
    }
  • Zod input schema validation for the optimize_cue_timing tool defining required cueListId, projectId, and optional optimizationStrategy.
    const OptimizeCueTimingSchema = z.object({
      cueListId: z.string(),
      projectId: z.string(),
      optimizationStrategy: z
        .enum([
          "smooth_transitions",
          "dramatic_timing",
          "technical_precision",
          "energy_conscious",
        ])
        .default("smooth_transitions"),
    });
  • src/index.ts:1256-1282 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and inputSchema matching the Zod schema.
    name: "optimize_cue_timing",
    description: "Optimize the timing of cues in a cue list",
    inputSchema: {
      type: "object",
      properties: {
        cueListId: {
          type: "string",
          description: "Cue list ID to optimize",
        },
        projectId: {
          type: "string",
          description: "Project ID containing the cue list",
        },
        optimizationStrategy: {
          type: "string",
          enum: [
            "smooth_transitions",
            "dramatic_timing",
            "technical_precision",
            "energy_conscious",
          ],
          default: "smooth_transitions",
          description: "Optimization strategy to apply",
        },
      },
      required: ["cueListId", "projectId"],
    },
  • src/index.ts:2282-2294 (registration)
    Tool call handler registration in CallToolRequestSchema switch statement, dispatching to cueTools.optimizeCueTiming.
    case "optimize_cue_timing":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await this.cueTools.optimizeCueTiming(args as any),
              null,
              2,
            ),
          },
        ],
      };
  • Private helper method implementing the core optimization logic based on strategy, generating changes, reasoning, and improvement metrics used by the handler.
    private generateTimingOptimizations(cues: any[], strategy: string) {
      // Simplified optimization logic - in practice this would be more sophisticated
      const changes = [];
      let improvement = "";
    
      switch (strategy) {
        case "smooth_transitions":
          changes.push("Standardized fade times for consistency");
          changes.push("Added buffer time between manual cues");
          improvement = "Smoother visual transitions";
          break;
        case "dramatic_timing":
          changes.push("Shortened fade times for dramatic moments");
          changes.push("Added follow cues for automatic sequences");
          improvement = "Enhanced dramatic impact";
          break;
        case "technical_precision":
          changes.push("Standardized cue numbering increments");
          changes.push("Consistent fade time patterns");
          improvement = "Easier operation and fewer mistakes";
          break;
        case "energy_conscious":
          changes.push("Longer fade times to reduce power spikes");
          changes.push("Staggered fixture activation");
          improvement = "Reduced power consumption peaks";
          break;
      }
    
      return {
        newTiming: {
          /* optimized timing values */
        },
        changes,
        reasoning: `Applied ${strategy} optimization strategy`,
        improvement,
      };
    }
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 'optimize' but doesn't explain what that entails—whether it modifies data, requires specific permissions, has side effects like overwriting cues, or what the output might be. This is inadequate for a mutation tool with zero annotation coverage.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, with no wasted information, making it easy to parse quickly.

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 (a mutation operation with 3 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like what 'optimize' does, potential side effects, or return values, leaving significant gaps for an agent to understand and use the tool 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%, so the schema already documents all parameters (cueListId, optimizationStrategy, projectId) with descriptions and an enum for strategy. The description adds no additional meaning beyond this, such as explaining the impact of different strategies or parameter interactions, meeting the baseline for high schema coverage.

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 action ('optimize') and resource ('timing of cues in a cue list'), making the purpose understandable. However, it doesn't distinguish this tool from sibling 'optimize_scene' or 'reorder_cues', which might have overlapping timing-related functions, so it misses full sibling differentiation.

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 like 'optimize_scene' or 'reorder_cues'. It lacks context about prerequisites, such as needing an existing cue list, and doesn't specify scenarios where this optimization is appropriate, leaving usage unclear.

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