Skip to main content
Glama

add-comment

Add comments to Trello cards to provide updates, ask questions, or share information directly from your workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdYesID of the card to comment on
textYesComment text

Implementation Reference

  • The handler function that executes the add-comment tool by posting a comment to the specified Trello card ID using the Trello API.
    async ({ cardId, text }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/cards/${cardId}/actions/comments?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ text, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error adding comment: ${error}`, }, ], isError: true, }; } }
  • Zod schema defining the input parameters for the add-comment tool: cardId and text.
    cardId: z.string().describe('ID of the card to comment on'), text: z.string().describe('Comment text'), },
  • Registration of the 'add-comment' tool using server.tool() within the registerCardsTools function.
    server.tool( 'add-comment', { cardId: z.string().describe('ID of the card to comment on'), text: z.string().describe('Comment text'), }, async ({ cardId, text }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/cards/${cardId}/actions/comments?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ text, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error adding comment: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:90-90 (registration)
    Top-level call to registerCardsTools, which includes registration of the 'add-comment' tool.
    registerCardsTools(server, credentials);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adriangrahldev/advanced-trello-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server