@@ -366,13 +366,59 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
366366 value : ( ) => '' ,
367367 condition : { field : 'operation' , value : 'describe_alarms' } ,
368368 } ,
369+ {
370+ id : 'muteRuleName' ,
371+ title : 'Mute Rule Name' ,
372+ type : 'short-input' ,
373+ placeholder : 'my-mute-rule' ,
374+ condition : { field : 'operation' , value : [ 'mute_alarm' , 'unmute_alarm' ] } ,
375+ required : { field : 'operation' , value : [ 'mute_alarm' , 'unmute_alarm' ] } ,
376+ } ,
369377 {
370378 id : 'alarmNames' ,
371379 title : 'Alarm Names' ,
372380 type : 'short-input' ,
373381 placeholder : 'my-alarm-1, my-alarm-2' ,
374- condition : { field : 'operation' , value : [ 'mute_alarm' , 'unmute_alarm' ] } ,
375- required : { field : 'operation' , value : [ 'mute_alarm' , 'unmute_alarm' ] } ,
382+ condition : { field : 'operation' , value : 'mute_alarm' } ,
383+ required : { field : 'operation' , value : 'mute_alarm' } ,
384+ } ,
385+ {
386+ id : 'durationValue' ,
387+ title : 'Duration' ,
388+ type : 'short-input' ,
389+ placeholder : '1' ,
390+ condition : { field : 'operation' , value : 'mute_alarm' } ,
391+ required : { field : 'operation' , value : 'mute_alarm' } ,
392+ } ,
393+ {
394+ id : 'durationUnit' ,
395+ title : 'Duration Unit' ,
396+ type : 'dropdown' ,
397+ options : [
398+ { label : 'Minutes' , id : 'minutes' } ,
399+ { label : 'Hours' , id : 'hours' } ,
400+ { label : 'Days' , id : 'days' } ,
401+ ] ,
402+ value : ( ) => 'hours' ,
403+ condition : { field : 'operation' , value : 'mute_alarm' } ,
404+ required : { field : 'operation' , value : 'mute_alarm' } ,
405+ } ,
406+ {
407+ id : 'muteDescription' ,
408+ title : 'Description' ,
409+ type : 'short-input' ,
410+ placeholder : 'Why these alarms are being muted' ,
411+ condition : { field : 'operation' , value : 'mute_alarm' } ,
412+ mode : 'advanced' ,
413+ } ,
414+ {
415+ id : 'muteStartDate' ,
416+ title : 'Start Date' ,
417+ type : 'short-input' ,
418+ placeholder : 'e.g., 1711900800' ,
419+ condition : { field : 'operation' , value : 'mute_alarm' } ,
420+ mode : 'advanced' ,
421+ description : 'Unix epoch seconds. Defaults to now (mute starts immediately).' ,
376422 } ,
377423 {
378424 id : 'limit' ,
@@ -633,8 +679,7 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
633679 ...( parsedLimit !== undefined && { limit : parsedLimit } ) ,
634680 }
635681
636- case 'mute_alarm' :
637- case 'unmute_alarm' : {
682+ case 'mute_alarm' : {
638683 const alarmNames = rest . alarmNames
639684 if ( ! alarmNames ) {
640685 throw new Error ( 'Alarm names are required' )
@@ -652,11 +697,45 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
652697 throw new Error ( 'At least one alarm name is required' )
653698 }
654699
700+ const durationValueRaw = rest . durationValue
701+ const parsedDurationValue =
702+ typeof durationValueRaw === 'number'
703+ ? durationValueRaw
704+ : Number . parseInt ( String ( durationValueRaw ?? '' ) , 10 )
705+ if ( ! Number . isFinite ( parsedDurationValue ) || parsedDurationValue < 1 ) {
706+ throw new Error ( 'Duration must be a positive integer' )
707+ }
708+
709+ const startDateRaw = rest . muteStartDate
710+ const parsedStartDate =
711+ startDateRaw === undefined || startDateRaw === ''
712+ ? undefined
713+ : typeof startDateRaw === 'number'
714+ ? startDateRaw
715+ : Number . parseInt ( String ( startDateRaw ) , 10 )
716+ if ( parsedStartDate !== undefined && ! Number . isFinite ( parsedStartDate ) ) {
717+ throw new Error ( 'Start date must be a Unix epoch in seconds' )
718+ }
719+
655720 return {
656721 awsRegion,
657722 awsAccessKeyId,
658723 awsSecretAccessKey,
724+ muteRuleName : rest . muteRuleName ,
659725 alarmNames : names ,
726+ durationValue : parsedDurationValue ,
727+ durationUnit : rest . durationUnit ,
728+ ...( rest . muteDescription && { description : rest . muteDescription } ) ,
729+ ...( parsedStartDate !== undefined && { startDate : parsedStartDate } ) ,
730+ }
731+ }
732+
733+ case 'unmute_alarm' : {
734+ return {
735+ awsRegion,
736+ awsAccessKeyId,
737+ awsSecretAccessKey,
738+ muteRuleName : rest . muteRuleName ,
660739 }
661740 }
662741
@@ -700,7 +779,18 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
700779 description : 'Alarm state filter (OK, ALARM, INSUFFICIENT_DATA)' ,
701780 } ,
702781 alarmType : { type : 'string' , description : 'Alarm type filter (MetricAlarm, CompositeAlarm)' } ,
703- alarmNames : { type : 'string' , description : 'Comma-separated alarm names to mute or unmute' } ,
782+ muteRuleName : { type : 'string' , description : 'Unique name for the alarm mute rule' } ,
783+ alarmNames : { type : 'string' , description : 'Comma-separated alarm names to mute' } ,
784+ durationValue : { type : 'number' , description : 'Length of the mute window' } ,
785+ durationUnit : {
786+ type : 'string' ,
787+ description : 'Unit for durationValue: minutes, hours, or days' ,
788+ } ,
789+ muteDescription : { type : 'string' , description : 'Description of the mute rule' } ,
790+ muteStartDate : {
791+ type : 'number' ,
792+ description : 'When the mute begins (Unix epoch seconds). Defaults to now.' ,
793+ } ,
704794 limit : { type : 'number' , description : 'Maximum number of results' } ,
705795 } ,
706796 outputs : {
@@ -746,7 +836,19 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
746836 } ,
747837 alarmNames : {
748838 type : 'array' ,
749- description : 'Names of the alarms that were muted or unmuted' ,
839+ description : 'Names of the alarms targeted by the mute rule' ,
840+ } ,
841+ muteRuleName : {
842+ type : 'string' ,
843+ description : 'Name of the alarm mute rule that was created or deleted' ,
844+ } ,
845+ expression : {
846+ type : 'string' ,
847+ description : 'Schedule expression used by the mute rule' ,
848+ } ,
849+ duration : {
850+ type : 'string' ,
851+ description : 'ISO 8601 duration of the mute window' ,
750852 } ,
751853 success : {
752854 type : 'boolean' ,
0 commit comments