Skip to main content
Glama
bbernstein

LacyLights MCP Server

by bbernstein

optimize_scene

Enhance theatrical lighting scenes by tailoring them for energy efficiency, color accuracy, dramatic impact, or technical simplicity within the LacyLights system.

Instructions

Optimize an existing scene for specific goals

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
optimizationGoalsNoGoals for optimization
projectIdYesProject ID containing the scene
sceneIdYesScene ID to optimize

Implementation Reference

  • Main execution logic for the 'optimize_scene' MCP tool. Validates args using OptimizeSceneSchema, retrieves project and scene, and returns optimization status and recommendations (full optimization planned for future).
    async optimizeScene(args: z.infer<typeof OptimizeSceneSchema>) {
      const { sceneId, projectId, optimizationGoals } = OptimizeSceneSchema.parse(args);
    
      try {
        // Get the current scene
        const project = await this.graphqlClient.getProject(projectId);
        if (!project) {
          throw new Error(`Project with ID ${projectId} not found`);
        }
    
        const scene = project.scenes.find(s => s.id === sceneId);
        if (!scene) {
          throw new Error(`Scene with ID ${sceneId} not found`);
        }
    
        // Scene optimization is planned for future implementation
        // Currently returns analysis and recommendations without modifying the scene
        return {
          sceneId,
          sceneName: scene.name,
          originalFixtureCount: scene.fixtureValues.length,
          requestedGoals: optimizationGoals,
          status: 'not_implemented',
          message: 'Scene optimization is planned for future releases. Current implementation provides recommendations only.',
          recommendations: this.getOptimizationRecommendations(optimizationGoals),
        };
      } catch (error) {
        throw new Error(`Failed to optimize scene: ${error}`);
      }
    }
  • Zod input schema used for validating arguments in the optimizeScene handler.
    const OptimizeSceneSchema = z.object({
      sceneId: z.string(),
      projectId: z.string(),
      optimizationGoals: z.array(z.enum(['energy_efficiency', 'color_accuracy', 'dramatic_impact', 'technical_simplicity'])).default(['dramatic_impact'])
    });
  • src/index.ts:886-916 (registration)
    Registration of 'optimize_scene' tool in the ListTools response, defining name, description, and JSON input schema.
      name: "optimize_scene",
      description: "Optimize an existing scene for specific goals",
      inputSchema: {
        type: "object",
        properties: {
          sceneId: {
            type: "string",
            description: "Scene ID to optimize",
          },
          projectId: {
            type: "string",
            description: "Project ID containing the scene",
          },
          optimizationGoals: {
            type: "array",
            items: {
              type: "string",
              enum: [
                "energy_efficiency",
                "color_accuracy",
                "dramatic_impact",
                "technical_simplicity",
              ],
            },
            default: ["dramatic_impact"],
            description: "Goals for optimization",
          },
        },
        required: ["sceneId", "projectId"],
      },
    },
  • src/index.ts:2112-2124 (registration)
    Handler dispatch in CallToolRequestSchema switch statement, calling sceneTools.optimizeScene with parsed arguments.
    case "optimize_scene":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await this.sceneTools.optimizeScene(args as any),
              null,
              2,
            ),
          },
        ],
      };
  • Private helper method that generates goal-specific optimization recommendations used by the optimizeScene handler.
    private getOptimizationRecommendations(goals: string[]): string[] {
      const recommendations: string[] = [];
    
      for (const goal of goals) {
        switch (goal) {
          case 'energy_efficiency':
            recommendations.push(
              'Use fewer fixtures at higher intensity rather than many at low intensity',
              'Prioritize LED fixtures over traditional tungsten',
              'Consider consolidating similar color washes'
            );
            break;
          case 'color_accuracy':
            recommendations.push(
              'Use fixtures with dedicated white channels',
              'Avoid oversaturated colors that may appear unnatural',
              'Consider color temperature consistency across fixtures'
            );
            break;
          case 'dramatic_impact':
            recommendations.push(
              'Use moving heads for dynamic positioning',
              'Create strong key light with softer fill',
              'Consider backlight for separation and depth'
            );
            break;
          case 'technical_simplicity':
            recommendations.push(
              'Group similar fixtures for easier control',
              'Use preset colors rather than custom mixes',
              'Minimize moving head positioning changes'
            );
            break;
        }
      }
    
      return recommendations;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only or destructive operation, what permissions are needed, how long it takes, or what happens to the original scene. The phrase 'optimize' implies mutation but without specifics.

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?

The description is a single, clear sentence with no wasted words. It's front-loaded with the core action, though it could be more specific to improve usefulness without adding length.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what optimization does, what the output looks like, or potential side effects, leaving significant gaps for an agent to understand the tool's behavior and results.

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 fully documents parameters like 'optimizationGoals' with its enum values. The description adds no extra meaning beyond implying goals guide optimization, but doesn't explain trade-offs or interactions between goals, 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.

Purpose3/5

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

The description 'Optimize an existing scene for specific goals' states the verb (optimize) and resource (scene), but it's vague about what optimization entails. It doesn't specify whether this adjusts lighting, timing, or other scene properties, nor does it distinguish from sibling tools like 'optimize_cue_timing' or 'update_scene'.

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 versus alternatives. It doesn't mention prerequisites (e.g., needing an existing scene), exclusions, or comparisons to tools like 'update_scene' or 'optimize_cue_timing', leaving the agent to guess based on 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

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