Skip to main content
Glama

svg_to_png

Rasterize a self-contained SVG file to PNG locally, blocking external references and publishing output atomically so failures do not overwrite existing files.

Instructions

Rasterize a self-contained SVG file to a PNG image.

The conversion runs locally on CPU. External file and network references
are blocked; embedded ``data:`` resources remain supported. Rendered output
is limited to 8192 pixels per side and 32 million total pixels, then
validated and atomically published so a failure cannot replace an existing
destination with partial bytes.

Args:
    file_path:       Absolute path to the .svg file.
    output_path:     Absolute path for the output .png file. If empty, the
                     PNG is saved beside the source with the same stem.
    scale:           Positive scale factor up to 16. Cannot be combined
                     with output_width or output_height.
    output_width:    Optional positive pixel width. If output_height is
                     omitted, the aspect ratio is preserved.
    output_height:   Optional positive pixel height. If output_width is
                     omitted, the aspect ratio is preserved.
    background_color: Optional CSS color for otherwise transparent pixels.

Input Schema

NameRequiredDescriptionDefault
scaleNo
file_pathYes
output_pathNo
output_widthNo
output_heightNo
background_colorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses local CPU execution, blocked network/external references, hard limits of 8192 px per side and 32M total pixels, and atomic publishing that prevents partial overwrites of an existing destination. The main omission is the return payload (whether it returns the written path or metadata), which matters since there is no output schema.

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

Conciseness5/5

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

Front-loaded one-line purpose followed by behavioral constraints, then a scannable Args block. Given 0% schema coverage, the argument list earns its space rather than duplicating existing documentation.

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 a 6-parameter conversion tool with no annotations and no output schema, the description supplies execution model, safety limits, failure semantics, and complete parameter meaning. The gap is the return contract: the agent cannot tell what the call yields (path string, dimensions, nothing) beyond the side effect on disk.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate entirely, and it does: every one of the 6 parameters is documented with semantics the schema lacks, including the scale ceiling of 16, the mutual exclusivity of scale with output_width/output_height, aspect-ratio preservation when only one dimension is given, and the empty-output_path default of same-stem-beside-source.

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?

Opens with a specific verb and resource: 'Rasterize a self-contained SVG file to a PNG image.' The 'self-contained' qualifier immediately scopes it, and no sibling tool (all PDF-oriented) overlaps, so the agent can select it unambiguously.

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?

Provides clear applicability context via constraints: conversion runs locally on CPU, external file and network references are blocked, only embedded data: resources work. That effectively signals when the tool will fail, but it never names an alternative path for SVGs that reference external assets, so it stops short of full when/when-not routing.

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