basecamp_create_comment
Add comments to Basecamp resources like messages, todos, and cards to facilitate team discussions and project collaboration.
Instructions
Add a comment to any Basecamp resource (message, todo, card, etc.).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket_id | Yes | Basecamp resource identifier | |
| content | Yes | Comment content (HTML supported) | |
| recording_id | Yes |
Implementation Reference
- src/tools/comments.ts:103-131 (handler)The handler function that executes the tool logic: initializes the Basecamp client, creates a comment on the specified bucket and recording, handles errors, and returns success or error message.async (params) => { try { const client = await initializeBasecampClient(); const response = await client.comments.create({ params: { bucketId: params.bucket_id, recordingId: params.recording_id, }, body: { content: params.content }, }); if (response.status !== 201 || !response.body) { throw new Error("Failed to create comment"); } return { content: [ { type: "text", text: `Comment posted!\n\nID: ${response.body.id}`, }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } },
- src/tools/comments.ts:82-102 (schema)Input schema definition for the tool, specifying parameters: bucket_id, recording_id, and content (HTML string).{ title: "Create Basecamp Comment", description: "Add a comment to any Basecamp resource (message, todo, card, etc.).", inputSchema: { bucket_id: BasecampIdSchema, recording_id: BasecampIdSchema, content: z .string() .min(1) .describe( `HTML comment content. To mention people: <bc-attachment sgid="{ person.attachable_sgid }"></bc-attachment>`, ), }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, },
- src/tools/comments.ts:80-132 (registration)Registration of the 'basecamp_create_comment' tool in the MCP server, including schema and handler.server.registerTool( "basecamp_create_comment", { title: "Create Basecamp Comment", description: "Add a comment to any Basecamp resource (message, todo, card, etc.).", inputSchema: { bucket_id: BasecampIdSchema, recording_id: BasecampIdSchema, content: z .string() .min(1) .describe( `HTML comment content. To mention people: <bc-attachment sgid="{ person.attachable_sgid }"></bc-attachment>`, ), }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, }, async (params) => { try { const client = await initializeBasecampClient(); const response = await client.comments.create({ params: { bucketId: params.bucket_id, recordingId: params.recording_id, }, body: { content: params.content }, }); if (response.status !== 201 || !response.body) { throw new Error("Failed to create comment"); } return { content: [ { type: "text", text: `Comment posted!\n\nID: ${response.body.id}`, }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } }, );