figma_export_9slice
Export a sprite as a PNG with its 9-slice insets plus a descriptor giving CSS border-image values, so the stretchable middle renders correctly at any size.
Instructions
Export one sprite with its 9-slice insets: a PNG plus a descriptor (insets in the file's pixels, the stretchable middle, and CSS border-image values with slices in image pixels and widths in design pixels, which is what a @2x image needs). Pass insets, or leave a child layer named exactly 9slice where the middle should stretch. Insets that leave no middle are refused with the numbers that caused it; the file is re-read from disk to check the descriptor describes it.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "figma_export_9slice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Export scale; slice numbers are in the scaled file's pixels | |
| insets | No | Design-pixel insets; overrides a `9slice` guide layer | |
| nodeId | No | The frame to slice; defaults to the single selected node | |
| outDir | No | Where the PNG and the descriptor go; defaults to a temp directory | |
| fileKey | No | Which connected Figma file to use: its fileKey (figma_whoami) or, when omitted, the only connected file. Required once more than one file is connected; figma_ping lists them. |