basecamp_create_comment
Add HTML comments to Basecamp resources like messages, todos, or cards. Mention people using attachable SGIDs for team 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 | |
| recording_id | Yes | ||
| content | Yes | HTML comment content. To mention people: <bc-attachment sgid="{ person.attachable_sgid }"></bc-attachment> |
Implementation Reference
- src/tools/comments.ts:103-131 (handler)The main handler logic for creating a Basecamp comment using the client API.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:80-132 (registration)Registration of the 'basecamp_create_comment' tool with MCP server, including inline 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) }], }; } }, );
- src/schemas/common.ts:10-12 (schema)Shared Zod schema for Basecamp IDs (bucket_id and recording_id parameters).export const BasecampIdSchema = z .number() .describe("Basecamp resource identifier");