update_scene
Modify an existing lighting scene by updating its name, description, or fixture values, ensuring accurate adjustments for theatrical lighting design on the LacyLights system.
Instructions
Update an existing scene with new values
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Optional new description for the scene | |
| fixtureValues | No | Optional fixture values to update | |
| name | No | Optional new name for the scene | |
| sceneId | Yes | Scene ID to update |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"description": "Optional new description for the scene",
"type": "string"
},
"fixtureValues": {
"description": "Optional fixture values to update",
"items": {
"properties": {
"channelValues": {
"description": "Array of channel values (0-255)",
"items": {
"maximum": 255,
"minimum": 0,
"type": "number"
},
"type": "array"
},
"fixtureId": {
"description": "Fixture ID to update",
"type": "string"
}
},
"required": [
"fixtureId",
"channelValues"
],
"type": "object"
},
"type": "array"
},
"name": {
"description": "Optional new name for the scene",
"type": "string"
},
"sceneId": {
"description": "Scene ID to update",
"type": "string"
}
},
"required": [
"sceneId"
],
"type": "object"
}
Implementation Reference
- src/tools/scene-tools.ts:397-431 (handler)Main handler function that parses input using Zod schema, builds update input, calls GraphQL client to update scene, and returns formatted response with fixture details.async updateScene(args: z.infer<typeof UpdateSceneSchema>) { const { sceneId, name, description, fixtureValues } = UpdateSceneSchema.parse(args); try { // Build the update input object with only provided fields const updateInput: any = {}; if (name !== undefined) updateInput.name = name; if (description !== undefined) updateInput.description = description; if (fixtureValues !== undefined) updateInput.fixtureValues = fixtureValues; // Update the scene const updatedScene = await this.graphqlClient.updateScene(sceneId, updateInput); return { sceneId: updatedScene.id, scene: { name: updatedScene.name, description: updatedScene.description, updatedAt: updatedScene.updatedAt, fixtureValues: updatedScene.fixtureValues.map(fv => ({ fixture: { id: fv.fixture.id, name: fv.fixture.name }, channelValues: fv.channelValues, sceneOrder: fv.sceneOrder })) }, fixturesUpdated: fixtureValues ? fixtureValues.length : 0, channelsUpdated: fixtureValues ? fixtureValues.reduce((total, fv) => total + (fv.channelValues?.length || 0), 0) : 0 }; } catch (error) { throw new Error(`Failed to update scene: ${error}`); } }
- src/tools/scene-tools.ts:91-100 (schema)Zod schema for validating update_scene tool inputs: sceneId (required), optional name, description, and fixtureValues array with fixtureId and channelValues (0-255).const UpdateSceneSchema = z.object({ sceneId: z.string(), name: z.string().optional(), description: z.string().optional(), fixtureValues: z.array(z.object({ fixtureId: z.string(), channelValues: z.array(z.number().min(0).max(255)) })).optional() });
- src/index.ts:918-960 (registration)MCP tool registration in listTools response: defines name 'update_scene', description, and inputSchema matching the Zod schema.name: "update_scene", description: "Update an existing scene with new values", inputSchema: { type: "object", properties: { sceneId: { type: "string", description: "Scene ID to update", }, name: { type: "string", description: "Optional new name for the scene", }, description: { type: "string", description: "Optional new description for the scene", }, fixtureValues: { type: "array", items: { type: "object", properties: { fixtureId: { type: "string", description: "Fixture ID to update", }, channelValues: { type: "array", items: { type: "number", minimum: 0, maximum: 255, }, description: "Array of channel values (0-255)", }, }, required: ["fixtureId", "channelValues"], }, description: "Optional fixture values to update", }, }, required: ["sceneId"], },
- src/index.ts:2126-2138 (registration)Dispatch handler in callToolRequest that routes 'update_scene' calls to sceneTools.updateScene method.case "update_scene": return { content: [ { type: "text", text: JSON.stringify( await this.sceneTools.updateScene(args as any), null, 2, ), }, ], };
- GraphQL mutation executed by the handler to perform the actual scene update in the backend.async updateScene(id: string, input: { name?: string; description?: string; fixtureValues?: Array<{ fixtureId: string; channelValues: number[]; }>; }): Promise<Scene> { const mutation = ` mutation UpdateScene($id: ID!, $input: UpdateSceneInput!) {