Skip to main content
Glama
MikelA92

Metabase MCP Server

by MikelA92

get_dashboard

Retrieve a Metabase dashboard by ID to view its structure, cards, layout, and parameters for analysis or documentation purposes.

Instructions

๐Ÿ“Š [SAFE] Get a dashboard by ID including all its cards, layout, and parameters. Use this to understand dashboard structure or see all questions in a dashboard at once. Risk: None - read-only operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dashboardIdYesThe ID of the dashboard to retrieve

Implementation Reference

  • The getDashboard method in DashboardHandlers class that validates the dashboardId, fetches dashboard details and cards from Metabase API, formats the information into a markdown text block, and returns it as tool content.
      async getDashboard(dashboardId) {
        Validators.validateDashboardId(dashboardId);
        
        this.logger.debug('Getting dashboard', { dashboardId });
        const dashboard = await this.apiClient.makeRequest(`/api/dashboard/${dashboardId}`);
        
        const cards = dashboard.dashcards?.map(dc => ({
          cardId: dc.card_id,
          cardName: dc.card?.name,
          row: dc.row,
          col: dc.col,
        })) || [];
    
        return {
          content: [
            {
              type: 'text',
              text: `Dashboard Information:
    ID: ${dashboard.id}
    Name: ${dashboard.name}
    Description: ${dashboard.description || 'No description'}
    Created: ${dashboard.created_at}
    Updated: ${dashboard.updated_at}
    Number of Cards: ${cards.length}
    
    Cards in Dashboard:
    ${cards.map(c => `- Card ${c.cardId}: ${c.cardName} (Row: ${c.row}, Col: ${c.col})`).join('\n')}`,
            },
          ],
        };
      }
  • The tool definition including name, description, and input schema requiring a dashboardId integer.
      name: 'get_dashboard',
      description: '๐Ÿ“Š [SAFE] Get a dashboard by ID including all its cards, layout, and parameters. Use this to understand dashboard structure or see all questions in a dashboard at once. Risk: None - read-only operation.',
      inputSchema: {
        type: 'object',
        properties: {
          dashboardId: {
            type: 'integer',
            description: 'The ID of the dashboard to retrieve',
            minimum: 1,
          },
        },
        required: ['dashboardId'],
      },
    },
  • Tool dispatch registration in the executeTool switch statement that calls the dashboardHandlers.getDashboard with the provided dashboardId argument.
    case 'get_dashboard':
      return await this.dashboardHandlers.getDashboard(args.dashboardId);

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