Skip to main content
Glama

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
NameRequiredDescriptionDefault
cardIdYesThe ID of the card to add description to
boardIdYesThe ID of the board the card belongs to
descriptionYesThe 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'] } },
  • 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) } ] }; }
  • 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); } }

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/gmjuhasz/focalboard-mcp-server'

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