list_cards
Browse and filter Metabase cards and questions to discover available data queries, find specific card types, or view all system questions with optional filtering by ownership, bookmarks, or database relationships.
Instructions
📋 [SAFE] List Metabase cards/questions with optional filtering. Use this to discover available cards, find cards by type, or see all questions in the system. Can return large results (15k+ cards). Risk: None - read-only, but may be slow with many cards.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filter type: all (all cards), mine (my cards), bookmarked, database, table, using_model, using_segment, archived | all |
| modelId | No | Model ID for filtering (only when filter=using_model) |
Implementation Reference
- Schema definition for the 'list_cards' tool including input parameters and validation rules.{ name: 'list_cards', description: '📋 [SAFE] List Metabase cards/questions with optional filtering. Use this to discover available cards, find cards by type, or see all questions in the system. Can return large results (15k+ cards). Risk: None - read-only, but may be slow with many cards.', inputSchema: { type: 'object', properties: { filter: { type: 'string', description: 'Filter type: all (all cards), mine (my cards), bookmarked, database, table, using_model, using_segment, archived', enum: ['all', 'mine', 'bookmarked', 'database', 'table', 'using_model', 'using_segment', 'archived'], default: 'all', }, modelId: { type: 'integer', description: 'Model ID for filtering (only when filter=using_model)', minimum: 1, }, }, }, },
- Implementation of the listCards handler function that fetches and formats the list of cards from the Metabase API based on filter and modelId.async listCards(filter = 'all', modelId = null) { this.logger.debug('Listing cards', { filter, modelId }); const params = new URLSearchParams({ f: filter }); if (modelId) { params.append('model_id', modelId); } const response = await this.apiClient.makeRequest(`/api/card/?${params}`); const cards = Array.isArray(response) ? response : response.data || []; const cardList = cards.map(card => ({ id: card.id, name: card.name, description: card.description, databaseId: card.dataset_query?.database, queryType: card.dataset_query?.type, createdAt: card.created_at, })); return { content: [ { type: 'text', text: `Found ${cardList.length} cards (filter: ${filter}): ${cardList.slice(0, 50).map(card => `- ID: ${card.id} | Name: ${card.name} | DB: ${card.databaseId} | Type: ${card.queryType}` ).join('\n')}${cardList.length > 50 ? `\n... and ${cardList.length - 50} more cards` : ''}`, }, ], }; }
- src/server/MetabaseMCPServer.js:170-171 (registration)Registration and dispatch of the 'list_cards' tool to the CardHandlers.listCards method in the MCP server switch statement.case 'list_cards': return await this.cardHandlers.listCards(args.filter, args.modelId);