Skip to main content
Glama

twilize

Toolkit zur Generierung von Tableau-Arbeitsmappen (.twb/.twbx) für reproduzierbare Dashboards und Arbeitsmappen-Engineering Erstellen Sie programmgesteuert Tableau-Arbeitsmappen mit stabilen analytischen Primitiven, Dashboard-Komposition und integrierter struktureller Validierung.

Übersicht

twilize ist ein Model Context Protocol (MCP) Server und ein Python-Toolkit zum Generieren von Tableau Desktop Arbeitsmappendateien (.twb / .twbx) aus Code oder KI-gesteuerten Tool-Aufrufen.

Es ist als Arbeitsmappen-Engineering-Ebene konzipiert, nicht als konversationsbasierter Datenexplorations-Agent. Das Ziel ist es, die Generierung von Arbeitsmappen reproduzierbar, überprüfbar und sicher für die Automatisierung in lokalen Workflows, Skripten und CI-Umgebungen zu machen.

Der Standard-Workflow ist:

  1. Starten Sie mit einer bekannten Vorlage (.twb oder .twbx) oder der integrierten Zero-Config-Vorlage

  2. Fügen Sie berechnete Felder und Parameter hinzu

  3. Erstellen Sie Arbeitsblätter aus stabilen Diagramm-Primitiven

  4. Stellen Sie Dashboards und Interaktionen zusammen

  5. Speichern und validieren Sie eine .twb oder .twbx, die sich in Tableau Desktop öffnen lässt

                            Interfaces
  ┌───────────────────────────────────────────────────────────────┐
  │  ┌──────────────────────────┐  ┌───────────────────────────┐  │
  │  │        MCP Server        │  │      Python Library       │  │
  │  │  tools_workbook          │  │  from twilize.twb_editor    │  │
  │  │  tools_layout            │  │  import TWBEditor         │  │
  │  │  tools_migration         │  │                           │  │
  │  │  tools_support           │  │  editor.add_...()         │  │
  │  │                          │  │  editor.configure_...()   │  │
  │  │  (Claude / Cursor /      │  │  editor.save(...)         │  │
  │  │   VSCode / Claude Code)  │  │                           │  │
  │  └─────────────┬────────────┘  └──────────────┬────────────┘  │
  │                └──────────────┬────────────────┘               │
  └─────────────────────────────  ┼  ─────────────────────────────┘
                                  ▼
  ┌───────────────────────────────────────────────────────────────┐
  │                          TWBEditor                            │
  │       ParametersMixin  ·  ConnectionsMixin                    │
  │       ChartsMixin      ·  DashboardsMixin                     │
  └──────────┬──────────────────┬──────────────────┬─────────────┘
             ▼                  ▼                  ▼
  ┌──────────────────┐  ┌──────────────┐  ┌──────────────────────┐
  │  Chart Builders  │  │  Dashboard   │  │  Analysis &          │
  │                  │  │  System      │  │  Migration           │
  │  Basic  DualAxis │  │              │  │                      │
  │  Pie    Text     │  │  layouts     │  │  migration.py        │
  │  Map    Recipes  │  │  actions     │  │  twb_analyzer.py     │
  │                  │  │  dependencies│  │  capability_registry │
  └────────┬─────────┘  └──────┬───────┘  └──────────┬───────────┘
           └───────────────────┼──────────────────────┘
                               ▼
  ┌───────────────────────────────────────────────────────────────┐
  │                     XML Engine  (lxml)                        │
  │    template.twb/.twbx  →  patch  →  validate  →  save        │
  └───────────────────────────────┬───────────────────────────────┘
                                  ▼
                      output.twb  /  output.twbx

Installation

pip install twilize

Um das mitgelieferte Hyper-basierte Beispiel auszuführen, das .hyper-Dateien untersucht und die physische Orders_*-Tabelle automatisch auflöst, installieren Sie zusätzlich die optionale Beispiel-Abhängigkeit:

pip install "twilize[examples]"

Anforderungen

Schnellstart

Als MCP-Server

Um einem MCP-Client das automatische Erstellen von Tableau-Arbeitsmappen zu ermöglichen, fügen Sie twilize zur MCP-Konfiguration des Clients hinzu.

Der Startbefehl ist bei allen Clients gleich:

uvx twilize

Jeder Client speichert diesen Befehl in einem anderen Konfigurationsformat. Verwenden Sie das passende Beispiel unten.

Claude Desktop

Öffnen Sie ~/Library/Application Support/Claude/claude_desktop_config.json unter macOS oder %APPDATA%\Claude\claude_desktop_config.json unter Windows und fügen Sie Folgendes hinzu:

{
  "mcpServers": {
    "twilize": {
      "command": "uvx",
      "args": ["twilize"]
    }
  }
}

Cursor IDE

  1. Öffnen Sie Cursor Settings -> Features -> MCP

  2. Klicken Sie auf Add New MCP Server

  3. Setzen Sie Type auf command

  4. Setzen Sie Name auf twilize

  5. Setzen Sie Command auf uvx twilize

