MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / formatSessionsList

Function formatSessionsList

packages/mcp-server/src/format.ts:223–238  ·  view source on GitHub ↗
(obj: Record<string, unknown>)

Source from the content-addressed store, hash-verified

221}
222
223function formatSessionsList(obj: Record<string, unknown>): string {
224 const sessions = obj.sessions as Array<Record<string, unknown>>
225 const total = obj.total ?? sessions.length
226 const lines: string[] = [`${total} sessions:`]
227
228 for (const s of sessions) {
229 const name = s.name ?? s.id
230 const platform = s.platform ? ` (${s.platform})` : ''
231 const msgCount = s.totalMessages ?? s.messageCount ?? ''
232 const members = s.totalMembers ?? s.memberCount ?? ''
233 const stats = msgCount ? ` — ${msgCount} msgs, ${members} members` : ''
234 lines.push(`- ${name}${platform}${stats} [${s.id}]`)
235 }
236
237 return lines.join('\n')
238}

Callers 1

formatToolResultAsTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected