add_card_description
Add descriptive content to Focalboard cards using markdown formatting to document tasks, provide context, or attach detailed information directly within cards.
Instructions
Add or set description/content to a card. Creates a new text block with markdown content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardId | Yes | The ID of the card to add description to | |
| boardId | Yes | The ID of the board the card belongs to | |
| description | Yes | The description content in markdown format |
Implementation Reference
- src/index.ts:197-218 (registration)Tool registration entry defining the name, description, and input schema for 'add_card_description'.{ name: 'add_card_description', description: 'Add or set description/content to a card. Creates a new text block with markdown content.', inputSchema: { type: 'object', properties: { cardId: { type: 'string', description: 'The ID of the card to add description to' }, boardId: { type: 'string', description: 'The ID of the board the card belongs to' }, description: { type: 'string', description: 'The description content in markdown format' } }, required: ['cardId', 'boardId', 'description'] } },
- src/index.ts:456-476 (handler)Handler logic for executing the 'add_card_description' tool: validates parameters, sets the description using the Focalboard client, retrieves the updated card, and returns it as JSON.case 'add_card_description': { const cardId = args?.cardId as string; const boardId = args?.boardId as string; const description = args?.description as string; if (!cardId || !boardId || !description) { throw new Error('cardId, boardId, and description are required'); } await focalboard.setCardDescription(boardId, cardId, description); const card = await focalboard.getCard(cardId); return { content: [ { type: 'text', text: JSON.stringify(card, null, 2) } ] }; }
- src/focalboard-client.ts:419-445 (helper)Core helper function that implements the description setting logic: checks for existing text block and updates it, or creates a new one if none exists.async setCardDescription(boardId: string, cardId: string, description: string): Promise<Block> { // Get existing content blocks const contentBlocks = await this.getCardContent(cardId); const textBlocks = contentBlocks.filter(block => block.type === 'text'); if (textBlocks.length > 0) { // Update the first text block directly const textBlock = textBlocks[0]; await this.makeRequest<void>( `/boards/${boardId}/blocks/${textBlock.id}`, 'PATCH', { title: description } ); // Fetch and return the updated block const updatedBlocks = await this.makeRequest<Block[]>( `/boards/${boardId}/blocks`, 'GET', undefined, { block_id: textBlock.id } ); return updatedBlocks[0]; } else { // Create a new text block return this.createTextBlock(boardId, cardId, description); } }