@@ -163,11 +163,11 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
163163 { text : ', with heading' , field : 'promptsTitle' } ,
164164 ] ,
165165 list_channels : [
166+ 'List Slack conversations' ,
166167 {
167- text : 'List up to ' ,
168+ text : ', in pages of ' ,
168169 field : 'channelLimit' ,
169- after : 'channels' ,
170- core : true ,
170+ after : 'items' ,
171171 } ,
172172 ] ,
173173 list_members : [
@@ -762,13 +762,25 @@ Do not include any explanations, markdown formatting, or other text outside the
762762 } ,
763763 {
764764 id : 'channelLimit' ,
765- title : 'Channel Limit ' ,
765+ title : 'Conversations Per Page ' ,
766766 type : 'short-input' ,
767767 placeholder : '100' ,
768768 condition : {
769769 field : 'operation' ,
770770 value : 'list_channels' ,
771771 } ,
772+ mode : 'advanced' ,
773+ } ,
774+ {
775+ id : 'channelMaxPages' ,
776+ title : 'Max Pages' ,
777+ type : 'short-input' ,
778+ placeholder : '200' ,
779+ condition : {
780+ field : 'operation' ,
781+ value : 'list_channels' ,
782+ } ,
783+ mode : 'advanced' ,
772784 } ,
773785 // List Members specific fields
774786 {
@@ -1911,6 +1923,7 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te
19111923 emojiName,
19121924 includePrivate,
19131925 channelLimit,
1926+ channelMaxPages,
19141927 memberLimit,
19151928 includeDeleted,
19161929 userLimit,
@@ -2127,7 +2140,26 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te
21272140 case 'list_channels' : {
21282141 baseParams . includePrivate = includePrivate !== 'false'
21292142 baseParams . excludeArchived = true
2130- baseParams . limit = channelLimit ? Number . parseInt ( channelLimit , 10 ) : 100
2143+ const hasChannelLimit =
2144+ channelLimit !== undefined &&
2145+ channelLimit !== null &&
2146+ ( typeof channelLimit !== 'string' || Boolean ( channelLimit . trim ( ) ) )
2147+ const parsedLimit = hasChannelLimit ? Number ( channelLimit ) : 100
2148+ if ( ! Number . isInteger ( parsedLimit ) || parsedLimit < 1 || parsedLimit > 200 ) {
2149+ throw new Error ( 'Conversations per page must be an integer between 1 and 200' )
2150+ }
2151+ baseParams . limit = parsedLimit
2152+ const hasChannelMaxPages =
2153+ channelMaxPages !== undefined &&
2154+ channelMaxPages !== null &&
2155+ ( typeof channelMaxPages !== 'string' || Boolean ( channelMaxPages . trim ( ) ) )
2156+ if ( hasChannelMaxPages ) {
2157+ const parsedMaxPages = Number ( channelMaxPages )
2158+ if ( ! Number . isInteger ( parsedMaxPages ) || parsedMaxPages < 1 || parsedMaxPages > 200 ) {
2159+ throw new Error ( 'Max pages must be an integer between 1 and 200' )
2160+ }
2161+ baseParams . maxPages = parsedMaxPages
2162+ }
21312163 if ( paginationCursor ) {
21322164 baseParams . cursor = String ( paginationCursor ) . trim ( )
21332165 }
@@ -2393,7 +2425,8 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te
23932425 thread_ts : { type : 'string' , description : 'Thread timestamp for reply' } ,
23942426 // List Channels inputs
23952427 includePrivate : { type : 'string' , description : 'Include private channels (true/false)' } ,
2396- channelLimit : { type : 'string' , description : 'Maximum number of channels to return' } ,
2428+ channelLimit : { type : 'string' , description : 'Conversations to request per Slack page' } ,
2429+ channelMaxPages : { type : 'string' , description : 'Maximum Slack pages to fetch (max 200)' } ,
23972430 // List Members inputs
23982431 memberLimit : { type : 'string' , description : 'Maximum number of members to return' } ,
23992432 // List Users inputs
@@ -2600,13 +2633,14 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te
26002633 } ,
26012634 hasMore : {
26022635 type : 'boolean' ,
2603- description : 'Whether there are more messages in the thread' ,
2636+ description :
2637+ 'Whether more thread messages or provider pages remain beyond the fetched window' ,
26042638 } ,
26052639
26062640 // slack_get_channel_history / slack_get_thread_replies pagination outputs
26072641 pages : {
26082642 type : 'number' ,
2609- description : 'Number of pages fetched during a paginated history/replies read' ,
2643+ description : 'Number of provider pages fetched during a paginated read' ,
26102644 } ,
26112645 threadTs : {
26122646 type : 'string' ,
@@ -2623,7 +2657,7 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te
26232657 channels : {
26242658 type : 'json' ,
26252659 description :
2626- 'Array of accessible conversation objects. Credential-group user tokens also include direct and group DMs, with type fields (is_channel, is_im, is_mpim) and DM participant field user .' ,
2660+ 'Array of up to 10,000 accessible public and private channel objects, including conversation type and membership fields .' ,
26272661 } ,
26282662 count : {
26292663 type : 'number' ,
0 commit comments