reorder_cues
Assign new cue numbers to multiple cues in a cue list on LacyLights MCP Server, enabling precise reordering for theatrical lighting design.
Instructions
Reorder multiple cues by assigning new cue numbers
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cueListId | Yes | Cue list ID containing the cues | |
| cueReordering | Yes | Array of cue ID and new number pairs |
Input Schema (JSON Schema)
{
"properties": {
"cueListId": {
"description": "Cue list ID containing the cues",
"type": "string"
},
"cueReordering": {
"description": "Array of cue ID and new number pairs",
"items": {
"properties": {
"cueId": {
"description": "ID of the cue to reorder",
"type": "string"
},
"newCueNumber": {
"description": "New cue number for this cue",
"type": "number"
}
},
"required": [
"cueId",
"newCueNumber"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"cueListId",
"cueReordering"
],
"type": "object"
}
Implementation Reference
- src/tools/cue-tools.ts:1045-1075 (handler)The handler function for the 'reorder_cues' tool. It reorders cues in a specified cue list by updating the cueNumber of each cue using batched GraphQL mutations via the graphqlClient. Returns the list of updated cues with success status.async reorderCues(args: { cueListId: string; cueReordering: Array<{ cueId: string; newCueNumber: number; }>; }) { const { cueListId, cueReordering } = args; try { // Update each cue with its new number const updatePromises = cueReordering.map(({ cueId, newCueNumber }) => this.graphqlClient.updateCue(cueId, { cueNumber: newCueNumber }), ); const updatedCues = await Promise.all(updatePromises); return { cueListId, updatedCues: updatedCues.map((cue: any) => ({ cueId: cue.id, name: cue.name, cueNumber: cue.cueNumber, })), success: true, totalUpdated: updatedCues.length, }; } catch (error) { throw new Error(`Failed to reorder cues: ${error}`); } }