Skip to main content
Glama
MikelA92
by MikelA92

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
NameRequiredDescriptionDefault
dashboardIdYesThe 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'], }, },
  • 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);

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