Claude Code

claude mcp add twilize -- uvx twilize

VSCode

Öffnen Sie die Arbeitsbereichsdatei .vscode/mcp.json oder Ihre Benutzerprofil-Datei mcp.json und fügen Sie Folgendes hinzu:

{
  "servers": {
    "twilize": {
      "command": "uvx",
      "args": ["twilize"]
    }
  }
}

In VSCode können Sie diese Dateien über die Befehlspalette mit MCP: Open Workspace Folder Configuration oder MCP: Open User Configuration öffnen. Sie können auch MCP: Add Server verwenden und denselben uvx twilize-Befehl über den geführten Ablauf eingeben.

Als Python-Bibliothek

Verwenden Sie TWBEditor(...), um mit einer Vorlage zu beginnen und den Inhalt der Arbeitsmappe neu aufzubauen. Verwenden Sie TWBEditor.open_existing(...), wenn Sie bestehende Arbeitsblätter und Dashboards beibehalten und ein Blatt direkt bearbeiten möchten.

from twilize.twb_editor import TWBEditor

editor = TWBEditor("")  # "" uses the built-in Superstore template
editor.clear_worksheets()
editor.add_calculated_field("Profit Ratio", "SUM([Profit])/SUM([Sales])")

editor.add_worksheet("Sales by Category")
editor.configure_chart(
    worksheet_name="Sales by Category",
    mark_type="Bar",
    rows=["Category"],
    columns=["SUM(Sales)"],
)

editor.add_worksheet("Segment Pie")
editor.configure_chart(
    worksheet_name="Segment Pie",
    mark_type="Pie",
    color="Segment",
    wedge_size="SUM(Sales)",
)

editor.add_dashboard(
    dashboard_name="Overview",
    worksheet_names=["Sales by Category", "Segment Pie"],
    layout="horizontal",
)

editor.save("output/my_workbook.twb")

Arbeiten mit gepackten Arbeitsmappen (.twbx)

.twbx-Dateien sind ZIP-Archive, die die Arbeitsmappen-XML zusammen mit Datenextrakten (.hyper) und Bild-Assets bündeln. twilize liest und schreibt diese transparent:

from twilize.twb_editor import TWBEditor

# Open a packaged workbook — extracts and images are preserved automatically
editor = TWBEditor.open_existing("templates/dashboard/MyDashboard.twbx")

# Make changes as usual
editor.add_calculated_field("Profit Ratio", "SUM([Profit])/SUM([Sales])")

# Save as .twbx — re-bundles the updated .twb with the original extracts/images
editor.save("output/MyDashboard_v2.twbx")

# Or extract just the XML when the packaged format isn't needed
editor.save("output/MyDashboard_v2.twb")

Eine einfache .twb kann ebenfalls gepackt werden:

editor = TWBEditor("templates/twb/superstore.twb")
# ...
editor.save("output/superstore.twbx")  # produces a single-entry ZIP with the .twb inside

MCP-Tools

Tool

Beschreibung

create_workbook

Lädt eine .twb oder .twbx Vorlage und initialisiert einen Arbeitsbereich zum Neuerstellen aus der Vorlage

open_workbook

Öffnet eine bestehende .twb oder .twbx und behält deren Arbeitsblätter und Dashboards zur Bearbeitung bei

list_fields

Listet alle verfügbaren Dimensionen und Kennzahlen auf

list_worksheets

Listet die Namen der Arbeitsblätter in der aktiven Arbeitsmappe auf

list_dashboards

Listet Dashboards und die darin referenzierten Arbeitsblatt-Zonen auf

add_parameter

Fügt einen interaktiven Parameter für Was-wäre-wenn-Analysen hinzu

add_calculated_field

Fügt ein berechnetes Feld mit einer Tableau-Formel hinzu

remove_calculated_field

Entfernt ein zuvor hinzugefügtes berechnetes Feld

add_worksheet

Fügt ein neues leeres Arbeitsblatt hinzu

configure_chart

Konfiguriert Diagrammtyp und Feldzuordnungen

configure_worksheet_style

Wendet Styling auf Arbeitsblattebene an: Hintergrundfarbe, Sichtbarkeit von Achsen/Gitter/Rahmen

configure_dual_axis

Konfiguriert eine Dual-Achsen-Diagrammkomposition

configure_chart_recipe

Konfiguriert ein Showcase-Diagrammrezept wie lollipop, donut, butterfly oder calendar

add_dashboard

Erstellt ein Dashboard, das Arbeitsblätter kombiniert

add_dashboard_action

Fügt Filter- oder Hervorhebungsaktionen zu einem Dashboard hinzu

generate_layout_json

Erstellt ein interaktives, strukturiertes Dashboard-Flexbox-Layout

list_capabilities

Zeigt die deklarierte Unterstützungsgrenze von twilize an

describe_capability

