Skip to main content
Glama

get_cards

Retrieve and list all tasks from a Focalboard with pagination support for organized project management.

Instructions

List all cards (tasks) in a board with pagination support.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boardIdYesThe ID of the board to list cards from
pageNoPage number for pagination (default: 0)
perPageNoNumber of cards per page (default: 100)

Implementation Reference

  • The MCP tool handler for 'get_cards'. Extracts boardId, page, and perPage from input arguments, calls the focalboard client's getCards method, and returns the list of cards as formatted JSON text content.
    case 'get_cards': {
      const boardId = args?.boardId as string;
      const page = (args?.page as number) || 0;
      const perPage = (args?.perPage as number) || 100;
    
      if (!boardId) {
        throw new Error('boardId is required');
      }
    
      const cards = await focalboard.getCards(boardId, page, perPage);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(cards, null, 2)
          }
        ]
      };
    }
  • JSON schema defining the input parameters for the 'get_cards' tool: boardId (required), page and perPage (optional with defaults).
    inputSchema: {
      type: 'object',
      properties: {
        boardId: {
          type: 'string',
          description: 'The ID of the board to list cards from'
        },
        page: {
          type: 'number',
          description: 'Page number for pagination (default: 0)',
          default: 0
        },
        perPage: {
          type: 'number',
          description: 'Number of cards per page (default: 100)',
          default: 100
        }
      },
      required: ['boardId']
    }
  • src/index.ts:108-131 (registration)
    Registration of the 'get_cards' tool in the tools array, including name, description, and input schema. This array is used by the ListToolsRequestHandler.
    {
      name: 'get_cards',
      description: 'List all cards (tasks) in a board with pagination support.',
      inputSchema: {
        type: 'object',
        properties: {
          boardId: {
            type: 'string',
            description: 'The ID of the board to list cards from'
          },
          page: {
            type: 'number',
            description: 'Page number for pagination (default: 0)',
            default: 0
          },
          perPage: {
            type: 'number',
            description: 'Number of cards per page (default: 100)',
            default: 100
          }
        },
        required: ['boardId']
      }
    },
  • Helper method in FocalboardClient that performs the actual API request to retrieve cards from a board with pagination, called by the tool handler.
    async getCards(boardId: string, page: number = 0, perPage: number = 100): Promise<Card[]> {
      return this.makeRequest<Card[]>(
        `/boards/${boardId}/cards`,
        'GET',
        undefined,
        { page: page.toString(), per_page: perPage.toString() }
      );
    }

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