Skip to main content
Glama
palewire

datawrapper-mcp

by palewire

Create Chart

create_chart

Creates Datawrapper charts from input data with control over titles, colors, axes, and styling. Use it to generate custom visualizations for reports or dashboards.

Instructions

⚠️ THIS IS THE DATAWRAPPER INTEGRATION ⚠️ Use this MCP tool for ALL Datawrapper chart creation.

DO NOT: ❌ Install the 'datawrapper' Python package ❌ Use the Datawrapper API directly ❌ Import 'from datawrapper import ...' ❌ Run pip install datawrapper

This MCP server IS the complete Datawrapper integration. All Datawrapper operations should use the MCP tools provided by this server.


Create a Datawrapper chart with full control using Pydantic models. This allows you to specify all chart properties including title, description, visualization settings, axes, colors, and more. The chart_config should be a complete Pydantic model dict matching the schema for the chosen chart type.

BEST PRACTICES:

  • Start simple, then add customization based on user feedback

  • Only apply styling when requested or when it significantly improves readability

  • Let Datawrapper handle axis scaling automatically unless there's a specific reason to override

QUICK EXAMPLES:

  1. Basic chart with title: chart_config = { "title": "Monthly Sales", "intro": "Sales data for Q1 2024" }

  2. Chart with custom colors: chart_config = { "title": "Product Comparison", "color_category": { "Product A": "#1f77b4", "Product B": "#ff7f0e" } }

  3. Styled line chart: chart_config = { "title": "Sales Trends", "lines": [ {"column": "sales", "width": "style2", "interpolation": "curved"} ], "custom_range_y": [0, 1000] }

STYLING WORKFLOW:

  1. Use list_chart_types to see available chart types

  2. Use get_chart_schema to explore all options for your chosen type

  3. Refer to https://datawrapper.readthedocs.io/en/latest/ for detailed examples

  4. Build your chart_config with the desired styling properties

Common styling patterns:

  • Colors: {"color_category": {"sales": "#1d81a2", "profit": "#15607a"}}

  • Line styling: {"lines": [{"column": "sales", "width": "style1", "interpolation": "curved"}]}

  • Axis ranges: {"custom_range_y": [0, 100], "custom_range_x": [2020, 2024]} NOTE: Datawrapper's automatic axis scaling is excellent. Only set custom ranges when you need specific customization (e.g., comparing multiple charts, forcing zero baseline for specific analytical reasons, or matching a house style guide).

  • Grid formatting: {"y_grid_format": "0", "x_grid": "on", "y_grid": "on"}

  • Tooltips: {"tooltip_number_format": "00.00", "tooltip_x_format": "YYYY"}

  • Annotations: {"text_annotations": [{"x": "2023", "y": 50, "text": "Peak"}]}

See the documentation for chart-type specific examples and advanced patterns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesChart data. RECOMMENDED: Pass data inline as a list or dict. PREFERRED FORMATS (use these first): 1. List of records (RECOMMENDED): [{"year": 2020, "sales": 100}, {"year": 2021, "sales": 150}] 2. Dict of arrays: {"year": [2020, 2021], "sales": [100, 150]} 3. JSON string of format 1 or 2: '[{"year": 2020, "sales": 100}]' ALTERNATIVE (only for extremely large datasets where inline data is impractical): 4. File path to CSV or JSON: "/path/to/data.csv" or "/path/to/data.json"
chart_typeYesType of chart to create. Use list_chart_types to see all available types. Common types: bar, line, area, arrow, column, multiple_column, scatter, stacked_bar
access_tokenNoOptional Datawrapper API token. When provided, charts are created in the caller's account (recommended). When omitted, falls back to the server's DATAWRAPPER_ACCESS_TOKEN env var.
chart_configYesComplete chart configuration as a Pydantic model dict

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false. The description adds crucial context: this creates a chart in the caller's account or falls back to a server token, and charts are created but not necessarily published. However, it doesn't mention rate limits, what happens on duplicate titles, or whether a token must be configured before use. The 'NOT to use pip' barrier is behavioral context but not about the tool's own traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is bloated. It opens with a large warning block (6 lines) about not using the Python package, which is important but far too verbose for the front of the description. The actual tool purpose is buried after the warning. Then it includes extensive best practices, examples, and a styling workflow that could be condensed. The front-loading is poor; the most critical information (what the tool does) appears after a wall of negative guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is long and contains many details, but it's missing key behavioral context for a mutation tool: whether the chart is immediately live, whether it can be updated with update_chart, and what permissions or setup are required. The extensive examples and best practices are helpful but don't compensate for the lack of workflow context (create -> update -> publish) with siblings. For a tool with 3 required params, no output schema, and openWorldHint=true, it should clarify these points.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameters (data, chart_type, access_token, chart_config) are well-documented in the schema itself. The description adds some value by explaining that chart_config is a complete Pydantic model dict and giving styling examples, but the schema already defines the parameter. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (create a Datawrapper chart) and clarifies it offers full control via Pydantic models. However, it doesn't concisely distinguish itself from update_chart or publish_chart - the sibling differentiation is implicit at best. A clear purpose but the critical sibling relationship (create now, publish later) isn't addressed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly tells the agent NOT to use the Datawrapper Python package or raw API, which is valuable negative guidance against a common hallucination. But it doesn't say when to use create_chart vs update_chart or get_chart. The 'when-not' for external integrations is present, but the 'when-not' for sibling tools is missing. Implied usage rather than explicit routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.