Erklärt, ob ein Diagramm oder eine Funktion Kern-, fortgeschritten, Rezept- oder nicht unterstützt ist

analyze_twb

Analysiert eine .twb-Datei anhand des Fähigkeitskatalogs; die Ausgabe enthält sowohl die vollständige Aufschlüsselung der Fähigkeiten als auch die Zusammenfassung der Lückenanalyse

diff_template_gap

Fasst die Nicht-Kern-Lücke einer Vorlage zusammen

validate_workbook

Validiert eine Arbeitsmappe anhand des offiziellen Tableau TWB XSD-Schemas (2026.1)

migrate_twb_guided

Führt den integrierten TWB-Migrations-Workflow aus und pausiert bei Bedarf für eine Warnungsbestätigung

set_mysql_connection

Konfiguriert die Datenquelle für die Verwendung einer lokalen MySQL-Verbindung

set_tableauserver_connection

Konfiguriert die Verbindung zu einem Online-Tableau-Server

set_hyper_connection

Konfiguriert die Datenquelle für die Verwendung einer lokalen Hyper-Extrakt-Verbindung

save_workbook

Speichert die Arbeitsmappe als .twb (einfaches XML) oder .twbx (ZIP mit gebündelten Extrakten und Bildern)

Fähigkeitsmodell

Kern-Primitive

Dies sind die stabilen Bausteine, die das Projekt weiterhin garantieren sollte:

  • Balken

  • Linie

  • Fläche

  • Kreis

  • Karte

  • Text / KPI-Karten

  • Parameter und berechnete Felder

  • Grundlegende Dashboard-Komposition

Fortgeschrittene Muster

Diese werden unterstützt, sind jedoch eher höherwertige Kompositionen oder Interaktionsfunktionen als die Standardoberfläche:

  • Streudiagramm

  • Heatmap

  • Treemap

  • Blasendiagramm

  • Dual-Achse — mark_color_1/2, color_map_1, reverse_axis_1, hide_zeroline, synchronized

  • Tabellenberechnungen — RANK_DENSE, RUNNING_SUM, WINDOW_SUM via add_calculated_field(table_calc="Rows")

  • KPI-Differenz-Badges — MIN(1) Dummy-Achse + axis_fixed_range + color_map + customized_label

  • Donut (via extra_axes) — Multi-Pane-Kreisdiagramm + weißer Kreis unter Verwendung von configure_dual_axis(extra_axes=[...]); unterstützt color_map für :Measure Names Palette

  • Rich-Text-Beschriftungen — configure_chart(label_runs=[...]) für Multi-Style-KPI-Karten und dynamische Titel mit Inline-Feldwerten

  • Fortgeschrittenes Arbeitsblatt-Styling — configure_worksheet_style unterstützt Zell-/Datenbeschriftungs-/Markierungsstile auf Pane-Ebene, Formate für Beschriftungen/Zellen/Kopfzeilen pro Feld, Achsen-Tick-Steuerung, Deaktivierung von Tooltips und Unterdrückung von visuellem Rauschen in Tableau

  • Unterdrückung von Zeilendimension-Kopfzeilen — configure_worksheet_style(hide_row_label="FieldName")

  • Filterzonen, Parametersteuerungen, Farblegenden

  • Dashboard-Filter- und Hervorhebungsaktionen

  • Deklarative JSON-Layout-Workflows

  • Steuerung von Dashboard-Zonentiteln via show_title: false in Layout-Dicts

Rezepte und Showcase-Muster

Diese können heute generiert werden, sollten jedoch eher als Rezepte oder Beispiele betrachtet werden, nicht als erstklassige Versprechen:

  • Donut

  • Lollipop

  • Bullet

  • Bump

  • Butterfly

  • Kalender

Rezept-Diagramme werden absichtlich über ein einziges configure_chart_recipe-Tool bereitgestellt, damit die öffentliche MCP-Oberfläche nicht für jedes Showcase-Muster um ein neues Tool wächst.

Diese Unterscheidung ist wichtig, da twilize nicht versucht, ein Diagramm-Zoo zu werden oder mit Tableaus eigenen konversationsbasierten Analysetools zu konkurrieren. Das Projekt ist am stärksten, wenn es eine zuverlässige, automatisierbare Ebene zur Generierung von Arbeitsmappen bereitstellt.

Fähigkeitsorientierter Workflow

Wenn Sie sich nicht sicher sind, ob etwas zur stabilen SDK-Oberfläche gehört:

  1. Verwenden Sie list_capabilities, um die deklarierte Grenze zu überprüfen

  2. Verwenden Sie describe_capability, um ein bestimmtes Diagramm, eine Kodierung oder eine Funktion zu prüfen

  3. Verwenden Sie analyze_twb oder diff_template_gap, bevor Sie eine Showcase-Vorlage verfolgen

