figma_insert_svg
Insert raw SVG/vector code into a Figma canvas or AutoLayout container with resizing, color overrides, optional components, and PNG capture.
Instructions
Insert raw SVG/vector code directly into Figma canvas or target AutoLayout container with automatic scale-proportional resizing, fill/stroke color overrides, optional component creation, and an optional PNG screenshot (capture: true).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"svg_code": "<svg_code>"
},
"name": "figma_insert_svg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional layer name for the created SVG node (e.g. 'Icon / Shield', 'Brand / Google') | |
| scale | No | Screenshot resolution scale factor (default: 2.0) | |
| width | No | Desired width in pixels (e.g. 24, 32, 48) | |
| height | No | Desired height in pixels (e.g. 24, 32, 48) | |
| target | No | fileName of a specific connected Figma document, when more than one is open (see figma_list_targets). | |
| capture | No | Whether to capture and return a PNG screenshot of the inserted SVG (default: false) | |
| position | No | Optional placement coordinates or child index in AutoLayout container | |
| svg_code | Yes | Raw XML/SVG string (e.g. '<svg xmlns="..." viewBox="0 0 24 24">...</svg>') | |
| as_component | No | Whether to wrap the resulting SVG node into a reusable master ComponentNode (default: false) | |
| fill_override | No | Specific fill color override (Hex e.g. '#FFFFFF' or RGB) applied to vector shapes with non-empty fills | |
| color_override | No | Universal color override (Hex '#6366F1' or RGB) applied to all active fills and strokes | |
| stroke_override | No | Specific stroke color override (Hex e.g. '#6366F1' or RGB) applied to vector paths with non-empty strokes | |
| target_parent_id | No | Target container/frame node ID to insert the SVG into. If omitted, inserts into current selected frame or active page. |