@@ -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 : '10' ,
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,19 @@ 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 parsedLimit =
2144+ channelLimit === undefined || channelLimit === '' ? 100 : Number ( channelLimit )
2145+ if ( ! Number . isInteger ( parsedLimit ) || parsedLimit < 1 || parsedLimit > 200 ) {
2146+ throw new Error ( 'Conversations per page must be an integer between 1 and 200' )
2147+ }
2148+ baseParams . limit = parsedLimit
2149+ if ( channelMaxPages !== undefined && channelMaxPages !== '' ) {
2150+ const parsedMaxPages = Number ( channelMaxPages )
2151+ if ( ! Number . isInteger ( parsedMaxPages ) || parsedMaxPages < 1 || parsedMaxPages > 10 ) {
2152+ throw new Error ( 'Max pages must be an integer between 1 and 10' )
2153+ }
2154+ baseParams . maxPages = parsedMaxPages
2155+ }
21312156 if ( paginationCursor ) {
21322157 baseParams . cursor = String ( paginationCursor ) . trim ( )
21332158 }
@@ -2393,7 +2418,8 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te
23932418 thread_ts : { type : 'string' , description : 'Thread timestamp for reply' } ,
23942419 // List Channels inputs
23952420 includePrivate : { type : 'string' , description : 'Include private channels (true/false)' } ,
2396- channelLimit : { type : 'string' , description : 'Maximum number of channels to return' } ,
2421+ channelLimit : { type : 'string' , description : 'Conversations to request per Slack page' } ,
2422+ channelMaxPages : { type : 'string' , description : 'Maximum Slack pages to fetch (max 10)' } ,
23972423 // List Members inputs
23982424 memberLimit : { type : 'string' , description : 'Maximum number of members to return' } ,
23992425 // List Users inputs
@@ -2600,13 +2626,13 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te
26002626 } ,
26012627 hasMore : {
26022628 type : 'boolean' ,
2603- description : 'Whether there are more messages in the thread ' ,
2629+ description : 'Whether more provider pages remain beyond the fetched window ' ,
26042630 } ,
26052631
26062632 // slack_get_channel_history / slack_get_thread_replies pagination outputs
26072633 pages : {
26082634 type : 'number' ,
2609- description : 'Number of pages fetched during a paginated history/replies read' ,
2635+ description : 'Number of provider pages fetched during a paginated read' ,
26102636 } ,
26112637 threadTs : {
26122638 type : 'string' ,
0 commit comments