set_svg_vector
Inserts or updates SVG vectors in Figma by providing SVG content, coordinates, and optional attributes. Supports single or batch configurations via raw text or URLs, returning node IDs for inserted vectors.
Instructions
Sets or inserts one or more SVG vectors in Figma. Accepts either a single SVG config (via 'svg') or an array of configs (via 'svgs').
Returns:
content: Array of objects. Each object contains a type: "text" and a text field with the inserted SVG vector node ID(s).
Input Schema
Name | Required | Description | Default |
---|---|---|---|
svg | No | A single SVG vector configuration. Optional. | |
svgs | No | An array of SVG vector configurations for batch insertion. Optional. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"svg": {
"additionalProperties": false,
"description": "A single SVG vector configuration. Optional.",
"properties": {
"name": {
"description": "Optional. Name for the SVG node. If provided, must be a non-empty string up to 100 characters.",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"parentId": {
"description": "Optional. Figma node ID of the parent. If provided, must be a string in the format '123:456'.",
"type": "string"
},
"svg": {
"description": "The SVG content (raw SVG text or URL). Must be a non-empty string up to 100,000 characters.",
"maxLength": 100000,
"minLength": 1,
"type": "string"
},
"x": {
"default": 0,
"description": "Optional. X coordinate for the SVG. Must be between -10,000 and 10,000. Defaults to 0.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
},
"y": {
"default": 0,
"description": "Optional. Y coordinate for the SVG. Must be between -10,000 and 10,000. Defaults to 0.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
}
},
"required": [
"svg"
],
"type": "object"
},
"svgs": {
"description": "An array of SVG vector configurations for batch insertion. Optional.",
"items": {
"additionalProperties": false,
"properties": {
"name": {
"description": "Optional. Name for the SVG node. If provided, must be a non-empty string up to 100 characters.",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"parentId": {
"description": "Optional. Figma node ID of the parent. If provided, must be a string in the format '123:456'.",
"type": "string"
},
"svg": {
"description": "The SVG content (raw SVG text or URL). Must be a non-empty string up to 100,000 characters.",
"maxLength": 100000,
"minLength": 1,
"type": "string"
},
"x": {
"default": 0,
"description": "Optional. X coordinate for the SVG. Must be between -10,000 and 10,000. Defaults to 0.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
},
"y": {
"default": 0,
"description": "Optional. Y coordinate for the SVG. Must be between -10,000 and 10,000. Defaults to 0.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
}
},
"required": [
"svg"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}