MCPcopy Create free account
hub / github.com/CopilotKit/OpenTag / handler

Function handler

app/tools/read-thread.ts:24–34  ·  view source on GitHub ↗
(_args, { thread })

Source from the content-addressed store, hash-verified

22 "the messages in chronological order with author and timestamp.",
23 parameters: z.object({}),
24 async handler(_args, { thread }) {
25 const messages = await thread.getMessages();
26 return {
27 count: messages.length,
28 messages: messages.map((m) => ({
29 user: m.user?.name ?? m.user?.handle ?? (m.isBot ? "bot" : "unknown"),
30 text: m.text,
31 ts: m.ts,
32 })),
33 };
34 },
35});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected