basecamp_get_message
Retrieve a specific message from a Basecamp project message board by providing the project ID and message ID to access detailed message content and information.
Instructions
Retrieve a single message from a Basecamp message board.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucket_id | Yes | Project/bucket ID containing the message | |
| message_id | Yes | Message ID to retrieve |
Implementation Reference
- src/tools/messages.ts:41-79 (handler)The asynchronous handler function that initializes the Basecamp client, fetches the specified message, serializes relevant fields including content and author, and returns it as formatted JSON text content. Handles errors with a standardized error message.async (params) => { try { const client = await initializeBasecampClient(); const response = await client.messages.get({ params: { bucketId: params.bucket_id, messageId: params.message_id }, }); if (response.status !== 200 || !response.body) { throw new Error(`Failed to fetch message: ${response.status}`); } const msg = response.body; return { content: [ { type: "text", text: JSON.stringify( { id: msg.id, subject: msg.title, content: msg.content || "", author: serializePerson(msg.creator), created_at: msg.created_at, updated_at: msg.updated_at, url: msg.app_url, }, null, 2, ), }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } },
- src/tools/messages.ts:25-40 (schema)Input schema definition for the tool, specifying bucket_id and message_id using the shared BasecampIdSchema, along with title, description, and annotations indicating read-only, idempotent behavior.{ title: "Get Basecamp Message", description: `Retrieve a single message from a Basecamp message board.`, inputSchema: { bucket_id: BasecampIdSchema.describe( "Project/bucket ID containing the message", ), message_id: BasecampIdSchema.describe("Message ID to retrieve"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, },
- src/tools/messages.ts:23-80 (registration)Registration of the basecamp_get_message tool via server.registerTool call within the registerMessageTools function, including schema and handler.server.registerTool( "basecamp_get_message", { title: "Get Basecamp Message", description: `Retrieve a single message from a Basecamp message board.`, inputSchema: { bucket_id: BasecampIdSchema.describe( "Project/bucket ID containing the message", ), message_id: BasecampIdSchema.describe("Message ID to retrieve"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async (params) => { try { const client = await initializeBasecampClient(); const response = await client.messages.get({ params: { bucketId: params.bucket_id, messageId: params.message_id }, }); if (response.status !== 200 || !response.body) { throw new Error(`Failed to fetch message: ${response.status}`); } const msg = response.body; return { content: [ { type: "text", text: JSON.stringify( { id: msg.id, subject: msg.title, content: msg.content || "", author: serializePerson(msg.creator), created_at: msg.created_at, updated_at: msg.updated_at, url: msg.app_url, }, null, 2, ), }, ], }; } catch (error) { return { content: [{ type: "text", text: handleBasecampError(error) }], }; } }, );