add-comment
Add comments to Trello cards by specifying the card ID and comment text, enabling direct communication and task updates within the Trello platform.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardId | Yes | ID of the card to comment on | |
| text | Yes | Comment text |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"cardId": {
"description": "ID of the card to comment on",
"type": "string"
},
"text": {
"description": "Comment text",
"type": "string"
}
},
"required": [
"cardId",
"text"
],
"type": "object"
}
Implementation Reference
- src/tools/card-tool-handlers.ts:95-98 (handler)Handler function for the 'add_comment' tool. It extracts cardId and text from arguments and delegates to CardService.addComment to perform the operation.add_comment: async (args: any) => { const cardService = ServiceFactory.getInstance().getCardService(); return cardService.addComment(args.cardId, args.text); },
- src/tools/card-tools.ts:278-294 (schema)Tool schema definition for 'add_comment', including name, description, and input validation schema requiring cardId and text.name: "add_comment", description: "Add a comment to a card. Use this tool to add notes or feedback to a card.", inputSchema: { type: "object", properties: { cardId: { type: "string", description: "ID of the card" }, text: { type: "string", description: "Text of the comment" } }, required: ["cardId", "text"] } },
- src/services/card-service.ts:145-147 (helper)Core service method that makes the Trello API POST request to add a comment action to the specified card.async addComment(cardId: string, text: string): Promise<any> { return this.trelloService.post<any>(`/cards/${cardId}/actions/comments`, { text }); }
- src/tools/trello-tool-handlers.ts:18-25 (registration)Aggregates all tool handlers, including cardToolHandlers containing 'add_comment', for registration in the MCP server.export const trelloToolHandlers = { ...boardToolHandlers, ...listToolHandlers, ...cardToolHandlers, ...memberToolHandlers, ...labelToolHandlers, ...checklistToolHandlers };
- src/index.ts:92-96 (registration)Registers the list tools handler which returns all tools including 'add_comment' from aggregated trelloTools.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: trelloTools }; });