Skip to main content
Glama

g_validate

Validates, sanitizes and normalizes SVG icons: checks XML well-formedness, blocks scripts and event handlers, adds missing xmlns and viewBox, then injects color and size to return clean usable markup.

Instructions

Validate, sanitize and normalize an AI-generated (or any hand-written) SVG icon: XML well-formedness, security filter (rejects /event handlers//javascript:), adds missing xmlns/viewBox, injects color/size. Returns the cleaned SVG ready for use, plus warnings.

Input Schema

NameRequiredDescriptionDefault
svgYesThe SVG markup to validate, root element must be <svg>
sizeNoOutput size in px, e.g. 32. Injected as width/height
colorNoColor to apply, e.g. "#333333". Replaces currentColor; injects fill if none present

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.9/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 well: it discloses the security filter's specific rejection list (<script>, event handlers, <foreignObject>, javascript:), the additive repairs (xmlns/viewBox, color/size), and the return shape (cleaned SVG plus warnings). It leaves ambiguous whether offending content causes rejection/error or silent stripping, which is the main behavioral gap.

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 dense sentence front-loads the action verbs, then the security scope, then the return value; each clause carries distinct information with no repetition of the title or filler.

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

Completeness5/5

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

For a 3-parameter sanitizer with no output schema and no annotations, the description supplies the security policy, the repair set, and the return payload plus warnings. An agent can decide to call it and predict the outcome; only error-vs-sanitize semantics remain unstated.

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 the schema already defines svg, size and color with examples and injection behavior. The description echoes 'injects color/size' without adding syntax, defaults, or edge-case semantics beyond the schema, so baseline 3 applies.

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?

The description opens with a specific verb chain (validate, sanitize, normalize) and a concrete resource (SVG icon), then enumerates exactly what is checked and what is injected. It implicitly positions itself downstream of generation ('AI-generated') but never names the sibling g_generate, so it stops short of full sibling differentiation.

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 context is implied by 'AI-generated (or any hand-written) SVG icon' and the returned 'cleaned SVG ready for use', which suggests calling this before embedding an icon. However there is no explicit when-to-use statement relative to g_generate or i_download_svg, and no when-not guidance.

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