Skip to main content
Glama
niradler

diagram-mcp

by niradler

render_plotly

Render Plotly charts to SVG, PNG, JPG, or PDF format with customizable styling and output as a URL, file path, or base64 data.

Instructions

Render a Plotly chart to SVG, PNG, JPG, or PDF format with comprehensive styling and output options. Output options:

  • "link" (default): Returns a localhost URL for easy viewing

  • "filepath": Saves to disk and returns the file path

  • "raw": Returns base64 data for images or raw SVG string

Examples:

  • Basic chart: Provide plotlyCode with Plotly.newPlot() call

  • Localhost image: Set format='png' with output='link' (default) to get a localhost URL (always show the user the link he can view the diagram in a browser)

  • Save to disk: Set output='filepath' to save and get file path

  • Base64 image: Set output='raw' to get base64 data for tags

  • Custom styling: Use backgroundColor, width, height, and plotlyConfig options

Plotly Code Example: Plotly.newPlot('plotly-chart', [{ x: [1, 2, 3, 4, 5], y: [1, 2, 4, 8, 16], type: 'scatter' }], { margin: { t: 0 } });

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthNo
formatNosvg
heightNo
outputNolink
qualityNo
filePathNo
plotlyCodeYes
responsiveNo
displaylogoNo
displayModeBarNo
backgroundColorNo
modeBarButtonsToRemoveNo
Behavior4/5

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

With no annotations beyond title, the description effectively discloses key behaviors: output types (link returns localhost URL, filepath saves to disk, raw returns base64), custom styling options, and examples. It does not mention error cases or side effects, but the rendering behavior is well explained.

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 well-structured with bullet points and examples. It is relatively long but each section adds value: purpose, output options, multiple examples. Front-loaded with the main purpose.

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

Completeness4/5

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

Given the tool has 12 parameters and no output schema, the description covers the required plotlyCode, output formats, styling, and return behavior for each output type. It could mention that the localhost URL is temporary or that file path requires write permissions, but overall is complete enough.

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?

Despite 0% schema description coverage, the description adds significant meaning by explaining output options, format, and styling parameters (backgroundColor, width, height). The example code illustrates the required plotlyCode structure, compensating for the lack of per-parameter descriptions.

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 it renders Plotly charts to multiple formats (SVG, PNG, JPG, PDF). It distinguishes from sibling tool render_mermaid by focusing on Plotly, a different charting library.

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

Usage Guidelines4/5

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

The description provides explicit usage guidance through examples for different output options (link, filepath, raw) and mentions the required plotlyCode. It implicitly differentiates from render_mermaid but does not explicitly state when not to use this tool.

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/niradler/diagram-mcp'

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