Dies hält die Arbeit an neuen Funktionen an der tatsächlichen Produktgrenze des Projekts ausgerichtet, anstatt an dem, was zufällig in einer Beispiel-Arbeitsmappe erscheint.

Integrierte Validierung

Strukturelle Validierung

save() validiert automatisch die TWB-XML-Struktur vor dem Schreiben:

  • Fatale Fehler wie fehlende <workbook> oder <datasources> lösen TWBValidationError aus

  • Warnungen wie fehlende <view> oder <panes> werden protokolliert, blockieren aber nicht das Speichern

  • Die Validierung kann mit editor.save("output.twb", validate=False) oder editor.save("output.twbx", validate=False) deaktiviert werden

XSD-Schema-Validierung

TWBEditor.validate_schema() prüft die Arbeitsmappe anhand des offiziellen Tableau TWB XSD-Schemas (2026.1), das unter vendor/tableau-document-schemas/ bereitgestellt wird:

result = editor.validate_schema()
print(result.to_text())
# PASS  Workbook is valid against Tableau TWB XSD schema (2026.1)
# — or —
# FAIL  Schema validation failed (2 error(s)):
#   * Element 'workbook': Missing child element(s)...

result.valid          # bool
result.errors         # list[str] — lxml error messages
result.schema_available  # False if the vendor submodule is not checked out

Die gleiche Prüfung ist als MCP-Tool verfügbar:

validate_workbook()                       # validate current open workbook in memory
validate_workbook(file_path="out.twb")    # validate a file on disk (.twb or .twbx)

XSD-Fehler sind informativ — Tableau selbst generiert Arbeitsmappen, die gelegentlich vom Schema abweichen — aber wiederkehrende Fehler signalisieren strukturelle Probleme, die behoben werden sollten.

Dashboard-Layouts

Layout

Beschreibung

vertical

Stapelt Arbeitsblätter von oben nach unten

horizontal

Platziert Arbeitsblätter nebeneinander

grid-2x2

2x2-Rasterlayout für bis zu vier Arbeitsblätter

dict oder .json Pfad

Deklarative benutzerdefinierte Layouts für komplexere Dashboards

Benutzerdefinierte Layouts können programmgesteuert mithilfe eines verschachtelten layout-Wörterbuchs oder über generate_layout_json für MCP-Workflows erstellt werden.

Hyper-basiertes Beispiel

Das Beispiel examples/hyper_and_new_charts.py verwendet den Sample - EU Superstore.hyper-Extrakt, der direkt im Paket (src/twilize/references/) gebündelt ist, und löst die physische Orders_*-Tabelle über die Tableau Hyper API auf, bevor die Arbeitsmappenverbindung gewechselt wird. Es ist kein Repository-Klon erforderlich — installieren Sie es mit pip install "twilize[examples]" und führen Sie es direkt aus.

Arbeitsmappen-Migration

twilize enthält ein Migrations-Subsystem zum Wechseln einer bestehenden .twb auf eine neue Datenquelle — zum Beispiel, um eine Arbeitsmappe, die auf einer Excel-Datei basiert, auf eine andere Excel-Datei mit einem anderen Schema umzustellen oder zwischen Sprachvarianten desselben Datensatzes zu migrieren.

Funktionsweise

Die Migration ist ein mehrstufiger Workflow. Jeder Schritt ist sowohl als MCP-Tool als auch als Python-Funktion verfügbar:

1. inspect_target_schema   →  Scan the target Excel and list its columns
2. profile_twb_for_migration  →  Inventory which fields the workbook uses
3. propose_field_mapping   →  Match source fields to target columns (fuzzy)
4. preview_twb_migration   →  Dry-run: show what would change, blockers/warnings
5. apply_twb_migration     →  Write the migrated .twb + JSON reports

migrate_twb_guided ist ein Komfort-Wrapper, der die Schritte 2–5 nacheinander ausführt und automatisch pausiert, wenn nur noch Feldübereinstimmungen mit geringer Konfidenz vorhanden sind, und ein warning_review_bundle zur menschlichen Überprüfung zurückgibt, bevor fortgefahren wird.

Python-Beispiel

from twilize.migration import migrate_twb_guided_json
import json

# One-call guided migration
result = migrate_twb_guided_json(
    file_path="templates/SalesDashboard.twb",
    target_source="data/new_data_source.xlsx",
    output_path="output/SalesDashboard_migrated.twb",
)
bundle = json.loads(result)

if bundle["status"] == "warning_review_required":
    # Inspect low-confidence matches and confirm or override them
    print(bundle["warning_review_bundle"])
    # Re-run with confirmed mappings
    result = migrate_twb_guided_json(
        file_path="templates/SalesDashboard.twb",
        target_source="data/new_data_source.xlsx",
        output_path="output/SalesDashboard_migrated.twb",
        mapping_overrides={"Old Field Name": "New Column Name"},
    )

MCP-Tool-Beispiel

Wenn Sie twilize als MCP-Server verwenden, kann ein KI-Agent den vollständigen Workflow ausführen:

