basecamp_list_comments
Retrieve comments from any Basecamp resource like messages, todos, or cards to review discussions and track project feedback.
Instructions
List comments on any Basecamp resource (message, todo, card, etc.). Works universally on all recording types.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket_id | Yes | Basecamp resource identifier | |
| recording_id | Yes | ID of the resource (message, todo, card, etc.) |
Implementation Reference
- src/tools/comments.ts:40-77 (handler)The handler function that lists comments on a Basecamp resource by initializing the client, fetching paged comments, serializing them (ID, creator, content, created_at), and returning as formatted JSON text content.async (params) => { try { const client = await initializeBasecampClient(); const comments = await asyncPagedToArray({ fetchPage: client.comments.list, request: { params: { bucketId: params.bucket_id, recordingId: params.recording_id, }, query: {}, }, }); return { content: [ { type: "text", text: JSON.stringify( comments.map((c) => ({ id: c.id, creator: serializePerson(c.creator), content: c.content, created_at: c.created_at, })), null, 2, ), }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } },
- src/schemas/common.ts:10-12 (schema)Zod schema defining Basecamp resource IDs as numbers, reused in the tool's input schema for bucket_id and recording_id.export const BasecampIdSchema = z .number() .describe("Basecamp resource identifier");
- src/tools/comments.ts:21-78 (registration)Registers the 'basecamp_list_comments' tool with the MCP server, specifying title, description, input schema (bucket_id and recording_id), annotations, and the handler function.server.registerTool( "basecamp_list_comments", { title: "List Basecamp Comments", description: "List comments on any Basecamp resource (message, todo, card, etc.). Works universally on all recording types.", inputSchema: { bucket_id: BasecampIdSchema, recording_id: BasecampIdSchema.describe( "ID of the resource (message, todo, card, etc.)", ), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async (params) => { try { const client = await initializeBasecampClient(); const comments = await asyncPagedToArray({ fetchPage: client.comments.list, request: { params: { bucketId: params.bucket_id, recordingId: params.recording_id, }, query: {}, }, }); return { content: [ { type: "text", text: JSON.stringify( comments.map((c) => ({ id: c.id, creator: serializePerson(c.creator), content: c.content, created_at: c.created_at, })), null, 2, ), }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } }, );