Create a code block (FigJam)
figma_create_code_blockCreate a syntax-highlighted code block in FigJam to document source snippets, specify the language, and position it on the page or inside a frame.
Instructions
A FigJam code block with syntax highlighting. language (case-insensitive): typescript, javascript, python, go, rust, ruby, css, html, json, graphql, sql, swift, kotlin, cpp, bash, plaintext, dart — dart is in the Plugin API but not yet confirmed on the canvas. Default plaintext; any other value is refused rather than shown as plain text, so ask for plaintext yourself. FigJam styles it: no theme, font or size to set. Editors: FigJam only, unverified.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Left edge, in the parent's coordinates. Default: below what the parent holds; on the page, right of its content. | |
| y | No | Top edge, in the parent's coordinates. | |
| code | Yes | The code. | |
| name | No | Layer name. | |
| session | No | Optional sessionId or file name, to pick a Figma file when more than one is connected. | |
| language | No | typescript, javascript, python, go, rust, ruby, css, html, json, graphql, sql, swift, kotlin, cpp, bash, plaintext, dart. Default plaintext. | |
| parentId | No | A section or frame to put it in (id or Figma link). Default: the current page. | |
| idempotencyKey | No | Caller-owned retry key, ≤128 chars. Re-calling with the same key never executes twice: it returns the existing result, or waits for the op still in flight. Supply your own for anything large — if the MCP client times out (rather than the bridge), only a key you chose can be used to retry safely. |