### Install and Build Tableau MCP Source: https://tableau.github.io/tableau-mcp/docs/getting-started These shell commands outline the process for installing dependencies, building the project, and keeping it updated. It includes cloning the repository, running npm install, and building the project. ```shell npm install npm run build ``` ```shell git pull npm install npm run build ``` -------------------------------- ### Build Tableau MCP Docker Image Source: https://tableau.github.io/tableau-mcp/docs/getting-started This command demonstrates how to build a Docker image for Tableau MCP from the source code. It tags the image as 'tableau-mcp' and shows an example of listing Docker images. ```shell $ docker build -t tableau-mcp . $ docker images ``` -------------------------------- ### Configure MCP Server for Tableau Source: https://tableau.github.io/tableau-mcp/docs/getting-started This JSON configuration sets up an MCP server connection specifically for Tableau. It specifies the command to run, arguments, and environment variables including the Tableau server URL, site name, and PAT credentials. ```json { "mcpServers": { "tableau": { "command": "npx", "args": ["-y", "@tableau/mcp-server@latest"], "env": { "SERVER": "https://my-tableau-server.com", "SITE_NAME": "my_site", "PAT_NAME": "my_pat", "PAT_VALUE": "pat_value" } } } } ``` -------------------------------- ### Example Workbook Information Response (JSON) Source: https://tableau.github.io/tableau-mcp/docs/tools/workbooks/get-workbook This is an example of the JSON response when retrieving information about a Tableau workbook. It includes workbook details, project information, and data about its views, such as creation time and view counts. This format is typical for API responses related to Tableau workbook data. ```json { "id": "222ea993-9391-4910-a167-56b3d19b4e3b", "name": "Superstore", "webpageUrl": "https://10ax.online.tableau.com/#/site/mcp-test/workbooks/1412200", "contentUrl": "Superstore", "project": { "name": "Samples", "id": "cbec32db-a4a2-4308-b5f0-4fc67322f359" }, "showTabs": true, "defaultViewId": "9460abfe-a6b2-49d1-b998-39e1ebcc55ce", "tags": {}, "views": { "view": [ { "id": "9460abfe-a6b2-49d1-b998-39e1ebcc55ce", "name": "Overview", "createdAt": "2025-09-02T23:25:58Z", "updatedAt": "2025-09-02T23:25:58Z", "tags": {}, "usage": { "totalViewCount": 165 } } ] } } ``` -------------------------------- ### List Datasources Example Result - JSON Source: https://tableau.github.io/tableau-mcp/docs/tools/data-qna/list-datasources An example of the JSON structure returned when listing published Tableau data sources. It includes details such as the data source ID, name, description, and associated project information. ```json [ { "id": "2d935df8-fe7e-4fd8-bb14-35eb4ba31d45", "name": "Superstore Datasource", "description": "*Overview*: Superstore Datasource contains data about your profit and sales\n\n*What is a Row of Data?* Each row of data corresponds to a unique order.", "project": { "name": "Samples", "id": "cbec32db-a4a2-4308-b5f0-4fc67322f359" } } ] ``` -------------------------------- ### Start MCP Inspector with stdio transport (Node.js) Source: https://tableau.github.io/tableau-mcp/docs/configuration/ai-tools-config/mcp-inspector Starts the MCP Inspector locally using Node.js with the stdio transport. Assumes project is built and environment variables are set. ```bash npm run inspect ``` -------------------------------- ### Start MCP Inspector with http transport (Express) Source: https://tableau.github.io/tableau-mcp/docs/configuration/ai-tools-config/mcp-inspector Starts the MCP Inspector locally using Express with the http transport. Assumes project is built and environment variables are set. ```bash npm run inspect:http ``` -------------------------------- ### Tableau REST API - Pagination Example Source: https://tableau.github.io/tableau-mcp/docs/tools/views/list-views Illustrates setting the pageSize for paginated retrieval of views from the Tableau REST API. The tool handles pagination automatically. ```string 1000 ``` -------------------------------- ### Example CSV Data Output Source: https://tableau.github.io/tableau-mcp/docs/tools/views/get-view-data Demonstrates the structure and content of data retrieved in CSV format from a Tableau view. This format is commonly used for data analysis and import into other tools. ```csv Country/Region,State/Province,Profit Ratio,Latitude (generated),Longitude (generated) Canada,Alberta,19.5%,53.41,-114.42 Canada,British Columbia,4.2%,54.9464,-125.1024 Canada,Manitoba,8.2%,55.0085,-97.1771 ``` -------------------------------- ### Build MCPB File using npm Source: https://tableau.github.io/tableau-mcp/docs/extras/claude-mcpb Steps to build the MCPB file for the project using npm commands. This process involves pulling the latest changes, installing dependencies, and running the build script. ```bash git pull npm install npm run build:mcpb ``` -------------------------------- ### Datasource Credentials JSON Structure Example Source: https://tableau.github.io/tableau-mcp/docs/configuration/mcp-config/optional Provides an example of the JSON structure for the DATASOURCE_CREDENTIALS environment variable, which includes usernames and passwords for data sources. The format represents a stringified version of a JavaScript object. ```json { "ds-luid1": [ { "luid": "ds1-connection-luid1", "u": "username1", "p": "password1" }, { "luid": "ds1-connection-luid2", "u": "username2", "p": "password2" } ], "ds-luid2": [ { "luid": "ds2-connection-luid1", "u": "username3", "p": "password3" } ] } ``` -------------------------------- ### Tableau API - Example View Result Source: https://tableau.github.io/tableau-mcp/docs/tools/views/list-views Provides a sample JSON output representing a single view retrieved from the Tableau API, including its ID, name, creation/update timestamps, and associated workbook, owner, and project details. ```json [ { "id": "9460abfe-a6b2-49d1-b998-39e1ebcc55ce", "name": "Overview", "createdAt": "2025-09-02T23:25:58Z", "updatedAt": "2025-09-02T23:25:58Z", "workbook": { "id": "222ea993-9391-4910-a167-56b3d19b4e3b" }, "owner": { "id": "d2a1e1df-af8e-4f43-a4cc-34858b7f8b69" }, "project": { "id": "cbec32db-a4a2-4308-b5f0-4fc67322f359" }, "tags": {}, "usage": { "totalViewCount": 0 } } ] ``` -------------------------------- ### Start MCP Inspector with stdio transport in Docker (Node.js) Source: https://tableau.github.io/tableau-mcp/docs/configuration/ai-tools-config/mcp-inspector Starts the MCP Inspector within a Docker container using Node.js with the stdio transport. Assumes project is built and environment variables are set. ```bash npm run inspect:docker ``` -------------------------------- ### Start MCP Inspector with http transport in Docker (Express) Source: https://tableau.github.io/tableau-mcp/docs/configuration/ai-tools-config/mcp-inspector Starts the MCP Inspector within a Docker container using Express with the http transport. Assumes project is built and environment variables are set. ```bash npm run inspect:docker:http ``` -------------------------------- ### List All Metric Definitions Example (JSON) Source: https://tableau.github.io/tableau-mcp/docs/tools/pulse/list-all-pulse-metric-definitions This JSON structure represents an example result for listing all published Pulse Metric Definitions. It includes metadata, specification details, extension options, and representation configurations for a metric. ```json [ { "metadata": { "name": "Tableau MCP", "description": "", "id": "9ad098f4-49cf-4e8a-bec0-0ca803091dd0", "schema_version": "1.0.0", "metric_version": 1, "definition_version": 0 }, "specification": { "datasource": { "id": "2d935df8-fe7e-4fd8-bb14-35eb4ba31d45" }, "basic_specification": { "measure": { "field": "Profit", "aggregation": "AGGREGATION_SUM" }, "time_dimension": { "field": "Order Date" }, "filters": [] }, "is_running_total": true }, "extension_options": { "allowed_dimensions": ["City"], "allowed_granularities": [ "GRANULARITY_BY_DAY", "GRANULARITY_BY_WEEK", "GRANULARITY_BY_MONTH", "GRANULARITY_BY_QUARTER", "GRANULARITY_BY_YEAR" ], "offset_from_today": 0 }, "metrics": [], "total_metrics": 1, "representation_options": { "type": "NUMBER_FORMAT_TYPE_NUMBER", "number_units": { "singular_noun": "", "plural_noun": "" }, "sentiment_type": "SENTIMENT_TYPE_NONE", "row_level_id_field": { "identifier_col": "City" }, "row_level_entity_names": { "entity_name_singular": "", "entity_name_plural": "" }, "row_level_name_field": { "name_col": "" }, "currency_code": "CURRENCY_CODE_UNSPECIFIED" }, "insights_options": { "settings": [ { "type": "INSIGHT_TYPE_RISKY_MONOPOLY", "disabled": false }, { "type": "INSIGHT_TYPE_TOP_DRIVERS", "disabled": false }, { "type": "INSIGHT_TYPE_CURRENT_TREND", "disabled": false }, { "type": "INSIGHT_TYPE_BOTTOM_CONTRIBUTORS", "disabled": false }, { "type": "INSIGHT_TYPE_TOP_DETRACTORS", "disabled": false }, { "type": "INSIGHT_TYPE_NEW_TREND", "disabled": false }, { "type": "INSIGHT_TYPE_UNUSUAL_CHANGE", "disabled": false }, { "type": "INSIGHT_TYPE_RECORD_LEVEL_OUTLIERS", "disabled": false }, { "type": "INSIGHT_TYPE_CORRELATED_METRIC", "disabled": false } ] }, "comparisons": { "comparisons": [ { "compare_config": { "comparison": "TIME_COMPARISON_PREVIOUS_PERIOD" }, "index": 0 }, { "compare_config": { "comparison": "TIME_COMPARISON_YEAR_AGO_PERIOD" }, "index": 1 } ] }, "datasource_goals": [] } ] ``` -------------------------------- ### Example Result of Tableau Datasource Query Source: https://tableau.github.io/tableau-mcp/docs/tools/data-qna/query-datasource Illustrates the expected JSON output format when a VizQL query is executed against a Tableau data source, showing aggregated data with specified aliases and sorting. ```json { "data": [ { "Customer Name": "Sean Miller", "Total Revenue": 25043.05 }, { "Customer Name": "Tamara Chand", "Total Revenue": 19052.217999999997 }, { "Customer Name": "Raymond Buch", "Total Revenue": 15117.338999999998 }, { "Customer Name": "Tom Ashbrook", "Total Revenue": 14595.62 }, { "Customer Name": "Adrian Barton", "Total Revenue": 14473.571 } ] } ``` -------------------------------- ### Example Result - Tableau Workbook List Source: https://tableau.github.io/tableau-mcp/docs/tools/workbooks/list-workbooks This JSON represents the structure of the response when listing workbooks from a Tableau site. It includes details such as workbook ID, name, URL, project information, and default view ID. ```json [ { "id": "222ea993-9391-4910-a167-56b3d19b4e3b", "name": "Superstore", "webpageUrl": "https://10ax.online.tableau.com/#/site/mcp-test/workbooks/1412200", "contentUrl": "Superstore", "project": { "name": "Samples", "id": "cbec32db-a4a2-4308-b5f0-4fc67322f359" }, "showTabs": true, "defaultViewId": "9460abfe-a6b2-49d1-b998-39e1ebcc55ce", "tags": {} } ] ``` -------------------------------- ### Example JWT Additional Payload - JSON Source: https://tableau.github.io/tableau-mcp/docs/configuration/mcp-config/authentication/direct-trust An example of a JSON string that can be used to include additional user attributes in the JWT's payload. This allows for custom data to be passed with the authentication token. ```json { "region": "West" } ``` -------------------------------- ### Tableau REST API - Limit Views Example Source: https://tableau.github.io/tableau-mcp/docs/tools/views/list-views Specifies the maximum number of views to return when querying the Tableau REST API. This sets an upper bound on the results. ```string 2000 ``` -------------------------------- ### Tableau REST API - Filter Views Example Source: https://tableau.github.io/tableau-mcp/docs/tools/views/list-views Demonstrates how to filter views using a 'name equals Overview' expression, as per the Tableau REST API Views filter fields. ```string name:eq:Overview ``` -------------------------------- ### Example Result of List Metrics API Source: https://tableau.github.io/tableau-mcp/docs/tools/pulse/list-pulse-metrics-from-metric-ids This JSON structure represents the successful output from the 'List Metrics' API call. It details the properties of a Pulse metric, including its ID, specification, definition ID, and versioning. ```json [ { "id": "fd6c4aa0-f6d3-469e-b75b-d597435ae199", "specification": { "filters": [], "measurement_period": { "granularity": "GRANULARITY_BY_MONTH", "range": "RANGE_CURRENT_PARTIAL" }, "comparison": { "comparison": "TIME_COMPARISON_PREVIOUS_PERIOD" } }, "definition_id": "9ad098f4-49cf-4e8a-bec0-0ca803091dd0", "is_default": true, "schema_version": "1.0.0", "metric_version": 2, "is_followed": true } ] ``` -------------------------------- ### Run Unit Tests with npm Source: https://tableau.github.io/tableau-mcp/docs/developers/unit-tests Commands to execute unit tests and generate code coverage reports using npm scripts. ```bash npm run test ``` ```bash npm run coverage ``` -------------------------------- ### Get View Image Source: https://tableau.github.io/tableau-mcp/docs/tools/views/get-view-image Retrieves an image of the specified view in a Tableau workbook. This is useful for capturing visual representations of your data. ```APIDOC ## GET /api/views/{viewId}/image ### Description Retrieves an image of the specified view in a Tableau workbook. ### Method GET ### Endpoint /api/views/{viewId}/image ### Parameters #### Path Parameters - **viewId** (string) - Required - The ID of the view, potentially retrieved by the List Views or Get Workbook tool. #### Query Parameters - **width** (integer) - Optional - The width of the rendered image in pixels that, along with the value of `height` determine its resolution and aspect ratio. - **height** (integer) - Optional - The height of the rendered image in pixels that, along with the value of `width`, determine its resolution and aspect ratio. ### Request Example ``` GET /api/views/9460abfe-a6b2-49d1-b998-39e1ebcc55ce/image?width=1600&height=1200 ``` ### Response #### Success Response (200) - **image** (binary) - The image data of the view. #### Response Example (Binary image data would be returned here, not representable as JSON) ``` -------------------------------- ### Run E2E Tests with npm Source: https://tableau.github.io/tableau-mcp/docs/developers/e2e-tests Command to execute all E2E tests using npm. Assumes Vitest is configured as the testing framework. ```bash npm run test:e2e ``` -------------------------------- ### Get Workbook Source: https://tableau.github.io/tableau-mcp/docs/tools/workbooks/get-workbook Retrieves information on a workbook, including information about the views contained in the workbook and their usage statistics. This endpoint calls Query Workbook and Query Views for Workbook APIs. ```APIDOC ## GET /api/3.0/tableau/workbooks/{workbookId} ### Description Retrieves information on a workbook, including information about the views contained in the workbook and their usage statistics. ### Method GET ### Endpoint `/api/3.0/tableau/workbooks/{workbookId}` ### Parameters #### Path Parameters - **workbookId** (string) - Required - The ID of the workbook, potentially retrieved by the List Workbooks tool. ### Request Example ```json { "workbookId": "222ea993-9391-4910-a167-56b3d19b4e3b" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the workbook. - **name** (string) - The name of the workbook. - **webpageUrl** (string) - The URL to access the workbook on the Tableau webpage. - **contentUrl** (string) - The content URL for the workbook. - **project** (object) - Information about the project the workbook belongs to. - **name** (string) - The name of the project. - **id** (string) - The ID of the project. - **showTabs** (boolean) - Indicates if tabs are shown for the workbook. - **defaultViewId** (string) - The ID of the default view for the workbook. - **tags** (object) - Tags associated with the workbook. - **views** (object) - Information about the views within the workbook. - **view** (array) - An array of view objects. - **id** (string) - The unique identifier for the view. - **name** (string) - The name of the view. - **createdAt** (string) - The timestamp when the view was created. - **updatedAt** (string) - The timestamp when the view was last updated. - **tags** (object) - Tags associated with the view. - **usage** (object) - Usage statistics for the view. - **totalViewCount** (integer) - The total number of times the view has been accessed. #### Response Example ```json { "id": "222ea993-9391-4910-a167-56b3d19b4e3b", "name": "Superstore", "webpageUrl": "https://10ax.online.tableau.com/#/site/mcp-test/workbooks/1412200", "contentUrl": "Superstore", "project": { "name": "Samples", "id": "cbec32db-a4a2-4308-b5f0-4fc67322f359" }, "showTabs": true, "defaultViewId": "9460abfe-a6b2-49d1-b998-39e1ebcc55ce", "tags": {}, "views": { "view": [ { "id": "9460abfe-a6b2-49d1-b998-39e1ebcc55ce", "name": "Overview", "createdAt": "2025-09-02T23:25:58Z", "updatedAt": "2025-09-02T23:25:58Z", "tags": {}, "usage": { "totalViewCount": 165 } } ] } } ``` ``` -------------------------------- ### Docker Execution Configuration for Tableau MCP (JSON) Source: https://tableau.github.io/tableau-mcp/docs/configuration/ai-tools-config Defines the `mcpServers` configuration for running Tableau MCP via Docker. It includes the Docker command, arguments, and specifies the use of an environment file for configuration. ```json { "mcpServers": { "tableau": { "command": "docker", "args": [ "run", "-i", "--rm", "--env-file", "/full-path-to-tableau-mcp/env.list", "tableau-mcp" ] } } } ``` -------------------------------- ### Configure E2E Tests Environment Variables Source: https://tableau.github.io/tableau-mcp/docs/developers/e2e-tests Sets up the necessary environment variables for running E2E tests locally. Requires a .env file in the e2e directory with server, site name, authentication details, and connected app credentials. ```env SERVER=https://10ax.online.tableau.com SITE_NAME=mcp-test AUTH=direct-trust JWT_SUB_CLAIM= CONNECTED_APP_CLIENT_ID= CONNECTED_APP_SECRET_ID= CONNECTED_APP_SECRET_VALUE= ``` -------------------------------- ### Local Execution Configuration for Tableau MCP (JSON) Source: https://tableau.github.io/tableau-mcp/docs/configuration/ai-tools-config Defines the `mcpServers` configuration for running Tableau MCP locally using Node.js with stdio transport. It specifies the command, arguments, and environment variables required for the connection. ```json { "mcpServers": { "tableau": { "command": "node", "args": ["/full-path-to-tableau-mcp/build/index.js"], "env": { "TRANSPORT": "stdio", "SERVER": "https://my-tableau-server.com", "SITE_NAME": "", "PAT_NAME": "", "PAT_VALUE": "", "... etc" } } } } ``` -------------------------------- ### Vega-Lite Configuration for Chart Axes Source: https://tableau.github.io/tableau-mcp/docs/tools/pulse/generate-pulse-metric-value-insight-bundle This snippet details the configuration for a chart's axes using Vega-Lite. It includes settings for axis labels, grid colors, font weights, and formatting, with conditional logic applied based on data values. It relies on Vega-Lite schema and custom formatting maps. ```json { "axis": { "domain": false, "title": null, "labelFontSize": { "expr": "axisLabelFontSize" }, "ticks": false, "labelLineHeight": { "expr": "axisLabelFontSize" }, "labelFont": { "expr": "axisLabelFontFace" }, "labelAngle": { "expr": "axisLabelAngle" }, "labelPadding": { "expr": "axisLabelPadding" }, "labelOffset": { "expr": "axisLabelOffset" } } } ``` ```json { "field": "truncDate", "type": "ordinal" }, "scale": { "type": "point", "padding": { "expr": "xAxisScalePadding" } }, "labelFontWeight": { "condition": [ { "test": "activeLabelAndGridDate === datum.value", "expr": "xAxisLabelFontWeightActive" } ], "expr": "xAxisLabelFontWeightDefault" }, "format": { "custom": true, "mapName": "xAxis" } ``` -------------------------------- ### Retrieve View Image using Tableau MCP API Source: https://tableau.github.io/tableau-mcp/docs/tools/views/get-view-image This snippet demonstrates how to call the Tableau MCP API to retrieve an image of a specific view. It requires the `viewId` and can optionally include `width` and `height` to control the image resolution. ```json { "viewId": "9460abfe-a6b2-49d1-b998-39e1ebcc55ce", "width": 1600, "height": 1200 } ``` -------------------------------- ### Hover Tooltip Configuration with Interaction Source: https://tableau.github.io/tableau-mcp/docs/tools/pulse/generate-pulse-metric-value-insight-bundle Sets up interactive tooltips that appear on hover over data points. It defines the data fields to display in the tooltip and uses a parameter to manage the hover state, controlling the opacity of associated visual elements. ```JSON { "encoding": { "opacity": { "condition": { "empty": false, "value": { "expr": "hoverVerticalLineOpacity" }, "param": "hover" }, "value": 0 }, "tooltip": [ { "title": "Date", "field": "formattedTruncDate", "type": "ordinal" }, { "field": "formattedRawValue", "type": "ordinal", "title": "Value" }, { "field": "tooltipText", "type": "nominal", "title": "TooltipText" }, { "field": "tooltipMarkup", "type": "nominal", "title": "TooltipMarkup" } ] }, "params": [ { "name": "hover", "select": { "on": "mouseover", "clear": "mouseout", "type": "point", "fields": ["truncDate"], "nearest": true } } ], "name": "hover-tooltips" } ``` -------------------------------- ### Example Datasource Metadata Result Source: https://tableau.github.io/tableau-mcp/docs/tools/data-qna/get-datasource-metadata This JSON structure represents the metadata for fields within a Tableau datasource. It includes details such as field name, data type, default aggregation, data category, and role. This output is the result of calling the Tableau Metadata API. ```json { "fields": [ { "name": "Returned", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Category", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Discount", "dataType": "REAL", "defaultAggregation": "SUM", "dataCategory": "QUANTITATIVE", "role": "MEASURE" }, { "name": "Postal Code", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "ORDINAL", "role": "DIMENSION", "defaultFormat": "*00000" }, { "name": "Regional Manager", "dataType": "STRING", "defaultAggregation": "COUNT" }, { "name": "Order ID", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Product Name", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Ship Date", "dataType": "DATE", "defaultAggregation": "YEAR", "dataCategory": "ORDINAL", "role": "DIMENSION" }, { "name": "Quantity", "dataType": "INTEGER", "defaultAggregation": "SUM", "dataCategory": "QUANTITATIVE", "role": "MEASURE" }, { "name": "City", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Sub-Category", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Profit (bin)", "dataType": "INTEGER", "defaultAggregation": "NONE", "dataCategory": "ORDINAL", "role": "DIMENSION", "formula": "[Profit]" }, { "name": "Segment", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "State/Province", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Sales", "dataType": "REAL", "defaultAggregation": "SUM", "dataCategory": "QUANTITATIVE", "role": "MEASURE" }, { "name": "Manufacturer", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Region", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Ship Mode", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Order Date", "dataType": "DATE", "defaultAggregation": "YEAR", "dataCategory": "ORDINAL", "role": "DIMENSION" }, { "name": "Profit", "dataType": "REAL", "defaultAggregation": "SUM", "dataCategory": "QUANTITATIVE", "role": "MEASURE" }, { "name": "Country/Region", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" }, { "name": "Profit Ratio", "dataType": "REAL", "defaultAggregation": "AGG", "dataCategory": "QUANTITATIVE", "role": "MEASURE", "formula": "SUM([Profit])/SUM([Sales])", "isAutoGenerated": false, "hasUserReference": false }, { "name": "Customer Name", "dataType": "STRING", "defaultAggregation": "COUNT", "dataCategory": "NOMINAL", "role": "DIMENSION" } ] } ``` -------------------------------- ### Vega-Lite Chart Specification with Custom Formatting Source: https://tableau.github.io/tableau-mcp/docs/tools/pulse/generate-pulse-metric-value-insight-bundle This snippet shows a partial Vega-Lite specification for a chart, including data sources, custom formatters, and overall chart configuration. It defines data values, axis properties, and schema, indicating a chart with custom formatting capabilities. ```json { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "height": "container", "config": { "customFormatTypes": true, "axis": { "domain": false, "title": null, "labelFontSize": { "expr": "axisLabelFontSize" }, "ticks": false, "labelLineHeight": { "expr": "axisLabelFontSize" }, "labelFont": { "expr": "axisLabelFontFace" }, "labelAngle": { "expr": "axisLabelAngle" }, "labelPadding": { "expr": "axisLabelPadding" }, "labelOffset": { "expr": "axisLabelOffset" } } }, "view": { "stroke": null }, "data": { "values": [ { "tooltipMarkup": "Q2 2025Actual135.0K (134,990.60)", "ci0": "109561.9349", "truncDate": "2025-04-01T00:00:00Z", "tooltipText": "", "showIsolatedPoint": 0, "formattedRawValue": "135.0K", "point": 1, "formattedTruncDate": "Q2 2025", "changeSentiment": "neutral", "segment": "1", "ci1": "175722.7311", "dashed": false, "rawValue": "134990.5960" }, { "tooltipMarkup": "Q1 2025Actual125.3K (125,288.83)", "changeSentiment": "neutral", "tooltipText": "", "segment": "1", "ci0": "85415.8193", "formattedRawValue": "125.3K", "formattedTruncDate": "Q1 2025", "ci1": "149951.9070", "point": 0, "dashed": false, "rawValue": "125288.8282", "truncDate": "2025-01-01T00:00:00Z", "showIsolatedPoint": 0 }, { "formattedRawValue": "236.7K", "formattedTruncDate": "Q4 2024", } ] }, "resolve": { "axis": { "y": "independent" } }, "customFormatterMaps": { "yAxis": { "130449.3752": "130.4K" }, "xAxis": { "2023-07-01T00:00:00Z": "Q3 23", "2025-04-01T00:00:00Z": "Q2 25" } } } ``` -------------------------------- ### Tableau MCP: Normal Range Error Band Configuration Source: https://tableau.github.io/tableau-mcp/docs/tools/pulse/generate-pulse-metric-value-insight-bundle Configures a 'normal-range' error band for data visualization. It specifies the visual appearance (color, opacity) and encoding for the Y-axis, defining the upper ('ci1') and lower ('ci0') bounds of the band. The Y-axis is quantitative and does not start at zero. ```json { "name": "normal-range", "description": "The normal range band around the line", "mark": { "color": { "expr": "normalRangeColor" }, "opacity": { "expr": "normalRangeOpacity" }, "type": "errorband" }, "encoding": { "y": { "field": "ci1", "type": "quantitative", "scale": { "zero": false }, "title": "Normal range", "axis": null }, "y2": { "field": "ci0" } } } ``` -------------------------------- ### Tableau REST API Endpoints Source: https://tableau.github.io/tableau-mcp/docs/intro Endpoints for managing Tableau data sources, workbooks, and views. ```APIDOC ## GET /api/tableau/rest/list-datasources ### Description Retrieves a list of published data sources from a specified Tableau site. ### Method GET ### Endpoint /api/tableau/rest/list-datasources ### Query Parameters - **site_id** (string) - Required - The ID of the Tableau site. ### Response #### Success Response (200) - **data_sources** (array) - A list of published data sources. - **id** (string) - The ID of the data source. - **name** (string) - The name of the data source. #### Response Example ```json { "data_sources": [ { "id": "datasource-1", "name": "Sales Data" } ] } ``` ``` ```APIDOC ## GET /api/tableau/rest/list-workbooks ### Description Retrieves a list of workbooks from a specified Tableau site. ### Method GET ### Endpoint /api/tableau/rest/list-workbooks ### Query Parameters - **site_id** (string) - Required - The ID of the Tableau site. ### Response #### Success Response (200) - **workbooks** (array) - A list of workbooks. - **id** (string) - The ID of the workbook. - **name** (string) - The name of the workbook. #### Response Example ```json { "workbooks": [ { "id": "workbook-1", "name": "Sales Performance" } ] } ``` ``` ```APIDOC ## GET /api/tableau/rest/list-views ### Description Retrieves a list of views from a specified Tableau site. ### Method GET ### Endpoint /api/tableau/rest/list-views ### Query Parameters - **site_id** (string) - Required - The ID of the Tableau site. ### Response #### Success Response (200) - **views** (array) - A list of views. - **id** (string) - The ID of the view. - **name** (string) - The name of the view. - **workbook_id** (string) - The ID of the workbook the view belongs to. #### Response Example ```json { "views": [ { "id": "view-1", "name": "Sales Overview", "workbook_id": "workbook-1" } ] } ``` ``` ```APIDOC ## GET /api/tableau/rest/get-workbook ### Description Retrieves information on a workbook from a specified Tableau site. ### Method GET ### Endpoint /api/tableau/rest/get-workbook ### Query Parameters - **site_id** (string) - Required - The ID of the Tableau site. - **workbook_id** (string) - Required - The ID of the workbook. ### Response #### Success Response (200) - **workbook_info** (object) - Information about the workbook. - **id** (string) - The ID of the workbook. - **name** (string) - The name of the workbook. - **description** (string) - The description of the workbook. #### Response Example ```json { "workbook_info": { "id": "workbook-1", "name": "Sales Performance", "description": "Performance metrics for sales." } } ``` ``` ```APIDOC ## GET /api/tableau/rest/get-view-data ### Description Retrieves data in CSV format for the specified view in a Tableau workbook. ### Method GET ### Endpoint /api/tableau/rest/get-view-data ### Query Parameters - **site_id** (string) - Required - The ID of the Tableau site. - **view_id** (string) - Required - The ID of the view. ### Response #### Success Response (200) - **csv_data** (string) - The data from the view in CSV format. #### Response Example ```csv column1,column2 value1,value2 ``` ``` ```APIDOC ## GET /api/tableau/rest/get-view-image ### Description Retrieves an image for the specified view in a Tableau workbook. ### Method GET ### Endpoint /api/tableau/rest/get-view-image ### Query Parameters - **site_id** (string) - Required - The ID of the Tableau site. - **view_id** (string) - Required - The ID of the view. ### Response #### Success Response (200) - **image_data** (binary) - The image data for the view. #### Response Example [Binary image data] ``` -------------------------------- ### Vega-Lite Data Structure and Tooltip Information Source: https://tableau.github.io/tableau-mcp/docs/tools/pulse/generate-pulse-metric-value-insight-bundle This code snippet illustrates the structure of the data array used in a Vega-Lite chart. It includes fields for date, formatted values, tooltips, and sentiment analysis. The 'tooltipMarkup' field provides a structured HTML string for custom tooltip display. ```json { "tooltipMarkup": "Q2 2025Actual135.0K (134,990.60)", "ci0": "109561.9349", "truncDate": "2025-04-01T00:00:00Z", "tooltipText": "", "showIsolatedPoint": 0, "formattedRawValue": "135.0K", "point": 1, "formattedTruncDate": "Q2 2025", "changeSentiment": "neutral", "segment": "1", "ci1": "175722.7311", "dashed": false, "rawValue": "134990.5960" } ``` ```json { "tooltipMarkup": "Q1 2025Actual125.3K (125,288.83)", "changeSentiment": "neutral", "tooltipText": "", "segment": "1", "ci0": "85415.8193", "formattedRawValue": "125.3K", "formattedTruncDate": "Q1 2025", "ci1": "149951.9070", "point": 0, "dashed": false, "rawValue": "125288.8282", "truncDate": "2025-01-01T00:00:00Z", "showIsolatedPoint": 0 } ``` ```json { "formattedRawValue": "236.7K", "formattedTruncDate": "Q4 2024", } ```