inspect_target_schema(target_source="data/new_data_source.xlsx")
→ returns column list and data types

migrate_twb_guided(
    file_path="templates/SalesDashboard.twb",
    target_source="data/new_data_source.xlsx",
    output_path="output/SalesDashboard_migrated.twb"
)
→ returns status: "applied" or "warning_review_required"

Ausgabedateien

Eine abgeschlossene Migration schreibt drei Dateien:

Datei

Inhalt

<output>.twb

Migrierte Arbeitsmappe mit umgeschriebenen Feldreferenzen

migration_report.json

Status pro Feld: zugeordnet / Warnung / blockiert

field_mapping.json

Finale Quell→Ziel-Feldzuordnung zur Prüfung

Scope-Parameter

scope="workbook" migriert alle Arbeitsblätter. Übergeben Sie einen Arbeitsblattnamen, um die Migration auf ein einzelnes Blatt zu beschränken.

Eigenständiges Beispiel

examples/migrate_workflow/ enthält eine Vorlagen-.twb, die ursprüngliche Superstore-Excel, eine Ziel-Superstore-Excel mit chinesischem Gebietsschema und ein ausführbares Skript:

python examples/migrate_workflow/test_migration_workflow.py

Projektstruktur

twilize/
|-- src/twilize/
|   |-- __init__.py
|   |-- capability_registry.py
|   |-- config.py
|   |-- charts/
|   |-- connections.py
|   |-- dashboard_actions.py
|   |-- dashboard_dependencies.py
|   |-- dashboard_layouts.py
|   |-- dashboards.py
|   |-- field_registry.py
|   |-- layout.py
|   |-- layout_model.py
|   |-- layout_rendering.py
|   |-- mcp/
|   |-- parameters.py
|   |-- twb_analyzer.py
|   |-- twb_editor.py
|   |-- validator.py
|   `-- server.py
|-- tests/
|-- examples/
|-- docs/
|-- pyproject.toml
`-- README.md

Entwicklung

# Install in editable mode
pip install -e .

# Run test suite
pytest --basetemp=output/pytest_tmp

# Run the mixed showcase example
python examples/scripts/demo_all_supported_charts.py

# Run the advanced Hyper-backed example
python examples/scripts/demo_hyper_and_new_charts.py

# Run the guided migration example
python examples/migrate_workflow/test_migration_workflow.py

# Start MCP server
twilize

MCP-Server-Manifest

twilize wird mit einem vollständigen MCP-Server-Manifest (mcp-server.json) ausgeliefert — dem MCP-Äquivalent einer Tableau-Erweiterungsdatei .trex. Es deklariert:

.trex Äquivalent

MCP-Feld

Beschreibung

Extension ID

id

