Skip to main content
Glama
awkoy

replicate-flux-mcp

generate_svg

Convert text prompts into scalable SVG images with customizable styles and sizes using the Recraft model via the replicate-flux-mcp server.

Instructions

Generate an SVG from a text prompt using Recraft model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesPrompt for generated SVG
sizeNoSize of the generated SVG1024x1024
styleNoStyle of the generated image.any

Implementation Reference

  • The main handler function that calls the Replicate API to generate SVG using the provided input parameters, processes the output URL to SVG, and returns the result in MCP format.
    export const registerGenerateSvgTool = async (
      input: SvgGenerationParams
    ): Promise<CallToolResult> => {
      try {
        const output = (await replicate.run(CONFIG.svgModelId, {
          input,
        })) as FileOutput;
    
        const svgUrl = output.url() as unknown as string;
        if (!svgUrl) {
          throw new Error("Failed to generate SVG URL");
        }
    
        try {
          const svg = await urlToSvg(svgUrl);
    
          return {
            content: [
              {
                type: "text",
                text: `This is a generated SVG url: ${svgUrl}`,
              },
              {
                type: "text",
                text: svg,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `This is a generated SVG url: ${svgUrl}`,
              },
            ],
          };
        }
      } catch (error) {
        return handleError(error);
      }
    };
  • Registers the 'generate_svg' tool with the server, associating the tool name, description, input schema, and handler function.
      "generate_svg",
      "Generate an SVG from a text prompt using Recraft model",
      svgGenerationSchema,
      registerGenerateSvgTool
    );
  • Zod schema defining the input parameters for the generate_svg tool: prompt, size (with enum of dimensions), and style (with enum options).
    export const svgGenerationSchema = {
      prompt: z.string().min(1).describe("Prompt for generated SVG"),
      size: z
        .enum([
          "1024x1024",
          "1365x1024",
          "1024x1365",
          "1536x1024",
          "1024x1536",
          "1820x1024",
          "1024x1820",
          "1024x2048",
          "2048x1024",
          "1434x1024",
          "1024x1434",
          "1024x1280",
          "1280x1024",
          "1024x1707",
          "1707x1024",
        ])
        .default("1024x1024")
        .describe("Size of the generated SVG"),
      style: z
        .enum(["any", "engraving", "line_art", "line_circuit", "linocut"])
        .default("any")
        .describe("Style of the generated image."),
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't mention rate limits, authentication requirements, whether it's a read-only or mutation operation, what happens on failure, or what the output format looks like. For a generative tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

The description is a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a straightforward generation tool and front-loads the essential information.

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

Completeness2/5

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

For a generative tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns (SVG data, URL, file path?), error conditions, rate limits, or authentication requirements. The schema handles parameters well, but the overall context for proper tool invocation is incomplete.

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 documents all three parameters thoroughly with descriptions, enums, and defaults. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in description.

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 clearly states the verb 'generate' and resource 'SVG', specifying it uses the Recraft model from a text prompt. It distinguishes from sibling tools like 'generate_image' by specifying SVG format rather than general images. However, it doesn't explicitly differentiate from other SVG-related tools (none exist among siblings), so it's not a perfect 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'generate_image' or 'generate_multiple_images'. It doesn't mention use cases, prerequisites, or exclusions. The only contextual clue is 'using Recraft model', which doesn't help with sibling tool selection.

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

Related 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/awkoy/replicate-flux-mcp'

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