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

Function handler

packages/tools/src/definitions/session-info.ts:21–37  ·  view source on GitHub ↗
(params: Record<string, unknown>, context: ToolExecutionContext)

Source from the content-addressed store, hash-verified

19}
20
21function handler(params: Record<string, unknown>, context: ToolExecutionContext): ToolResult {
22 const db = context.db!
23 const meta = getSessionMeta(db)
24 const overview = getSessionOverview(db)
25 const includeMembers = params.include_members as boolean
26
27 const data: Record<string, unknown> = { ...meta, ...overview }
28
29 if (includeMembers) {
30 data.members = getMembers(db)
31 }
32
33 return {
34 content: JSON.stringify(data),
35 data,
36 }
37}
38
39export const sessionInfoTool: ToolDefinition = {
40 name: 'get_session_info',

Callers

nothing calls this directly

Calls 3

getSessionMetaFunction · 0.90
getSessionOverviewFunction · 0.90
getMembersFunction · 0.90

Tested by

no test coverage detected