Skip to main content
Glama
recraft-ai

Recraft AI MCP Server

Official

vectorize_image

Convert an image into a scalable vector graphic (SVG) using Recraft AI. Input an image via URL or local path, and receive vectorized output with preview. Ideal for enhancing image quality and scalability.

Instructions

Vectorize an input image using Recraft. This operation takes an input image and returns a vector SVG image, close to it. Local path or URL to resulting image and its preview will be returned in the response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageURIYesImage to use as an input. This can be a URL (starting with http:// or https://) or an absolute file path (starting with file://).

Implementation Reference

  • The vectorizeImageHandler function that executes the tool logic: validates input, downloads image, calls the vectorizeImage API, handles result or error.
    export const vectorizeImageHandler = async (server: RecraftServer, args: Record<string, unknown>): Promise<CallToolResult> => {
      try {
        const { imageURI } = z.object({
          imageURI: z.string(),
        }).parse(args)
    
        const imageData = await downloadImage(imageURI)
    
        const result = await server.api.imageApi.vectorizeImage({
          image: await imageDataToBlob(imageData),
          responseFormat: 'url',
          expire: server.isLocalResultsStorage,
        })
    
        return await server.transformSingleImageOperationToCallToolResult(result.image, 'Vectorized given image.')
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Vectorization error: ${error}`
            }
          ],
          isError: true
        }
      }
    }
  • The tool definition including name, description, and inputSchema for validation (requires imageURI).
    export const vectorizeImageTool = {
      name: "vectorize_image",
      description: "Vectorize an input image using Recraft.\n" +
       "This operation takes an input image and returns a vector SVG image, close to it.\n" +
       "Local path or URL to resulting image and its preview will be returned in the response.",
      inputSchema: {
        type: "object",
        properties: {
          imageURI: PARAMETERS.imageURI,
        },
        required: ["imageURI"]
      }
    }
  • src/index.ts:68-82 (registration)
    Registration of the vectorizeImageTool in the ListToolsRequestHandler, including it in the list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          generateImageTool,
          createStyleTool,
          vectorizeImageTool,
          imageToImageTool,
          removeBackgroundTool,
          replaceBackgroundTool,
          crispUpscaleTool,
          creativeUpscaleTool,
          getUserTool,
        ],
      }
    })
  • src/index.ts:106-107 (registration)
    Dispatch registration in the CallToolRequestHandler switch statement, mapping vectorize_image tool calls to the handler.
    case vectorizeImageTool.name:
      return await vectorizeImageHandler(recraftServer, args ?? {})
  • src/index.ts:15-15 (registration)
    Import of the vectorizeImageTool and vectorizeImageHandler for use in the server.
    import { vectorizeImageHandler, vectorizeImageTool } from "./tools/VectorizeImage"
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the operation returns a vector SVG image and includes local path/URL outputs, which adds useful behavioral context beyond basic function. However, it lacks details on error handling, rate limits, or authentication needs, which are important for a tool that processes external resources.

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 appropriately sized with three sentences that are front-loaded with the core purpose. Each sentence adds value: the first defines the operation, the second clarifies the output, and the third details the response format, with minimal redundancy.

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

Completeness3/5

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

Given no annotations and no output schema, the description provides basic operational context but is incomplete. It explains what the tool does and the response format, yet lacks details on error cases, performance expectations, or integration with sibling tools, which would be helpful for an agent invoking this tool.

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 fully documents the 'imageURI' parameter. The description doesn't add any parameter-specific semantics beyond what the schema provides (e.g., no extra constraints or examples), meeting the baseline for high coverage.

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 action ('vectorize') and resource ('input image'), specifying it uses Recraft and produces a vector SVG image. It distinguishes from siblings like 'remove_background' or 'generate_image' by focusing on vectorization, though it doesn't explicitly contrast with all alternatives.

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?

No guidance is provided on when to use this tool versus alternatives like 'image_to_image' or 'creative_upscale'. The description mentions the operation but doesn't specify use cases, prerequisites, or exclusions, leaving the agent to infer context from sibling names alone.

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/recraft-ai/mcp-recraft-server'

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