Skip to main content
Glama
SVGForge MCP

SVGForge MCP

by liqiang88

svg_to_data_uri

Convert raw SVG markup to a percent-encoded or base64 Data URI for CSS background-image or HTML img src.

Instructions

Convert raw SVG into a Data URI for CSS background-image or HTML img src.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "svg": "<svg>"
    },
    "name": "svg_to_data_uri"
  }
}

Input Schema

NameRequiredDescriptionDefault
svgYesRaw SVG markup
encodingNoEncoding (default uri / percent-encoded)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the burden. It makes clear this is a pure format transformation with no stated side effects, but it says nothing about whether the SVG is validated or sanitized, what happens with malformed markup, or whether very large SVGs are size-limited. For a stateless converter the gap is modest rather than severe.

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?

A single sentence that front-loads the verb and resource and then names the downstream uses. No padding, no restatement of the tool name, and nothing that could be trimmed without losing information.

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?

The tool is simple (two params, one required, no nesting, no output schema), and the description covers what goes in and what comes out well enough to call it correctly. What is missing — validation behavior on bad input and the exact return form — is minor at this complexity level.

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 both the svg and encoding parameters (including the uri/base64 enum and the default) are already fully documented in the schema. The description adds no meaning beyond that and does not, for example, hint at which encoding suits which context. Baseline 3 is appropriate.

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

Purpose4/5

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

States a specific verb (Convert) and resource (raw SVG) plus the produced artifact (Data URI) and its two intended consumers (CSS background-image, HTML img src). It is immediately clear what the tool does, though it does not distinguish itself from the sibling sanitize_svg, which an agent might reasonably confuse it with.

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?

Usage is only implied by naming the output contexts (CSS background-image / img src); there is no explicit when-to-use versus when-not-to-use statement, and no guidance on whether input should be sanitized first or on choosing between this and any sibling. An agent can infer intent but must guess at prerequisites.

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