list_activity
Display recent project activity feed from Codecks to track updates, manage workflows, and monitor team progress.
Instructions
Show recent activity feed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- src/tools/read.ts:299-330 (registration)Tool registration with schema definition. The list_activity tool is registered with title 'List Activity', description, and input schema (z.object with limit parameter default 20). This includes both the registration metadata and the handler function that executes the tool logic.server.registerTool( "list_activity", { title: "List Activity", description: "Show recent activity feed.", inputSchema: z.object({ limit: z.number().default(20), }), }, async (args) => { try { const result = await client.listActivity(args.limit); return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(sanitizeActivity(result))), }, ], }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(handleError(err))), }, ], }; } }, );
- src/tools/read.ts:308-329 (handler)The actual handler function that executes when list_activity is called. It takes the limit argument, calls client.listActivity(), sanitizes the result with sanitizeActivity(), and returns the JSON-formatted response with error handling.async (args) => { try { const result = await client.listActivity(args.limit); return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(sanitizeActivity(result))), }, ], }; } catch (err) { return { content: [ { type: "text", text: JSON.stringify(finalizeToolResult(handleError(err))), }, ], }; } },
- src/client.ts:247-263 (handler)The client-side listActivity method that performs the actual GraphQL query. It queries the account's activityEntries with fields: id, type, createdAt, card (id, title), and user (name), then extracts and returns the entries list.async listActivity(limit = 20): Promise<Record<string, unknown>> { const result = await query({ _root: [ { account: [ { activityEntries: { _args: { limit }, _fields: ["id", "type", "createdAt", { card: ["id", "title"] }, { user: ["name"] }], }, }, ], }, ], }); return { entries: this.extractList(result, "activityEntries") }; }
- src/security.ts:98-113 (helper)The sanitizeActivity helper function that sanitizes activity data by applying tagUserText to card titles for security purposes, ensuring user-generated content is properly tagged.export function sanitizeActivity(data: Record<string, unknown>): Record<string, unknown> { const out = { ...data }; if (out.cards && typeof out.cards === "object" && !Array.isArray(out.cards)) { const cards = out.cards as Record<string, Record<string, unknown>>; const tagged: Record<string, Record<string, unknown>> = {}; for (const [id, card] of Object.entries(cards)) { const c = { ...card }; if (typeof c.title === "string") { c.title = tagUserText(c.title as string); } tagged[id] = c; } out.cards = tagged; } return out; }