Skip to main content
Glama
Figma Local Bridge

Figma Local Bridge

by Miart

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

NameRequiredDescriptionDefault
scaleNoExport scale; slice numbers are in the scaled file's pixels
insetsNoDesign-pixel insets; overrides a `9slice` guide layer
nodeIdNoThe frame to slice; defaults to the single selected node
outDirNoWhere the PNG and the descriptor go; defaults to a temp directory
fileKeyNoWhich 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.36.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden and does substantial work: it states that degenerate insets are refused with the offending numbers, that the file is re-read from disk to validate the descriptor, and that the descriptor carries CSS `border-image` values split into image pixels and design pixels. It does not cover write scope (files created on disk), permissions/auth, or overwrite behavior when outDir already contains output.

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?

Three sentences, front-loaded with what comes out, followed by the two input modes and the failure mode. The parenthetical about pixel units is dense but earns its place by resolving a units ambiguity; the guard clause about re-reading from disk is the only sentence that could be trimmed.

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

Completeness4/5

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

With no output schema, the description compensates by describing the descriptor's contents (insets, stretchable middle, border-image values in two unit systems), which is what an agent needs to use the result. Five parameters with a nested insets object and disk side effects are mostly covered, though the naming/location of the emitted descriptor file and overwrite semantics remain unspecified.

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 coverage is 100%, so every parameter is already documented in the schema, including the insets-override-guide-layer relationship and the scale-to-pixel mapping. The description adds only the practical nuance that the CSS slices are image pixels while widths are design pixels; the rest restates structured information, so the baseline 3 applies.

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 opens with a concrete verb and resource plus the exact artifact pair produced: 'Export one sprite with its 9-slice insets: a PNG plus a descriptor.' The 9-slice framing makes it distinguishable from the other figma_export_* siblings by resource alone, but it never names an alternative export tool, so the differentiation is implicit rather than stated.

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

Usage Guidelines4/5

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

It clearly tells the agent the two mutually exclusive ways to supply insets ('Pass insets, or leave a child layer named exactly `9slice`') and notes that explicit insets take precedence. What it lacks is a when-to-use statement relative to sibling exporters such as figma_export_ui_atlas, and any note on when 9-slice export is inappropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.