get_card_with_parameters
Extract card ID and applied parameters from Metabase dashboard URLs with filters for analysis or integration purposes.
Instructions
๐ [SAFE] Get a card with applied parameters from dashboard URL. Use this to extract card ID and parameters from Metabase dashboard URLs with filters. Risk: None - read-only operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The full Metabase dashboard URL with encoded parameters |
Implementation Reference
- The main handler function that implements the get_card_with_parameters tool. It decodes the provided dashboard URL, fetches the base card information from the Metabase API, and returns formatted details including applied parameters, dataset query, and visualization settings.
async getCardWithParameters(url) { Validators.validateUrl(url); this.logger.debug('Getting card with parameters from URL'); const decoded = DashboardUrlDecoder.decode(url); const baseCard = await this.apiClient.makeRequest(`/api/card/${decoded.originalCardId}`); return { content: [ { type: 'text', text: `Card with Parameters: Original Card ID: ${decoded.originalCardId} Card Name: ${baseCard.name} Description: ${baseCard.description || 'No description'} Database ID: ${baseCard.dataset_query?.database} Query Type: ${baseCard.dataset_query?.type} Display Type: ${decoded.display} Applied Parameters: ${JSON.stringify(decoded.parameters, null, 2)} Dataset Query: ${JSON.stringify(decoded.datasetQuery, null, 2)} Visualization Settings: ${JSON.stringify(decoded.visualizationSettings, null, 2)}`, }, ], }; } - src/server/MetabaseMCPServer.js:184-185 (registration)The switch case in the executeTool method that routes calls to the 'get_card_with_parameters' tool to the appropriate dashboard handler.
case 'get_card_with_parameters': return await this.dashboardHandlers.getCardWithParameters(args.url); - The tool definition including name, description, and input schema (requires 'url' parameter) used for MCP tool registration and validation.
name: 'get_card_with_parameters', description: '๐ [SAFE] Get a card with applied parameters from dashboard URL. Use this to extract card ID and parameters from Metabase dashboard URLs with filters. Risk: None - read-only operation.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The full Metabase dashboard URL with encoded parameters', }, }, required: ['url'], }, },