Skip to main content
Glama
SVGForge MCP

SVGForge MCP

by liqiang88

sanitize_svg

Remove script tags, event handlers, dangerous URLs, and DOCTYPE/ENTITY payloads from raw SVG markup to prevent code execution and injection risks.

Instructions

Sanitize raw SVG: strip script tags, event handlers, dangerous URLs, and DOCTYPE/ENTITY payloads.

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": "sanitize_svg"
  }
}

Input Schema

NameRequiredDescriptionDefault
svgYesRaw SVG markup

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the critical destructive behavior — the four categories of content that get stripped. It says nothing about the return value, whether the sanitized markup is returned as a string or written somewhere, or what happens on malformed input, which are meaningful gaps for a mutation-like tool.

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?

One tightly written sentence with the verb and resource front-loaded followed by an itemized list of stripped content. Every clause earns its place and nothing is padded.

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 one-parameter utility this is nearly complete: the transformation is precisely scoped and no output schema exists to defer to. The one real omission is whether the caller receives sanitized SVG text back, which an agent would want confirmed before chaining this into a render or data-URI step.

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?

There is a single parameter at 100% schema description coverage, so the baseline is 3. The description's phrase 'raw SVG' matches the schema's 'Raw SVG markup' without adding format, size, or encoding constraints beyond it.

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 opens with a specific verb and resource ('Sanitize raw SVG') and then enumerates exactly what is removed: script tags, event handlers, dangerous URLs, DOCTYPE/ENTITY payloads. That level of specificity makes it unmistakable against siblings like svg_to_data_uri or get_icon, which do unrelated work.

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: an agent can infer this should be applied to untrusted raw SVG before embedding or converting it, but the description never states when to call it or when not to. It also does not point at svg_to_data_uri as the natural next step, nor say whether output from the icon-fetching siblings needs this treatment.

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