UNPKG

businessmap-mcp

Version:

MCP server for Businessmap Kanbanize, exposing tools for managing business entities like boards, cards, and columns, facilitating LLM interaction.

70 lines (69 loc) 3.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CardCommentsToolsController = void 0; const zod_1 = require("zod"); const ApiService_1 = require("../../services/ApiService"); const apiResponseHandler_1 = require("../../utils/apiResponseHandler"); const env_1 = require("../../utils/env"); class CardCommentsToolsController { server; constructor(server) { this.server = server; this.registerTools(); } registerTools() { this.registerGetCardCommentsToolhandler(); this.registerGetCardCommentToolhandler(); if (!env_1.env.BUSINESSMAP_READ_ONLY) { this.registerAddCardCommentToolhandler(); this.registerUpdateCardCommentToolhandler(); this.registerDeleteCardCommentToolhandler(); } } registerGetCardCommentsToolhandler() { this.server.tool("get-card-comments", "Get a card's comments", { cardId: zod_1.z.string().describe("A card id"), }, async ({ cardId }) => { const response = await ApiService_1.apiServices.getCardComments(cardId); return (0, apiResponseHandler_1.handleApiResponse)(response); }); } registerAddCardCommentToolhandler() { this.server.tool("add-card-comment", "Add a comment to a card", { cardId: zod_1.z.string().describe("A card id"), comment: zod_1.z.string().describe("Comment to be added"), }, async ({ cardId, comment }) => { const response = await ApiService_1.apiServices.addCardComment(cardId, comment); return (0, apiResponseHandler_1.handleApiResponse)(response); }); } registerGetCardCommentToolhandler() { this.server.tool("get-card-comment", "Get the details of a comment for a card", { cardId: zod_1.z.string().describe("A card id"), commentId: zod_1.z.string().describe("A comment id"), }, async ({ cardId, commentId }) => { const response = await ApiService_1.apiServices.getCardComment(cardId, commentId); return (0, apiResponseHandler_1.handleApiResponse)(response); }); } registerUpdateCardCommentToolhandler() { this.server.tool("update-card-comment", "Update the details of a comment for a card", { cardId: zod_1.z.string().describe("A card id"), commentId: zod_1.z.string().describe("A comment id"), comment: zod_1.z.string().describe("A comment a updated"), }, async ({ cardId, commentId, comment }) => { const response = await ApiService_1.apiServices.updateCardComment(cardId, commentId, comment); return (0, apiResponseHandler_1.handleApiResponse)(response); }); } registerDeleteCardCommentToolhandler() { this.server.tool("delete-card-comment", "Delete a comment for a card", { cardId: zod_1.z.string().describe("A card id"), commentId: zod_1.z.string().describe("A comment id"), }, async ({ cardId, commentId }) => { const response = await ApiService_1.apiServices.deleteCardComment(cardId, commentId); return (0, apiResponseHandler_1.handleApiResponse)(response); }); } } exports.CardCommentsToolsController = CardCommentsToolsController;