get_chart_schema
Retrieve the JSON schema for Datawrapper chart types to discover styling and configuration options, including properties, types, and default values.
Instructions
⚠️ DATAWRAPPER MCP TOOL ⚠️ This is part of the Datawrapper MCP server integration.
Get the Pydantic JSON schema for a specific chart type. This is your primary tool for discovering styling and configuration options.
The schema shows:
All available properties and their types
Enum values (e.g., line widths, interpolation methods)
Default values
Detailed descriptions for each property
WORKFLOW: Use this tool first to explore options, then refer to https://datawrapper.readthedocs.io/en/latest/ for detailed examples and patterns showing how to use these properties in practice.
Args: chart_type: Chart type to get schema for
Returns: JSON schema for the chart type
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chart_type | Yes |
Implementation Reference
- handlers/schema.py:12-56 (handler)Implementation of the get_chart_schema tool.
async def get_chart_schema(arguments: GetChartSchemaArgs) -> list[TextContent]: """Get the Pydantic schema for a chart type.""" chart_type = arguments["chart_type"] if chart_type in MAP_TYPE_ALIASES: result = { "chart_type": chart_type, "class_name": "MapChart (API-backed)", "schema": { "type": "object", "description": ( "Map chart config passed through to Datawrapper metadata. " "Common fields include title, intro, notes, byline, source-name, " "source-url, aria-description, tooltip-title, tooltip-body, " "tooltip-enabled, and tooltip-sticky." ), "additionalProperties": True, }, "usage": ( "Map chart types are created via Datawrapper's raw chart-type API. " "Provide chart_config fields as high-level Datawrapper metadata keys." ), } return [TextContent(type="text", text=json.dumps(result, indent=2))] chart_class: type[Any] = CHART_CLASSES[chart_type] schema = chart_class.model_json_schema() # Remove examples that contain DataFrames (not JSON serializable) if "examples" in schema: del schema["examples"] result = { "chart_type": chart_type, "class_name": chart_class.__name__, "schema": schema, "usage": ( "Use this schema to construct a chart_config dict for create_chart_advanced. " "The schema shows all available properties, their types, and descriptions." ), } return [TextContent(type="text", text=json.dumps(result, indent=2))] - dw_types.py:46-50 (schema)Type definition for the arguments of get_chart_schema.
class GetChartSchemaArgs(TypedDict): """Arguments for get_chart_schema handler.""" chart_type: str