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
| Name | Required | Description | Default |
|---|---|---|---|
| dashboardId | Yes | The 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'], }, },
- src/server/MetabaseMCPServer.js:180-181 (registration)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);