publish_chart
Publish a Datawrapper chart to make it publicly accessible and obtain its public URL for sharing or embedding.
Instructions
⚠️ DATAWRAPPER MCP TOOL ⚠️ This is part of the Datawrapper MCP server integration.
Publish a Datawrapper chart to make it publicly accessible. Returns the public URL of the published chart. IMPORTANT: Only use this tool when the user explicitly requests to publish the chart. Do not automatically publish charts after creation unless specifically asked.
Args: chart_id: ID of the chart to publish
Returns: Public URL of the published chart
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chart_id | Yes |
Implementation Reference
- handlers/publish.py:11-28 (handler)The actual handler function implementing the publish_chart tool logic.
async def publish_chart(arguments: PublishChartArgs) -> list[TextContent]: """Publish a chart to make it publicly accessible.""" chart_id = arguments["chart_id"] # Get chart and publish using Pydantic instance method chart = get_chart(chart_id) chart.publish() public_url = chart.get_public_url() result = { "chart_id": chart_id, "public_url": public_url, "message": "Chart published successfully!", } return [TextContent(type="text", text=json.dumps(result, indent=2))] - server.py:224-247 (registration)The MCP tool decorator and wrapper for publishing a chart.
async def publish_chart(chart_id: str) -> str: """⚠️ DATAWRAPPER MCP TOOL ⚠️ This is part of the Datawrapper MCP server integration. --- Publish a Datawrapper chart to make it publicly accessible. Returns the public URL of the published chart. IMPORTANT: Only use this tool when the user explicitly requests to publish the chart. Do not automatically publish charts after creation unless specifically asked. Args: chart_id: ID of the chart to publish Returns: Public URL of the published chart """ try: arguments = cast(PublishChartArgs, {"chart_id": chart_id}) result = await publish_chart_handler(arguments) return result[0].text except Exception as e: return f"Error publishing chart with ID '{chart_id}': {str(e)}" - dw_types.py:28-32 (schema)Type definition for the arguments accepted by the publish_chart tool.
class PublishChartArgs(TypedDict): """Arguments for publish_chart handler.""" chart_id: str