MCPcopy Index your code
hub / github.com/simstudioai/sim / createMessagesSummary

Function createMessagesSummary

apps/sim/tools/gmail/utils.ts:270–290  ·  view source on GitHub ↗
(messages: any[])

Source from the content-addressed store, hash-verified

268
269// Helper function to create a summary of multiple messages
270export function createMessagesSummary(messages: any[]): string {
271 if (messages.length === 0) {
272 return 'No messages found.'
273 }
274
275 let summary = `Found ${messages.length} messages:\n\n`
276
277 messages.forEach((msg, index) => {
278 summary += `${index + 1}. Subject: ${msg.subject}\n`
279 summary += ` From: ${msg.from}\n`
280 summary += ` To: ${msg.to}\n`
281 summary += ` Date: ${msg.date}\n`
282 summary += ` ID: ${msg.id}\n`
283 summary += ` Thread ID: ${msg.threadId}\n`
284 summary += ` Preview: ${msg.snippet}\n\n`
285 })
286
287 summary += `To read full content of a specific message, use the gmail_read tool with messageId: ${messages.map((m) => m.id).join(', ')}`
288
289 return summary
290}
291
292/**
293 * Generate a unique MIME boundary string

Callers 2

read.tsFile · 0.90
search.tsFile · 0.90

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected