Skip to main content
Glama

generate_svg

Generate SVG graphics from text prompts. Specify subject, style, and colors; optionally include reference images for guidance. Returns raw SVG markup or saves to disk.

Instructions

Generate one or more SVGs from a text prompt using QuiverAI. Returns raw SVG markup.

Prompt guide

A good prompt has three parts: subject (specific object), style (aesthetic keywords), and color palette (hex codes if possible).

What works

  • Use concrete, famous physical objects the model has seen (AirPods, Nike Dunks, Shure SM7B, Montblanc pen, Leica camera, Nest thermostat, espresso machines). Cylindrical/round objects explode especially cleanly in isometric style.

  • Name the style explicitly: 'line art', 'hand drawn', 'duotone', 'flat monochrome icon', 'geometric', 'minimalist', 'isometric', 'blueprint'.

  • Specify colors with hex codes: 'background: #e9edc9 and logo in #fb8500'.

  • Add composition framing: 'centered icon', 'wide horizontal logo'.

  • Prompt modifiers: 'geometric' → angular shapes, 'detailed' → more elements, 'simple' → clearer shapes, 'minimalist' → fewer details, 'flat monochrome' → single-color, 'duotone' → two-color.

What does NOT work

  • NEVER mention 'AI', 'machine learning', 'voice assistant', 'workflow automation', or abstract software concepts — produces garbage. Use physical metaphors instead (microphone for voice, watch movement for precision).

  • Abstract concepts without physical objects: 'knowledge graph', 'automation pipeline', 'data flow'.

  • Obscure B2B hardware the model hasn't seen (e.g. Loxone Miniserver → generic blob).

  • 'minimalist line icon' constraints — model ignores them and fills with color.

Iteration strategy

Start specific, not vague. Bad: 'Tech logo'. Better: 'Tech startup logo with geometric shapes, blue gradient'. Best: 'SaaS productivity logo with connected geometric nodes, electric blue to purple gradient, clean modern style'.

Verified template

exploded isometric view of a {FAMOUS_OBJECT}, technical blueprint drawing, thin line art, dotted grid background, labeled components, engineering illustration

Known issues

  • ~1 in 10 generations have corrupted SVG tails (malformed XML). Generate 3+ variants as insurance.

  • Model may ignore 'no fills'/'monochrome' and hardcode its own palette. Post-process with find/replace for brand colors.

  • First call may 504 — retry succeeds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesWHAT to generate. Be specific: name a concrete famous object, add style keywords, and specify colors with hex codes. Example: 'Heraldic lion crest with ornate medieval style details and gold gradient accents'. Never use abstract concepts like 'AI agent' or 'workflow' — use physical metaphors instead.
modelYesModel ID to use. Recommended: 'arrow-preview' (Arrow 1.0, #1 on SVG Arena). Use list_models to discover all options.
instructionsNoHOW it should look — style guidance separate from the subject. Think of prompt as 'what' and instructions as 'how'. Example: prompt='Japanese crane', instructions='Use a warm muted palette with detailed feather work'.
nNoNumber of SVG variants to generate (max 16). Recommended: 3+ at higher temperature for best results, since ~1 in 10 generations can have corrupted tails.
temperatureNoSampling temperature (0–2). Lower (0.4) = more consistent, higher (0.9) = more creative variation. Use 0.9 with n≥3 for exploration.
referencesNoUp to 4 reference images for style, color, and composition guidance. References pull palette/color hints from the image, but style keywords ('blueprint', 'isometric', 'flat') must still be in the text prompt — references alone won't change drawing style.
outputPathNoOptional absolute file path to save the SVG(s) to disk. If omitted, SVG markup is returned in the response only. For multiple variants (n > 1), files are saved with _1, _2 … suffixes. Parent directories are created automatically.

Implementation Reference

  • src/index.ts:103-201 (registration)
    Registration of the 'generate_svg' tool in the ListToolsRequestSchema handler, including its description and input schema.
    {
      name: "generate_svg",
      description:
        "Generate one or more SVGs from a text prompt using QuiverAI. Returns raw SVG markup.\n\n" +
        "## Prompt guide\n\n" +
        "A good prompt has three parts: **subject** (specific object), **style** (aesthetic keywords), and **color palette** (hex codes if possible).\n\n" +
        "### What works\n" +
        "- Use concrete, famous physical objects the model has seen (AirPods, Nike Dunks, Shure SM7B, Montblanc pen, Leica camera, Nest thermostat, espresso machines). " +
        "Cylindrical/round objects explode especially cleanly in isometric style.\n" +
        "- Name the style explicitly: 'line art', 'hand drawn', 'duotone', 'flat monochrome icon', 'geometric', 'minimalist', 'isometric', 'blueprint'.\n" +
        "- Specify colors with hex codes: 'background: #e9edc9 and logo in #fb8500'.\n" +
        "- Add composition framing: 'centered icon', 'wide horizontal logo'.\n" +
        "- Prompt modifiers: 'geometric' → angular shapes, 'detailed' → more elements, 'simple' → clearer shapes, 'minimalist' → fewer details, 'flat monochrome' → single-color, 'duotone' → two-color.\n\n" +
        "### What does NOT work\n" +
        "- NEVER mention 'AI', 'machine learning', 'voice assistant', 'workflow automation', or abstract software concepts — produces garbage. Use physical metaphors instead (microphone for voice, watch movement for precision).\n" +
        "- Abstract concepts without physical objects: 'knowledge graph', 'automation pipeline', 'data flow'.\n" +
        "- Obscure B2B hardware the model hasn't seen (e.g. Loxone Miniserver → generic blob).\n" +
        "- 'minimalist line icon' constraints — model ignores them and fills with color.\n\n" +
        "### Iteration strategy\n" +
        "Start specific, not vague. Bad: 'Tech logo'. Better: 'Tech startup logo with geometric shapes, blue gradient'. " +
        "Best: 'SaaS productivity logo with connected geometric nodes, electric blue to purple gradient, clean modern style'.\n\n" +
        "### Verified template\n" +
        "`exploded isometric view of a {FAMOUS_OBJECT}, technical blueprint drawing, thin line art, dotted grid background, labeled components, engineering illustration`\n\n" +
        "### Known issues\n" +
        "- ~1 in 10 generations have corrupted SVG tails (malformed XML). Generate 3+ variants as insurance.\n" +
        "- Model may ignore 'no fills'/'monochrome' and hardcode its own palette. Post-process with find/replace for brand colors.\n" +
        "- First call may 504 — retry succeeds.",
      inputSchema: {
        type: "object",
        required: ["prompt", "model"],
        properties: {
          prompt: {
            type: "string",
            description:
              "WHAT to generate. Be specific: name a concrete famous object, add style keywords, and specify colors with hex codes. " +
              "Example: 'Heraldic lion crest with ornate medieval style details and gold gradient accents'. " +
              "Never use abstract concepts like 'AI agent' or 'workflow' — use physical metaphors instead.",
          },
          model: {
            type: "string",
            description:
              "Model ID to use. Recommended: 'arrow-preview' (Arrow 1.0, #1 on SVG Arena). Use list_models to discover all options.",
          },
          instructions: {
            type: "string",
            description:
              "HOW it should look — style guidance separate from the subject. Think of prompt as 'what' and instructions as 'how'. " +
              "Example: prompt='Japanese crane', instructions='Use a warm muted palette with detailed feather work'.",
          },
          n: {
            type: "number",
            description:
              "Number of SVG variants to generate (max 16). Recommended: 3+ at higher temperature for best results, since ~1 in 10 generations can have corrupted tails.",
          },
          temperature: {
            type: "number",
            description:
              "Sampling temperature (0–2). Lower (0.4) = more consistent, higher (0.9) = more creative variation. Use 0.9 with n≥3 for exploration.",
          },
          references: {
            type: "array",
            description:
              "Up to 4 reference images for style, color, and composition guidance. " +
              "References pull palette/color hints from the image, but style keywords ('blueprint', 'isometric', 'flat') must still be in the text prompt — references alone won't change drawing style.",
            items: {
              type: "object",
              oneOf: [
                {
                  required: ["url"],
                  properties: {
                    url: {
                      type: "string",
                      description: "HTTP/HTTPS image URL.",
                    },
                  },
                },
                {
                  required: ["base64"],
                  properties: {
                    base64: {
                      type: "string",
                      description: "Base64-encoded image data.",
                    },
                  },
                },
              ],
            },
          },
          outputPath: {
            type: "string",
            description:
              "Optional absolute file path to save the SVG(s) to disk. " +
              "If omitted, SVG markup is returned in the response only. " +
              "For multiple variants (n > 1), files are saved with _1, _2 … suffixes. " +
              "Parent directories are created automatically.",
          },
        },
      },
    },
  • Input schema for the generate_svg tool, defining required parameters (prompt, model) and optional parameters (instructions, n, temperature, references, outputPath).
    inputSchema: {
      type: "object",
      required: ["prompt", "model"],
      properties: {
        prompt: {
          type: "string",
          description:
            "WHAT to generate. Be specific: name a concrete famous object, add style keywords, and specify colors with hex codes. " +
            "Example: 'Heraldic lion crest with ornate medieval style details and gold gradient accents'. " +
            "Never use abstract concepts like 'AI agent' or 'workflow' — use physical metaphors instead.",
        },
        model: {
          type: "string",
          description:
            "Model ID to use. Recommended: 'arrow-preview' (Arrow 1.0, #1 on SVG Arena). Use list_models to discover all options.",
        },
        instructions: {
          type: "string",
          description:
            "HOW it should look — style guidance separate from the subject. Think of prompt as 'what' and instructions as 'how'. " +
            "Example: prompt='Japanese crane', instructions='Use a warm muted palette with detailed feather work'.",
        },
        n: {
          type: "number",
          description:
            "Number of SVG variants to generate (max 16). Recommended: 3+ at higher temperature for best results, since ~1 in 10 generations can have corrupted tails.",
        },
        temperature: {
          type: "number",
          description:
            "Sampling temperature (0–2). Lower (0.4) = more consistent, higher (0.9) = more creative variation. Use 0.9 with n≥3 for exploration.",
        },
        references: {
          type: "array",
          description:
            "Up to 4 reference images for style, color, and composition guidance. " +
            "References pull palette/color hints from the image, but style keywords ('blueprint', 'isometric', 'flat') must still be in the text prompt — references alone won't change drawing style.",
          items: {
            type: "object",
            oneOf: [
              {
                required: ["url"],
                properties: {
                  url: {
                    type: "string",
                    description: "HTTP/HTTPS image URL.",
                  },
                },
              },
              {
                required: ["base64"],
                properties: {
                  base64: {
                    type: "string",
                    description: "Base64-encoded image data.",
                  },
                },
              },
            ],
          },
        },
        outputPath: {
          type: "string",
          description:
            "Optional absolute file path to save the SVG(s) to disk. " +
            "If omitted, SVG markup is returned in the response only. " +
            "For multiple variants (n > 1), files are saved with _1, _2 … suffixes. " +
            "Parent directories are created automatically.",
        },
      },
    },
  • Handler for the generate_svg tool: destructures args, calls quiver.createSVGs.generateSVG(), validates response with assertSvgResponse, formats SVG content, and optionally writes files using writeSvgs helper.
    if (name === "generate_svg") {
      const { prompt, model, instructions, n, temperature, references, outputPath } =
        args as {
          prompt: string;
          model: string;
          instructions?: string;
          n?: number;
          temperature?: number;
          references?: Array<{ url?: string; base64?: string }>;
          outputPath?: string;
        };
    
      const response = await quiver.createSVGs.generateSVG({
        prompt,
        model,
        instructions,
        n,
        temperature,
        stream: false,
        references: references?.map((ref) =>
          ref.url !== undefined
            ? { url: ref.url }
            : { base64: ref.base64! }
        ),
      });
    
      const result = response.result;
      assertSvgResponse(result);
    
      const rawSvgs = result.data.map((d) => d.svg);
      const content = rawSvgs.map((svg, i) => ({
        type: "text" as const,
        text: n && n > 1 ? `<!-- SVG ${i + 1} -->\n${svg}` : svg,
      }));
    
      if (outputPath) {
        const paths = await writeSvgs(rawSvgs, outputPath);
        content.push({
          type: "text" as const,
          text: `Saved to: ${paths.join(", ")}`,
        });
      }
    
      return { content };
  • Helper type-guard assertion function that validates the QuiverAI API response has the expected shape (an object with a data array of svg strings). Used by the generate_svg handler.
    function assertSvgResponse(
      result: unknown
    ): asserts result is { data: Array<{ svg: string }> } {
      if (
        typeof result !== "object" ||
        result === null ||
        !("data" in result) ||
        !Array.isArray((result as Record<string, unknown>).data)
      ) {
        const err = result as { message?: string };
        throw new Error(
          `QuiverAI API error: ${err.message ?? JSON.stringify(result)}`
        );
      }
    }
  • Helper function that writes SVG string(s) to disk, handling single vs. multiple file naming with _1, _2 suffixes.
    async function writeSvgs(
      svgs: string[],
      outputPath: string
    ): Promise<string[]> {
      await mkdir(dirname(outputPath), { recursive: true });
    
      if (svgs.length === 1) {
        const p = outputPath.endsWith(".svg") ? outputPath : `${outputPath}.svg`;
        await writeFile(p, svgs[0], "utf-8");
        return [p];
      }
    
      const ext = extname(outputPath);
      const base = ext ? outputPath.slice(0, -ext.length) : outputPath;
      const suffix = ext || ".svg";
    
      const paths: string[] = [];
      for (let i = 0; i < svgs.length; i++) {
        const p = `${base}_${i + 1}${suffix}`;
        await writeFile(p, svgs[i], "utf-8");
        paths.push(p);
      }
      return paths;
    }
Behavior5/5

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

With no annotations, the description fully covers behavioral traits: it mentions return format (raw SVG markup), corruption rate (~1 in 10), timeout behavior (504 with retry), and model's tendency to ignore palette constraints. This gives the agent a clear understanding of tool behavior.

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

Conciseness4/5

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

The description is long but well-structured with clear headings and sections. It front-loads the core purpose and then provides detailed guidance. While verbose, every section serves a purpose; however, some redundancy could be trimmed for brevity.

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?

Given the tool's complexity (7 parameters, no output schema, no annotations), the description is remarkably complete. It covers prompt crafting, iteration strategies, known issues, and error recovery. The 'Prompt guide' alone provides rich context that an agent needs to succeed.

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?

Although schema description coverage is 100%, the description adds substantial value beyond schema. The 'Prompt guide' provides concrete examples, do's and don'ts, and detailed reasoning for parameters like n and temperature. It also explains how references work and their limitations, which the schema does not fully convey.

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 clearly states 'Generate one or more SVGs from a text prompt using QuiverAI. Returns raw SVG markup.' It specifies the verb (generate), resource (SVGs), and distinguishes from sibling tools like list_models and vectorize_svg.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides extensive guidelines on when and how to use, including prompt structure, what works, what does not work, iteration strategy, and a verified template. It also covers known issues like corrupted tails and 504 errors, giving failure recovery guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/syntropicsignal-ai/quiver-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server