@@ -199,6 +199,20 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
199199 } ,
200200 required : true ,
201201 } ,
202+ {
203+ id : 'messageFormat' ,
204+ title : 'Message Format' ,
205+ type : 'dropdown' ,
206+ options : [
207+ { label : 'Plain Text' , id : 'text' } ,
208+ { label : 'Block Kit' , id : 'blocks' } ,
209+ ] ,
210+ value : ( ) => 'text' ,
211+ condition : {
212+ field : 'operation' ,
213+ value : [ 'send' , 'ephemeral' , 'update' ] ,
214+ } ,
215+ } ,
202216 {
203217 id : 'text' ,
204218 title : 'Message' ,
@@ -207,8 +221,29 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
207221 condition : {
208222 field : 'operation' ,
209223 value : [ 'send' , 'ephemeral' ] ,
224+ and : { field : 'messageFormat' , value : 'blocks' , not : true } ,
225+ } ,
226+ required : {
227+ field : 'operation' ,
228+ value : [ 'send' , 'ephemeral' ] ,
229+ and : { field : 'messageFormat' , value : 'blocks' , not : true } ,
230+ } ,
231+ } ,
232+ {
233+ id : 'blocks' ,
234+ title : 'Block Kit Blocks' ,
235+ type : 'code' ,
236+ placeholder : 'JSON array of Block Kit blocks' ,
237+ condition : {
238+ field : 'operation' ,
239+ value : [ 'send' , 'ephemeral' , 'update' ] ,
240+ and : { field : 'messageFormat' , value : 'blocks' } ,
241+ } ,
242+ required : {
243+ field : 'operation' ,
244+ value : [ 'send' , 'ephemeral' , 'update' ] ,
245+ and : { field : 'messageFormat' , value : 'blocks' } ,
210246 } ,
211- required : true ,
212247 } ,
213248 {
214249 id : 'threadTs' ,
@@ -480,8 +515,13 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
480515 condition : {
481516 field : 'operation' ,
482517 value : 'update' ,
518+ and : { field : 'messageFormat' , value : 'blocks' , not : true } ,
519+ } ,
520+ required : {
521+ field : 'operation' ,
522+ value : 'update' ,
523+ and : { field : 'messageFormat' , value : 'blocks' , not : true } ,
483524 } ,
484- required : true ,
485525 } ,
486526 // Delete Message specific fields
487527 {
@@ -581,12 +621,14 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
581621 destinationType,
582622 channel,
583623 dmUserId,
624+ messageFormat,
584625 text,
585626 title,
586627 content,
587628 limit,
588629 oldest,
589630 files,
631+ blocks,
590632 threadTs,
591633 ephemeralUser,
592634 updateTimestamp,
@@ -630,10 +672,13 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
630672
631673 switch ( operation ) {
632674 case 'send' : {
633- baseParams . text = text
675+ baseParams . text = messageFormat === 'blocks' && ! text ? ' ' : text
634676 if ( threadTs ) {
635677 baseParams . threadTs = threadTs
636678 }
679+ if ( blocks ) {
680+ baseParams . blocks = blocks
681+ }
637682 // files is the canonical param from attachmentFiles (basic) or files (advanced)
638683 const normalizedFiles = normalizeFileInput ( files )
639684 if ( normalizedFiles ) {
@@ -643,11 +688,14 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
643688 }
644689
645690 case 'ephemeral' : {
646- baseParams . text = text
691+ baseParams . text = messageFormat === 'blocks' && ! text ? ' ' : text
647692 baseParams . user = ephemeralUser ? String ( ephemeralUser ) . trim ( ) : ''
648693 if ( threadTs ) {
649694 baseParams . threadTs = threadTs
650695 }
696+ if ( blocks ) {
697+ baseParams . blocks = blocks
698+ }
651699 break
652700 }
653701
@@ -717,7 +765,10 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
717765
718766 case 'update' :
719767 baseParams . timestamp = updateTimestamp
720- baseParams . text = updateText
768+ baseParams . text = messageFormat === 'blocks' && ! updateText ? ' ' : updateText
769+ if ( blocks ) {
770+ baseParams . blocks = blocks
771+ }
721772 break
722773
723774 case 'delete' :
@@ -736,6 +787,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
736787 } ,
737788 inputs : {
738789 operation : { type : 'string' , description : 'Operation to perform' } ,
790+ messageFormat : { type : 'string' , description : 'Message format: text or blocks' } ,
739791 authMethod : { type : 'string' , description : 'Authentication method' } ,
740792 destinationType : { type : 'string' , description : 'Destination type (channel or dm)' } ,
741793 credential : { type : 'string' , description : 'Slack access token' } ,
@@ -770,6 +822,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
770822 userLimit : { type : 'string' , description : 'Maximum number of users to return' } ,
771823 // Ephemeral message inputs
772824 ephemeralUser : { type : 'string' , description : 'User ID who will see the ephemeral message' } ,
825+ blocks : { type : 'json' , description : 'Block Kit layout blocks as a JSON array' } ,
773826 // Get User inputs
774827 userId : { type : 'string' , description : 'User ID to look up' } ,
775828 // Get Message inputs
0 commit comments