Model Context Protocol (MCP) server for Lightdash analytics platform
The Lightdash MCP server has 12 tools with generally clear names and reasonably detailed descriptions, but significant gaps in schema formalization, parameter validation, and error handling reduce overall quality. Tool descriptions are verbose (often 200-400+ chars) with embedded examples and working code samples, which is helpful for initial understanding but violates the LLM-optimization principle, LLMs tend to reuse embedded examples literally. Many parameters lack explicit type definitions and constraints in the schema. The server implements basic tool registration and STDIO communication but lacks protocol-level features (no toolAnnotations, no error classification guidance, no recovery hints). The codebase is well-structured with a base_tool framework and registry pattern, but critical production hardening is missing.
Create a new saved chart in a space. Requires table name, metric query, and chart configuration. ⚠️ CRITICAL: Chart configuration structure must be precise or the chart will break! ═══════════════════════════════════════════════════════════════════ COMPLETE WORKING EXAMPLE - Line Chart with Count Distinct Metric: ═══════════════════════════════════════════════════════════════════ metricQuery: { "exploreName": "my_table", "dimensions": ["my_table_date_day"], "metrics": [], "filters": { "dimensions": { "id": "root", "and": [ { "id": "filter_1", "target": {"fieldId": "my_table_country"}, "operator": "equals", "values": ["US"] }, { "id": "filter_2", "target": {"fieldId": "my_table_date_day"}, "values": [30], "operator": "inThePast", "required": false, "settings": { "completed": false, "unitOfTime": "days" } } ] } }, "sorts": [{"fieldId": "my_table_date_day", "descending": true}], "limit": 500, "tableCalculations": [], "additionalMetrics": [ { "name": "dau", "label": "Daily Active Users", "description": "Count of unique users", "type": "count_distinct", "sql": "${TABLE}.user_id", "table": "my_table", "baseDimensionName": "user_id", "formatOptions": {"type": "default", "separator": "default"} } ] } chartConfig: { "type": "cartesian", "config": { "layout": { "xField": "my_table_date_day", "yField": ["my_table_dau"], "flipAxes": false }, "eChartsConfig": { "xAxis": [{"name": "Date"}], "yAxis": [{"name": "DAU"}], "series": [ { "type": "line", "encode": { "xRef": {"field": "my_table_date_day"}, "yRef": {"field": "my_table_dau"} }, "yAxisIndex": 0 } ] } } } pivotConfig (optional): { "columns": ["my_table_country"] } ═══════════════════════════════════════════════════════════════════ EXAMPLE WITH CUSTOM DIMENSIONS - Stacked/Segmented Charts: ═══════════════════════════════════════════════════════════════════ Use Case: Create grouped/segmented visualizations by categorizing data into meaningful buckets (e.g., Top N + "Other" pattern, status groupings, etc.) metricQuery: { "exploreName": "your_table", "dimensions": ["your_table_date_day", "category_dimension"], "metrics": [], "filters": { "dimensions": { "id": "root", "and": [ { "id": "filter_1", "target": {"fieldId": "your_table_date_day"}, "values": [30], "operator": "inThePast", "required": false, "settings": {"completed": false, "unitOfTime": "days"} } ] } }, "sorts": [{"fieldId": "your_table_date_day", "descending": true}], "limit": 500, "additionalMetrics": [ { "name": "unique_count", "label": "Unique Count", "type": "count_distinct", "sql": "${TABLE}.identifier_column", "table": "your_table", "baseDimensionName": "identifier_column" } ], "customDimensions": [ { "id": "category_dimension", "name": "Category Dimension", "type": "sql", "table": "your_table", "sql": "CASE\n WHEN raw_field = 'value1' THEN 'Category A'\n WHEN raw_field = 'value2' THEN 'Category B'\n WHEN raw_field IN ('value3', 'value4') THEN 'Category C'\n ELSE 'Other'\n END", "dimensionType": "string" } ] } chartConfig: { "type": "cartesian", "config": { "layout": { "xField": "your_table_date_day", "yField": ["your_table_unique_count"], "flipAxes": false }, "eChartsConfig": { "xAxis": [{"name": "Date"}], "yAxis": [{"name": "Count"}], "series": [ { "type": "bar", "stack": "your_table_unique_count", "encode": { "xRef": {"field": "your_table_date_day"}, "yRef": {"field": "your_table_unique_count"} }, "yAxisIndex": 0 } ] } } } pivotConfig: { "columns": ["category_dimension"] } Key Pattern: The custom dimension "category_dimension" is: 1. Defined in customDimensions with SQL CASE logic 2. Added to dimensions array for grouping 3. Used in pivotConfig.columns to create separate stacks/segments per category Result: One stacked segment per CASE branch, visualizing data by category over time ═══════════════════════════════════════════════════════════════════ KEY RULES (MUST FOLLOW): ═══════════════════════════════════════════════════════════════════ 1. additionalMetrics naming: - Metrics are referenced as: "{table}_{metricName}" - Example: table="my_table", name="dau" → "my_table_dau" 2. series.encode MUST use objects (NOT strings): ✅ CORRECT: "xRef": {"field": "my_table_date_day"} ❌ WRONG: "xRef": "my_table_date_day" 3. eChartsConfig.series is required: - Must have at least one series object - Each series MUST have: type, encode.xRef, encode.yRef 4. Metric types for additionalMetrics: - "count_distinct": COUNT(DISTINCT field) - "count": COUNT(*) - "sum": SUM(field) - "avg": AVG(field) - "min": MIN(field) - "max": MAX(field) 5. Filter operators and structures: **Simple filters:** - "equals": {"operator": "equals", "values": ["US"]} - "notEquals": {"operator": "notEquals", "values": ["US"]} - "contains": {"operator": "contains", "values": ["search_term"]} - "notNull": {"operator": "notNull"} - "isNull": {"operator": "isNull"} **Time-based filters (CRITICAL - note the structure):** The "inThePast" operator requires specific structure: { "id": "filter_1", "target": {"fieldId": "table_date_field"}, "values": [30], # ← Number goes HERE
Schema definitions lack explicit type constraints for complex parameters. Parameters like 'metric_query', 'chart_config', 'properties', and 'tiles' are documented as 'JSON string' but have no formal schema validation, pattern definitions, or nested object type specs. This forces LLMs to construct JSON by pattern-matching examples rather than following a type system.
Descriptions embed full working code examples (50-100+ line JSON snippets) with literal example values (e.g., 'my_table', 'my_table_date_day', 'US'). LLMs reuse these literal values in production calls instead of adapting to actual context, causing mismatches. Examples should be moved to separate documentation; descriptions should state structure and constraints only.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 55 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 46 | - | v1 |
Create a new dashboard in the Lightdash project. You can create an empty dashboard (just name and description) or a fully configured dashboard with tiles and tabs. **Tile Types:** - `saved_chart`: Display a saved chart (requires savedChartUuid in properties) - `markdown`: Text/markdown content (requires title and content in properties) - `loom`: Embedded Loom video (requires url in properties) **Tile Position Properties (required for each tile):** - `x`: Column position (0-indexed, grid is 12 columns wide) - `y`: Row position (0-indexed) - `h`: Height in grid units - `w`: Width in grid units (max 12) **When to use:** - To create a new empty dashboard that you'll populate later - To create a fully configured dashboard from a template or copy - Use duplicate-dashboard if you want to copy an existing dashboard **Best practice:** Start with an empty dashboard, then use create-dashboard-tile to add content.
Create a new tile and add it to an existing dashboard. **Required for all tiles:** - Position and size: `x`, `y`, `h`, `w` (in the properties JSON) - Tile type: One of 'saved_chart', 'markdown', 'loom' **Tile-specific requirements:** *saved_chart tiles:* - `savedChartUuid`: UUID of the chart to display (use list-charts to find) - Optional: `title` to override the chart's name *markdown tiles:* - `title`: Display title - `content`: Markdown content to display *loom tiles:* - `url`: Loom video URL - Optional: `title` **CRITICAL - Grid system:** - Dashboard is **36 columns wide** (not 12!) - `x` ranges from 0-35 (column position) - `y` is row position (grows downward) - `w` is width in columns (1-36) - `h` is height in grid units - For 2 tiles per row: use `w: 18` each - For 3 tiles per row: use `w: 12` each - For full width: use `w: 36` **When to use:** - To add charts to a dashboard - To add markdown documentation/headers - To embed Loom videos for context **Best practice:** Use get-dashboard-tiles first to see existing layout and find an empty position.
Create a new space (folder) to organize charts and dashboards. Spaces help organize content by: - Team (e.g., "Marketing Analytics", "Finance") - Product area (e.g., "User Growth", "Revenue") - Development stage (e.g., "Production Dashboards", "Development") **When to use:** - Before creating charts that belong to a new category - To organize existing content into logical groups - To set up restricted areas for sensitive data (use is_private=true) **Best practices:** - Use descriptive names that indicate content purpose - Create private spaces for sensitive or work-in-progress content - Get the space UUID from the response to use when creating charts
Delete a saved chart from the project. **Warning:** This is a destructive operation and cannot be undone. **When to use:** - To remove outdated or incorrect charts - To clean up test/development charts - Before recreating a chart with the same name (delete old, create new) **Important notes:** - Charts still referenced on dashboards will show as broken/missing after deletion - Consider checking which dashboards use this chart before deleting (use get-dashboard-tiles) - For modifying existing charts, use update-chart instead of delete + recreate **Accepts:** Either chart UUID or chart name (will search for exact match)
Delete a tile from a dashboard. This permanently removes a tile from the dashboard. The operation cannot be undone. **When to use:** - To remove outdated or unwanted tiles from a dashboard - To clean up dashboards during reorganization - To remove tiles before replacing them with updated versions **Important notes:** - This is a destructive operation - the tile cannot be recovered after deletion - If the tile displays a saved chart, the chart itself is NOT deleted (only the tile reference) - Dashboard-only charts (charts that exist only in the tile) will be permanently lost - You should save the dashboard after deletion (this is done automatically) **Search behavior:** Matches tile titles case-insensitively with partial matching.
Delete a space (folder). **Important constraints:** - Cannot delete spaces that contain charts or dashboards - Must move or delete all content from the space first - This is a permanent operation **When to use:** - To remove empty, unused spaces - To clean up organizational structure - After moving all content to other spaces **Steps to delete a space with content:** 1. List charts and dashboards in the space 2. Move them to other spaces or delete them 3. Delete the now-empty space **Accepts:** Either space UUID or space name (will search for exact match)
Create a complete copy of an existing dashboard with a new name. This copies everything from the source dashboard: - All tiles with their positions and configurations - All tabs (if the dashboard has tabs) - Dashboard-level filters - Layout and styling **What gets regenerated:** - Dashboard UUID (new unique ID) - Tile UUIDs (new IDs for each tile) - Tab UUIDs (new IDs for each tab) **What stays the same:** - Chart references (tiles still point to the same charts) - Content and configuration - Layout and positioning **When to use:** - To create dashboard variants for different teams/regions - To create a test version before modifying production dashboards - To use an existing dashboard as a template - To create regional/customer-specific versions **Best practice:** Use descriptive names to distinguish the copy from the original.
Get detailed information about a specific saved chart. Returns complete chart configuration including: - Chart type and visualization settings (eChartsConfig) - Metric query configuration (dimensions, metrics, filters, sorts) - Table configuration (column order, conditional formatting) - Metadata (name, description, space, timestamps) **When to use:** - Before modifying or duplicating a chart - To understand how a chart is configured - To extract query logic for reuse - To debug chart issues **Accepts:** Either chart UUID or chart name (will search for exact match) **Note:** Name lookup only covers charts saved to a Space (the list-charts catalog). Charts saved *within a dashboard* are not in that catalog, but a UUID still resolves them directly. To find a dashboard tile's chart by name, use get-dashboard-tile-chart-config.
Get custom metrics defined in the project. Custom metrics are user-defined metrics created in the Lightdash UI that aren't part of the dbt model definitions. These are stored separately and can be used in charts and dashboards. Returns: - Custom metric definitions - SQL expressions used to calculate them - Associated tables/explores - Labels and descriptions **When to use:** - To discover custom business metrics created by analysts - To understand what custom calculations are available - Before using a custom metric in a chart or query **Note:** These are different from metrics defined in your dbt models.
Get the complete dashboard configuration including full tile definitions. Returns the raw dashboard configuration as code, including: - All tile definitions with complete properties - Tab configuration - Filter configuration - Layout information - Chart references **When to use:** - To export a dashboard for version control - To understand the complete structure of a complex dashboard - Before programmatically duplicating a dashboard - To backup dashboard configurations - To debug dashboard issues **Use cases:** - **Backup:** Save dashboard configs before making changes - **Version control:** Track dashboard changes over time - **Migration:** Move dashboards between projects/environments - **Templates:** Create reusable dashboard templates **Alternative:** Use duplicate-dashboard for a simpler way to copy dashboards.
Get the complete chart configuration for a dashboard tile, including dashboard-only charts. Dashboard-only charts store their full configuration (metric query, chart config, visualization settings) directly in the dashboard tile structure. This tool extracts that complete configuration. **Returns:** - Complete chart configuration including: - metricQuery: The query configuration (dimensions, metrics, filters, sorts) - chartConfig: Visualization configuration (chart type, axes, series) - tableConfig: Table column configuration - pivotConfig: Pivot configuration if applicable - For saved charts: retrieves the chart via the savedChartUuid reference - For dashboard-only charts: extracts from tile's belongsToChart property **When to use:** - To get full details of a a chart visible on a dashboard - To understand the configuration of dashboard-only charts - To export or duplicate dashboard-only chart configurations - Before modifying a dashboard tile's chart **Parameters:** - dashboard_name: Name of the dashboard (supports partial matching) - tile_identifier: Title of the tile or partial match
No enum definitions for constrained fields. Parameters like 'tile_type' (should be one of 'saved_chart', 'markdown', 'loom') and metric type operators are described in prose ('must be count_distinct, count, sum, avg, min, max') instead of being declared as enums. This invites hallucinated values from LLMs.
No error classification or recovery guidance. All tools catch exceptions and return generic error text. No distinction between retryable (e.g., network timeout), user-fixable (e.g., invalid metric name), and fatal (e.g., auth failure) errors. LLMs cannot plan recovery.
No confirmation or dry-run support for destructive operations. delete-chart, delete-dashboard-tile, and delete-space are permanent and unrecoverable, but have no confirmation step or dry-run preview. Agents cannot safely plan irreversible actions.
Tool annotations (readOnlyHint, destructiveHint, idempotentHint) are not implemented. The MCP SDK supports these since spec 2025-09-01, but this server does not set them. Clients cannot automatically determine which tools are safe to retry or which modify state.
Descriptions include phrases like 'Cannot be undone' and 'This is a destructive operation' but do not indicate whether the operation is idempotent. Calling delete-chart twice with the same chart_identifier will fail the second time. LLMs should know this.
Parameters that accept both identifiers (UUID, name) are documented with overlapping semantics. E.g., 'chart_identifier' says '(supports exact match) or UUID' but does not explain which is preferred, how name matching is performed (case-sensitive? substring? exact?), or what happens on collision. Ambiguity invites incorrect LLM usage.
No documented output schemas. Tools return JSON responses, but the schema of returned fields is not defined. E.g., get-chart-details returns 'complete chart configuration' but the response structure (field names, types, nested objects) is not formally documented. LLMs cannot reliably extract or chain results.
Complex nested JSON parameters (metric_query, chart_config) are validated at runtime but failures return generic exceptions without field-level feedback. A malformed additionalMetrics.type (e.g., 'invalid_type' instead of 'count_distinct') will fail with a cryptic error instead of 'Invalid metric type for additionalMetrics[0]: got "invalid_type", must be one of: count_distinct, count, sum, avg, min, max'.