Skip to main content
Glama
MikelA92

Metabase MCP Server

by MikelA92

list_cards

Retrieve Metabase cards and questions with filtering options to discover available data visualizations, find specific card types, or view all questions in your system.

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
NameRequiredDescriptionDefault
filterNoFilter type: all (all cards), mine (my cards), bookmarked, database, table, using_model, using_segment, archivedall
modelIdNoModel ID for filtering (only when filter=using_model)

Implementation Reference

  • The main handler function that implements the list_cards tool logic. It fetches cards from the Metabase API using the provided filter and optional modelId, processes them, limits display to 50, and returns formatted text content.
      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` : ''}`,
            },
          ],
        };
      }
  • The tool definition including name, description, and input schema for validation of list_cards tool parameters.
    {
      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,
          },
        },
      },
    },
  • The switch case in executeTool method that registers and dispatches the list_cards tool call to the CardHandlers.listCards method.
    case 'list_cards':
      return await this.cardHandlers.listCards(args.filter, args.modelId);
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well: explicitly declares safety ('[SAFE]', 'read-only'), performance characteristics ('may be slow with many cards', 'Can return large results'), and scope ('15k+ cards'). It doesn't mention pagination, rate limits, or authentication needs, but covers core behavioral traits adequately.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with purpose first, then usage context, then behavioral notes. Every sentence adds value: safety labeling, use cases, performance warning. Slightly verbose with emoji and parentheticals, but information-dense and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only listing tool with no annotations but full schema coverage, the description provides good context: safety, performance, use cases. Missing output format details (no output schema), but covers most essential aspects given the tool's complexity. Could mention pagination or result structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing complete parameter documentation. The description adds minimal value beyond schema ('with optional filtering'), not explaining parameter relationships or usage patterns. Baseline 3 is appropriate since schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('Metabase cards/questions') with specific scope ('with optional filtering'). It distinguishes from siblings like 'get_card' (single card) and 'execute_card_query' (run card) by emphasizing discovery and listing functions. The purpose is specific and well-differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use ('to discover available cards, find cards by type, or see all questions in the system') and provides clear risk/performance context ('may be slow with many cards'). It differentiates from execution-focused siblings by positioning this as a discovery tool, though doesn't explicitly name alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/MikelA92/metabase-mcp-mab'

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