basecamp_get_message
Retrieve a specific message from a Basecamp message board by providing the project ID and message ID to access project communications.
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-80 (handler)Handler function that executes the basecamp_get_message tool logic: initializes Basecamp client, retrieves message by bucket_id and message_id, serializes response data (id, subject, content, author, dates, url) as JSON text content, handles API errors.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 and metadata for basecamp_get_message tool: requires bucket_id and message_id (using shared BasecampIdSchema), read-only idempotent tool.{ 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-81 (registration)Direct registration of the basecamp_get_message tool within registerMessageTools function.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) }], }; } }, );
- src/index.ts:62-62 (registration)Top-level registration call in main server setup that invokes registerMessageTools to register message tools including basecamp_get_message.registerMessageTools(server);
- src/schemas/common.ts:10-12 (schema)Shared Zod schema for Basecamp IDs, used in inputSchema for bucket_id and message_id.export const BasecampIdSchema = z .number() .describe("Basecamp resource identifier");