get_dashboard
Retrieve dashboard details including cards, layout, and parameters by ID to understand dashboard structure and view all questions in a dashboard.
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 core handler function for the get_dashboard tool. It validates the dashboard ID, fetches the dashboard data from the Metabase API, extracts information about the dashboard and its cards (dashcards), and returns a formatted text content block with dashboard details including ID, name, description, timestamps, card count, and a list of cards with their positions.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 JSON schema definition for the get_dashboard tool, including name, description, and input schema requiring a positive integer dashboardId.{ 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)The registration and dispatch logic in the MCP server's executeTool method switch statement, which routes calls to the get_dashboard tool to the dashboardHandlers.getDashboard method.case 'get_dashboard': return await this.dashboardHandlers.getDashboard(args.dashboardId);