`com.twilize.mcp

Available Tools

55 tools
add_calculated_fieldC

Add a calculated field to the datasource.

Inputs: field_name (required), formula (required), datatype, role, +2 more. Returns: result

add_dashboardB

Create a dashboard combining multiple worksheets.

Inputs: dashboard_name (required), worksheet_names (required), width, height, +1 more. Returns: result

add_dashboard_actionC

Add an interaction action to a dashboard.

Inputs: dashboard_name (required), action_type (required), source_sheet (required), target_sheet (required), +3 more. Returns: result

add_parameterC

Add a parameter to the workbook.

Inputs: name (required), datatype, default_value, domain_type, +5 more. Returns: result

add_reference_bandC

Add a reference band (shaded region) to a worksheet.

Inputs: worksheet_name (required), axis_field (required), from_value, to_value, +4 more. Returns: result

add_reference_lineC

Add a reference line to a worksheet (constant, average, median, etc.).

Inputs: worksheet_name (required), axis_field (required), value, formula, +4 more. Returns: result

add_trend_lineB

Add a trend line to a worksheet (linear, polynomial, log, exp, power).

Inputs: worksheet_name (required), fit, degree, show_confidence_bands, +1 more. Returns: result

add_worksheetC

Add a new blank worksheet to the workbook.

Inputs: worksheet_name (required). Returns: result

analyze_twbC

Analyze a TWB file against twilize's declared capabilities.

Inputs: file_path (required). Returns: result

apply_color_paletteC

Set a custom color palette. Built-in: tableau10, tableau20, blue-red, green-gold.

Inputs: palette_name, colors, custom_name. Returns: result

apply_dashboard_themeC

Apply uniform styling (background, font) to all zones in a dashboard.

Inputs: dashboard_name (required), background_color, font_family, title_font_size. Returns: result

apply_twb_migrationC

Apply a workbook migration and write a migrated TWB plus reports.

Inputs: file_path (required), target_source (required), output_path (required), scope, +1 more. Returns: result

configure_chartC

Configure chart type and field mappings for a worksheet.

Inputs: worksheet_name (required), mark_type, columns, rows, +19 more. Returns: result

configure_chart_recipeB

Configure a showcase recipe chart through the shared recipe registry.

Inputs: worksheet_name (required), recipe_name (required), recipe_args, auto_ensure_prerequisites. Returns: result

configure_dual_axisD

Configure a dual-axis chart composition.

Inputs: worksheet_name (required), mark_type_1, mark_type_2, columns, +25 more. Returns: result

configure_worksheet_styleB

Apply worksheet-level styling: background color, axis/grid/border visibility.

Inputs: worksheet_name (required), background_color, hide_axes, hide_gridlines, +17 more. Returns: result

create_workbookC

Create a new workbook from a TWB or TWBX template file.

Inputs: template_path, workbook_name. Returns: result

csv_to_dashboardA

Build a complete Tableau dashboard from a CSV file (end-to-end).

Pipeline: CSV → schema inference → chart suggestion → Hyper extract → workbook creation → chart configuration → dashboard layout → .twbx output.

Args: csv_path: Path to the source CSV file. output_path: Output .twbx path (defaults to <csv_stem>_dashboard.twbx). dashboard_title: Dashboard title (derived from filename if empty). max_charts: Maximum number of charts (0 = use dashboard_rules.yaml default). template_path: TWB template path (empty for default template). theme: Theme preset name (empty = use dashboard_rules.yaml default). Options: modern-light, modern-dark, classic, minimal, vibrant. rules_yaml: Optional YAML string with dashboard rules overrides. Example: "kpi:\n font_size: 32\n max_kpis: 3"

Returns: Summary of the created dashboard with file path.

Inputs: csv_path (required), output_path, dashboard_title, max_charts, +3 more. Returns: result

csv_to_hyperA

Convert a CSV file to a Tableau Hyper extract.

Infers column types and creates a .hyper file that can be used as a data source in Tableau workbooks.

Requires tableauhyperapi (pip install tableauhyperapi).

Args: csv_path: Path to the source CSV file. hyper_path: Output path for the .hyper file. table_name: Table name inside the Hyper file. sample_rows: Rows to sample for type inference.

Returns: Confirmation with row and column counts.

Inputs: csv_path (required), hyper_path (required), table_name, sample_rows. Returns: result

describe_capabilityB

Describe one declared capability and its support tier.

Inputs: kind (required), name (required). Returns: result

diff_template_gapC

Summarize the non-core capability gap of a TWB template.

Inputs: file_path (required). Returns: result

export_rulesA

Export the current active rules to a YAML file.

Saves the complete rules (including any runtime changes from set_rule()) to a YAML file that can be placed next to data files or in the working directory for future sessions.

Args: output_path: Path to save the YAML file. Defaults to ./dashboard_rules.yaml in the current working directory.

Returns: Path to the saved file and summary.

Inputs: output_path. Returns: result

generate_layout_jsonC

Generate and save a dashboard layout JSON file.

Inputs: output_path (required), layout_tree (required), ascii_preview (required). Returns: result

get_active_rulesA

Return the active dashboard creation rules.

Call this at the start of a session to understand what constraints are enforced. The rules engine validates every configure_chart and add_dashboard call — violations are returned as errors or warnings.

Returns: Human-readable summary of all active rules.

Inputs: no named parameters. Returns: result

hyper_to_dashboardA

Build a complete Tableau dashboard from a Hyper extract file (end-to-end).

Pipeline: Hyper → schema inference → chart suggestion → workbook creation → chart configuration → dashboard layout → .twbx output.

Args: hyper_path: Path to the .hyper file. output_path: Output .twbx path (defaults to <hyper_stem>_dashboard.twbx). dashboard_title: Dashboard title (derived from filename if empty). max_charts: Maximum number of charts (0 = use rules default). template_path: TWB template path (empty for default template). table_name: Table name inside the Hyper file (empty = first table). theme: Theme preset name (empty = use rules default). rules_yaml: Optional YAML string with dashboard rules overrides.

Returns: Summary of the created dashboard with file path.

Inputs: hyper_path (required), output_path, dashboard_title, max_charts, +4 more. Returns: result

inspect_csvA

Inspect a CSV file and return its inferred schema with column classification.

Reads the CSV, infers column types (integer, float, date, boolean, string), classifies columns as dimensions or measures with semantic types (categorical, temporal, geographic, numeric), and returns a summary.

Args: csv_path: Path to the CSV file. sample_rows: Number of rows to sample for type inference. encoding: File encoding (default utf-8).

Returns: Human-readable schema summary with dimensions, measures, and types.

Inputs: csv_path (required), sample_rows, encoding. Returns: result

inspect_hyperA

Inspect a Hyper extract file and return its schema with column classification.

Reads the Hyper file, maps column types, classifies columns as dimensions or measures, and returns a summary.

Requires tableauhyperapi (pip install tableauhyperapi).

Args: hyper_path: Path to the .hyper file. table_name: Specific table to inspect (empty = first table).

Returns: Human-readable schema summary with dimensions, measures, and types.

Inputs: hyper_path (required), table_name. Returns: result

inspect_target_schemaB

Inspect the first-sheet schema of a target Excel datasource.

Inputs: target_source (required). Returns: result

list_capabilitiesB

List twilize's declared capability boundary.

Inputs: no named parameters. Returns: result

list_dashboardsA

List dashboards and their worksheet zones in the current workbook.

Inputs: no named parameters. Returns: result

list_fieldsA

List all available fields in the current workbook datasource.

Inputs: no named parameters. Returns: result

list_worksheetsA

List worksheet names in the current workbook.

Inputs: no named parameters. Returns: result

migrate_twb_guidedC

Run the built-in migration workflow and pause for warning confirmation when needed.

Inputs: file_path (required), target_source (required), output_path, scope, +2 more. Returns: result

mssql_to_dashboardA

Build a Tableau dashboard from a Microsoft SQL Server table (end-to-end).

Pipeline: MSSQL → schema inference → chart suggestion → workbook creation → live MSSQL connection → .twb output.

Requires pyodbc for schema inference and ODBC Driver 17 for SQL Server.

Args: server_host: MSSQL server hostname. dbname: Database name. table_name: Table to visualize. username: Database username (ignored if trusted_connection=True). password: Database password (used for schema inference only). port: Server port (default 1433). trusted_connection: Use Windows Authentication instead of SQL auth. output_path: Output .twb path (defaults to _dashboard.twb). dashboard_title: Dashboard title. max_charts: Maximum charts (0 = use rules default). template_path: TWB template path. theme: Theme preset name. rules_yaml: Optional YAML string with dashboard rules overrides.

Returns: Summary of the created dashboard with file path.

Inputs: server_host (required), dbname (required), table_name (required), username, +9 more. Returns: result

mysql_to_dashboardA

Build a Tableau dashboard from a MySQL table (end-to-end).

Pipeline: MySQL → schema inference → chart suggestion → workbook creation → live MySQL connection → .twb output.

Requires mysql-connector-python for schema inference.

Args: server_host: MySQL server hostname. dbname: Database name. table_name: Table to visualize. username: Database username. password: Database password (used for schema inference only; not stored in the workbook). port: Server port (default 3306). output_path: Output .twb path (defaults to _dashboard.twb). dashboard_title: Dashboard title. max_charts: Maximum charts (0 = use rules default). template_path: TWB template path. theme: Theme preset name. rules_yaml: Optional YAML string with dashboard rules overrides.

Returns: Summary of the created dashboard with file path.

Inputs: server_host (required), dbname (required), table_name (required), username (required), +8 more. Returns: result

open_workbookA

Open an existing workbook (.twb or .twbx) for in-place worksheet editing.

Inputs: file_path (required). Returns: result

preview_twb_migrationC

Preview a workbook migration onto a target datasource.

Inputs: file_path (required), target_source (required), scope, mapping_overrides. Returns: result

profile_csvA

Profile a CSV file before connecting it.

Unlike profile_data_source (which needs an active workbook), this tool profiles a raw CSV file directly.

Args: csv_path: Path to the CSV file. sample_rows: Number of rows to sample for type inference.

Returns: Human-readable DataProfile.

Inputs: csv_path (required), sample_rows. Returns: result

profile_data_sourceA

Profile the currently connected data source.

Works for ANY connection type: CSV extract, Hyper, MySQL, Tableau Server, Excel — anything that has fields in the workbook. The profile includes dimension/measure classification, semantic types, domain hints, and boolean signals that guide chart and template selection.

Args: source_type: Override source detection. Usually "auto" which inspects the workbook fields. Other options: "csv", "hyper" (requires separate file path tools).

Returns: Human-readable DataProfile with signals for template/chart decisions.

Inputs: source_type. Returns: result

profile_twb_for_migrationB

Profile workbook datasources and worksheet scope before migration.

Inputs: file_path (required), scope, target_source. Returns: result

propose_field_mappingC

Scan source and target schema and propose a field mapping.

Inputs: file_path (required), target_source (required), scope, mapping_overrides. Returns: result

recommend_templateA

Score all gallery templates and recommend the best fit.

Call this AFTER profiling the data source and deciding on chart types, but BEFORE creating the dashboard layout. The decider evaluates every template in the gallery against the data profile and chart mix, returning a ranked list with reasoning.

Args: chart_types: Comma-separated list of chart mark_types being built. Example: "Bar,Line,Text,Text,Map" If omitted, uses only the data profile signals. kpi_count: Override KPI count (else derived from chart_types).

Returns: Ranked template recommendations with scores and reasoning.

Inputs: chart_types, kpi_count. Returns: result

recommend_template_for_csvB

Recommend templates for a CSV file (no active workbook needed).

Args: csv_path: Path to the CSV file. chart_types: Comma-separated chart types (optional). sample_rows: Rows to sample for inference.

Returns: Ranked template recommendations.

Inputs: csv_path (required), chart_types, sample_rows. Returns: result

remove_calculated_fieldA

Remove a previously added calculated field.

Inputs: field_name (required). Returns: result

reset_rulesA

Reset all rules to the built-in defaults.

Discards any runtime changes made via set_rule() and reloads the default rules from the package YAML file.

Returns: Confirmation message.

Inputs: no named parameters. Returns: result

save_workbookA

Save the workbook as a TWB file. Use a .twbx extension to produce a packaged workbook (ZIP) that bundles the XML with any data extracts and images carried over from the source .twbx.

Inputs: output_path (required). Returns: result

set_hyper_connectionC

Configure the workbook datasource to use a local Hyper extract connection.

Inputs: filepath (required), table_name, tables. Returns: result

set_mssql_connectionC

Configure the workbook datasource to use a Microsoft SQL Server connection.

Inputs: server_host (required), dbname (required), username (required), table_name (required), +1 more. Returns: result

set_mysql_connectionC

Configure the workbook datasource to use a local MySQL connection.

Inputs: server (required), dbname (required), username (required), table_name (required), +1 more. Returns: result

set_ruleA

Set a specific rule value in the active dashboard rules.

This allows admins to modify rules at runtime without editing YAML files. Changes persist for the current session and can be exported with export_rules().

Args: section: Rule section name. Options: "kpi" — KPI formatting (font_size, font_color, bold, row_height, max_kpis, default_format) "charts" — Chart defaults (max_charts, theme, bar_top_n, pie_max_slices) "layout" — Layout settings (width, height, background_color, card_background) "bar_chart_rules" — Bar chart enforcement "theme_rules" — Theme enforcement "map_rules" — Map chart enforcement key: The specific setting to change. Examples: "font_size", "max_charts", "theme", "background_color", "default_format" value: New value (string — will be auto-parsed to int/float/bool as needed). Examples: "28", "modern-dark", "#2D2D2D", "true", "$#,##0.00"

Returns: Confirmation of the change or error message.

Inputs: section (required), key (required), value (required). Returns: result

set_tableauserver_connectionB

Configure the workbook datasource to use a Tableau Server connection.

Inputs: server (required), dbname (required), username (required), table_name (required), +2 more. Returns: result

suggest_charts_for_csvA

Suggest chart types and configurations for a CSV file.

Analyzes the data shape (dimensions, measures, temporal fields, etc.) and returns prioritized chart suggestions with shelf assignments.

Args: csv_path: Path to the CSV file. max_charts: Maximum number of charts to suggest (0 = use dashboard_rules.yaml default). sample_rows: Rows to sample for inference. rules_yaml: Optional YAML string with dashboard rules overrides (e.g. KPI formatting, chart limits).

Returns: Formatted suggestion list with chart types, shelf assignments, and reasoning.

Inputs: csv_path (required), max_charts, sample_rows, rules_yaml. Returns: result

undo_last_changeA

Undo the last mutating operation, restoring the previous workbook state.

Inputs: no named parameters. Returns: result

validate_workbookA

Run an informational XSD schema check on a workbook (2026.1 schema).

This is a non-blocking, advisory check only. Tableau Desktop is the true validator — it routinely produces workbooks that deviate from the published XSD schema, so deviations reported here do NOT indicate the workbook is broken. The workbook will almost certainly open correctly in Tableau regardless of any deviations found.

Args: file_path: Path to a .twb or .twbx file to check. If omitted, checks the currently open workbook (in memory).

Returns: Informational summary of schema deviations (if any).

Inputs: file_path. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 55 tools

    Disambiguation2/5

    Many tools overlap in purpose: configure_chart vs configure_chart_recipe, profile_data_source vs profile_csv vs inspect_csv vs inspect_hyper, recommend_template vs recommend_template_for_csv, and multiple *_to_dashboard tools that differ only by data source. The descriptions help somewhat, but the boundaries between profiling/inspection and chart configuration tools are unclear.

    Naming Consistency3/5

    Most tools follow a verb_noun pattern (e.g., add_worksheet, save_workbook, list_fields), but there are inconsistencies: some use 'inspect_' vs 'profile_' for similar operations, 'generate_layout_json' vs 'create_workbook', and 'migrate_twb_guided' vs 'apply_twb_migration' use different verb styles. The pattern is readable but not uniform.

    Tool Count2/5

    55 tools is excessive for a single MCP server, even one covering Tableau workbook creation, migration, and dashboard generation. Many tools are variants of the same operation (e.g., five *_to_dashboard tools, three profile tools, two recommend_template tools), suggesting the surface could be consolidated to 20-30 tools.

    Completeness4/5

    The tool set covers the full pipeline from data source inspection (CSV, Hyper, MySQL, MSSQL) through workbook creation, chart configuration, dashboard layout, and export. Minor gaps exist (e.g., no explicit tool for editing existing dashboards beyond adding actions, no delete/remove worksheet tool), but the core lifecycle is well covered.

    Related MCP Connectors