Skip to main content
Glama
hqu

Datawrapper MCP

by hqu

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
NameRequiredDescriptionDefault
chart_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)}"
  • Type definition for the arguments accepted by the publish_chart tool.
    class PublishChartArgs(TypedDict):
        """Arguments for publish_chart handler."""
    
        chart_id: str
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it makes charts publicly accessible (implying a mutation/permissions change), returns a public URL, and includes a warning about explicit user requests. However, it lacks details on potential side effects like irreversible changes or authentication requirements.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first. However, the initial warning banner ('⚠️ DATAWRAPPER MCP TOOL ⚠️') and separator ('---') add minor clutter without critical information, slightly reducing efficiency.

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

Completeness5/5

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

Given the tool's moderate complexity (1 parameter, mutation operation), no annotations, and an output schema present (which handles return values), the description is complete enough. It covers purpose, usage guidelines, parameter meaning, and key behavioral aspects, providing adequate context for an agent to use the tool correctly.

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

Parameters4/5

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

The schema description coverage is 0%, so the description must compensate. It clearly explains the single parameter 'chart_id' as 'ID of the chart to publish', adding essential meaning beyond the schema's basic type information. This is sufficient for the single parameter, though it doesn't cover format or validation details.

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

Purpose5/5

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

The description clearly states the specific action ('Publish a Datawrapper chart') and the resource ('Datawrapper chart'), distinguishing it from siblings like create_chart, delete_chart, or update_chart by focusing on making charts publicly accessible rather than creating, removing, or modifying them.

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

Usage Guidelines5/5

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

It provides explicit guidance on when to use this tool ('when the user explicitly requests to publish the chart') and when not to use it ('Do not automatically publish charts after creation unless specifically asked'), clearly differentiating it from alternatives like create_chart or update_chart that might be used in other contexts.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hqu/datawrapper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server