@@ -89,18 +89,59 @@ export const slackMessageReaderTool: ToolConfig<
8989 const data = await response . json ( )
9090
9191 const messages = ( data . messages || [ ] ) . map ( ( message : any ) => ( {
92+ // Core properties
93+ type : message . type || 'message' ,
9294 ts : message . ts ,
9395 text : message . text || '' ,
94- user : message . user || message . bot_id || 'unknown' ,
95- type : message . type || 'message' ,
96+ user : message . user ,
97+ bot_id : message . bot_id ,
98+ username : message . username ,
99+ channel : message . channel ,
100+ team : message . team ,
101+
102+ // Thread properties
103+ thread_ts : message . thread_ts ,
104+ parent_user_id : message . parent_user_id ,
105+ reply_count : message . reply_count ,
106+ reply_users_count : message . reply_users_count ,
107+ latest_reply : message . latest_reply ,
108+ subscribed : message . subscribed ,
109+ last_read : message . last_read ,
110+ unread_count : message . unread_count ,
111+
112+ // Message subtype
96113 subtype : message . subtype ,
114+
115+ // Reactions and interactions
116+ reactions : message . reactions ?. map ( ( reaction : any ) => ( {
117+ name : reaction . name ,
118+ count : reaction . count ,
119+ users : reaction . users || [ ] ,
120+ } ) ) ,
121+ is_starred : message . is_starred ,
122+ pinned_to : message . pinned_to ,
123+
124+ // Content attachments
97125 files : message . files ?. map ( ( file : any ) => ( {
98126 id : file . id ,
99127 name : file . name ,
100128 mimetype : file . mimetype ,
101129 size : file . size ,
102130 url_private : file . url_private ,
131+ permalink : file . permalink ,
132+ mode : file . mode ,
103133 } ) ) ,
134+ attachments : message . attachments ,
135+ blocks : message . blocks ,
136+
137+ // Metadata
138+ edited : message . edited
139+ ? {
140+ user : message . edited . user ,
141+ ts : message . edited . ts ,
142+ }
143+ : undefined ,
144+ permalink : message . permalink ,
104145 } ) )
105146
106147 return {
@@ -118,24 +159,91 @@ export const slackMessageReaderTool: ToolConfig<
118159 items : {
119160 type : 'object' ,
120161 properties : {
121- ts : { type : 'string' } ,
122- text : { type : 'string' } ,
123- user : { type : 'string' } ,
124- type : { type : 'string' } ,
125- subtype : { type : 'string' } ,
162+ // Core properties
163+ type : { type : 'string' , description : 'Message type' } ,
164+ ts : { type : 'string' , description : 'Message timestamp' } ,
165+ text : { type : 'string' , description : 'Message text content' } ,
166+ user : { type : 'string' , description : 'User ID who sent the message' } ,
167+ bot_id : { type : 'string' , description : 'Bot ID if sent by a bot' } ,
168+ username : { type : 'string' , description : 'Display username' } ,
169+ channel : { type : 'string' , description : 'Channel ID' } ,
170+ team : { type : 'string' , description : 'Team ID' } ,
171+
172+ // Thread properties
173+ thread_ts : { type : 'string' , description : 'Thread parent message timestamp' } ,
174+ parent_user_id : { type : 'string' , description : 'User ID of thread parent' } ,
175+ reply_count : { type : 'number' , description : 'Number of thread replies' } ,
176+ reply_users_count : { type : 'number' , description : 'Number of users who replied' } ,
177+ latest_reply : { type : 'string' , description : 'Timestamp of latest reply' } ,
178+ subscribed : { type : 'boolean' , description : 'Whether user is subscribed to thread' } ,
179+ last_read : { type : 'string' , description : 'Last read timestamp' } ,
180+ unread_count : { type : 'number' , description : 'Number of unread messages' } ,
181+
182+ // Message subtype
183+ subtype : { type : 'string' , description : 'Message subtype' } ,
184+
185+ // Reactions and interactions
186+ reactions : {
187+ type : 'array' ,
188+ description : 'Array of reactions on this message' ,
189+ items : {
190+ type : 'object' ,
191+ properties : {
192+ name : { type : 'string' , description : 'Emoji name' } ,
193+ count : { type : 'number' , description : 'Number of reactions' } ,
194+ users : {
195+ type : 'array' ,
196+ description : 'Array of user IDs who reacted' ,
197+ items : { type : 'string' } ,
198+ } ,
199+ } ,
200+ } ,
201+ } ,
202+ is_starred : { type : 'boolean' , description : 'Whether message is starred' } ,
203+ pinned_to : {
204+ type : 'array' ,
205+ description : 'Array of channel IDs where message is pinned' ,
206+ items : { type : 'string' } ,
207+ } ,
208+
209+ // Content attachments
126210 files : {
127211 type : 'array' ,
212+ description : 'Array of files attached to message' ,
128213 items : {
129214 type : 'object' ,
130215 properties : {
131- id : { type : 'string' } ,
132- name : { type : 'string' } ,
133- mimetype : { type : 'string' } ,
134- size : { type : 'number' } ,
135- url_private : { type : 'string' } ,
216+ id : { type : 'string' , description : 'File ID' } ,
217+ name : { type : 'string' , description : 'File name' } ,
218+ mimetype : { type : 'string' , description : 'MIME type' } ,
219+ size : { type : 'number' , description : 'File size in bytes' } ,
220+ url_private : { type : 'string' , description : 'Private download URL' } ,
221+ permalink : { type : 'string' , description : 'Permanent link to file' } ,
222+ mode : { type : 'string' , description : 'File mode' } ,
136223 } ,
137224 } ,
138225 } ,
226+ attachments : {
227+ type : 'array' ,
228+ description : 'Array of legacy attachments' ,
229+ items : { type : 'object' } ,
230+ } ,
231+ blocks : {
232+ type : 'array' ,
233+ description : 'Array of Block Kit blocks' ,
234+ items : { type : 'object' } ,
235+ } ,
236+
237+ // Metadata
238+ edited : {
239+ type : 'object' ,
240+ description : 'Edit information if message was edited' ,
241+ properties : {
242+ user : { type : 'string' , description : 'User ID who edited' } ,
243+ ts : { type : 'string' , description : 'Edit timestamp' } ,
244+ } ,
245+ } ,
246+ permalink : { type : 'string' , description : 'Permanent link to message' } ,
139247 } ,
140248 } ,
141249 } ,
0 commit comments