Skip to main content
Glama

SVG to PNG & WebP High-DPI Renderer API

svg_to_png_api
Read-onlyIdempotent

Render SVG vector graphics into crisp high-DPI PNG, WebP, or JPEG raster images with custom width, height, scale factor (up to 4x), transparent or hex background fill, and quality control. Blocks DTD/XXE and external network references for safe server-side rendering. Deterministic, sub-second latency, nothing stored. Usable from AI agents via MCP. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.01/call via x402 at https://radarbg.com/x402/svg-to-png-api.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"40\" viewBox=\"0 0 120 40\"><rect width=\"120\" height=\"40\" rx=\"8\" fill=\"#0f766e\"/><text x=\"60\" y=\"25\" font-family=\"DejaVu Sans\" font-size=\"14\" fill=\"#ffffff\" text-anchor=\"middle\">READY</text></svg>",
      "width": 240,
      "format": "png"
    },
    "name": "svg_to_png_api"
  }
}

Input Schema

NameRequiredDescriptionDefault
svgNoRaw SVG XML markup string (provide either svg or fileBase64, max 5 MB).
scaleNoScale multiplier when width/height are omitted (0.25-4, e.g. 2 for retina).
widthNoOptional target width in pixels (aspect ratio preserved if height omitted).
formatNoOutput image format: png, webp, or jpeg.png
heightNoOptional target height in pixels.
qualityNoCompression quality for WebP/JPEG (1-100).
backgroundNoOptional 6-digit hex background color (e.g. #ffffff). Omit for transparent PNG/WebP.
fileBase64NoBase64-encoded SVG or gzipped SVG file (alternative to svg).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, openWorld), the description discloses security sanitization (DTD/XXE and external network references blocked), determinism, sub-second latency, and that nothing is stored. It also spells out the auth mechanism (X-API-Key header) and both monetization paths with concrete rate limits, which the annotations cannot convey.

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

Conciseness3/5

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

Core capability is front-loaded, which is good, but the text is padded with marketing adjectives ('crisp', 'Usable from AI agents via MCP') and two full pricing URLs that consume space disproportionate to their decision value. The security sentence earns its place; the pricing tail does not.

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?

For an 8-parameter tool with full schema coverage but no output schema, the description covers formats, limits, sanitization, statelessness, and access/auth well. The one meaningful gap is the response shape — it never says whether the rendered image returns as base64, binary, or a URL, which an agent needs and which no output schema supplies.

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 description coverage is 100%, so every parameter already carries its own documentation, including ranges and defaults. The description restates scale (up to 4x), background (transparent or hex), and quality control without adding syntax or edge-case guidance beyond the schema. Baseline 3 applies 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.

Purpose5/5

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

The first sentence gives a specific verb (render), a specific input (SVG vector graphics), and the exact output formats (PNG, WebP, JPEG raster), plus the transformation dimensions (width, height, scale, background, quality). This clearly separates it from siblings like image_to_svg (opposite direction) and ico_to_png (different source format).

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?

The description supplies operational context for access (free tier of 5 calls/day per IP, paid via Radar API key or x402 per-call), which implicitly tells the agent when the tool is callable. However, it never states when to prefer this over a sibling such as ico_to_png, nor does it give any exclusions or preconditions for the SVG input itself. Usage is implied rather than guided.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources