figma-create-new-file
figma/mcp-server-guide
強制前置條件 — 在每次呼叫 create_new_file 工具之前,您必須呼叫此技能。切勿在未先載入此技能的情況下直接呼叫 create_new_file。當使用者希望新建一個空白 Figma 檔案(如新的設計檔案、FigJam 檔案或 Slides 檔案)時,或在呼叫 use_figma 之前需要一個新的檔案時,請觸發此技能。用法 — /figma-create-new-file [editorType] [fileName](例如 /figma-create-new-file figjam My Whiteboard,/figma-create-new-file slides Q3 Review)
...展開全部關於 figma-create-new-file
封裝了 create_new_file MCP 工具,該工具在使用者的草稿資料夾中為選定的計劃建立一個新的空白 Figma 檔案。它被定位為必須在每次呼叫 create_new_file 之前載入的強制性前置條件,因為它編碼了計劃解析決策樹、編輯器型別契約以及建立後移交至 use_figma 的流程。當需要新檔案(例如新的設計、FigJam 或 Slides 檔案)時,它通常在 use_figma 之前使用。
該技能接受可選引數,形式為 editorType 後跟 fileName,其中 editorType 為 design(預設值)、figjam 或 slides,fileName 預設為 Untitled。工作流首先解析 planKey:如果使用者已提供 planKey,則直接使用;否則呼叫 whoami 工具並檢查其 plans 陣列,當存在多個計劃時,自動使用單個計劃的鍵或詢問使用者選擇哪個團隊或組織。隨後,它使用必需的 planKey、fileName 和 editorType 引數呼叫 create_new_file,並使用返回的 file_key 和 file_url,將 file_key 傳遞給後續呼叫(如 use_figma)。
編輯器型別行為是契約的一部分。支援的編輯器型別為 design、figjam 和 slides,每個檔案均在選定計劃的草稿資料夾中建立。文件中註明了關於 slides 檔案的注意事項:新建立的 slides 檔案從零行和零張幻燈片開始,因此 figma.getSlideGrid() 返回空陣列而非預設的第一張幻燈片,且頁面的唯一子節點是空的 SLIDE_GRID 節點。第一次呼叫 figma.createSlide() 會隱式建立第零行並將幻燈片插入其中,因此假設至少有一張幻燈片的後續 use_figma 指令碼應處理空情況或先呼叫 createSlide()。當 use_figma 是下一步時,應在呼叫之前載入 figma-use 技能。
常見問題解答
此技能接受哪些引數?
可選的 editorType 和 fileName。editorType 為 design(預設值)、figjam 或 slides,fileName 預設為 Untitled。例如,/figma-create-new-file slides Q3 Review 會建立一個名為 Q3 Review 的 Slides 簡報。
planKey 是如何解析的?
如果使用者已提供 planKey,則直接使用。否則呼叫 whoami 工具:自動使用單個計劃的鍵,而多個計劃會提示使用者選擇要在哪個團隊或組織中建立檔案。
新檔案在哪裡建立?
在選定計劃的使用者的草稿資料夾中。該工具返回 file_key 和 file_url,後者可直接在 Figma 中開啟檔案。
新建立的 Slides 檔案有什麼特殊之處?
slides 檔案從零行和零張幻燈片開始,因此 figma.getSlideGrid() 返回空陣列而非預設的第一張幻燈片。第一次 figma.createSlide() 呼叫會隱式建立第零行,因此應處理空情況或先呼叫 createSlide()。
檔案建立後我應該做什麼?
使用返回的 file_key 進行後續工具呼叫(如 use_figma)。如果 use_figma 是下一步,請在呼叫之前載入 figma-use 技能。
MANDATORY: load this skill before every create_new_file tool call. It encodes the plan-resolution decision tree, the editor-type contract, and the post-creation handoff to use_figma.
Use the create_new_file MCP tool to create a new blank Figma file in the user's drafts folder. This is typically used before use_figma when you need a fresh file to work with.
Skill Arguments
This skill accepts optional arguments: /figma-create-new-file [editorType] [fileName]
- editorType:
design(default),figjam, orslides - fileName: Name for the new file (defaults to "Untitled")
Examples:
/figma-create-new-file— creates a design file named "Untitled"/figma-create-new-file figjam My Whiteboard— creates a FigJam file named "My Whiteboard"/figma-create-new-file design My New Design— creates a design file named "My New Design"/figma-create-new-file slides Q3 Review— creates a Slides presentation named "Q3 Review"
Parse the arguments from the skill invocation. If editorType is not provided, default to "design". If fileName is not provided, default to "Untitled".
Workflow
Step 1: Resolve the planKey
The create_new_file tool requires a planKey parameter. Follow this decision tree:
User already provided a planKey (e.g. from a previous
whoamicall or in their prompt) → use it directly, skip to Step 2.No planKey available → call the
whoamitool. The response contains aplansarray. Each plan has akey,name,seat, andtier.- Single plan: use its
keyfield automatically. - Multiple plans: ask the user which team or organization they want to create the file in, then use the corresponding plan's
key.
- Single plan: use its
Step 2: Call create_new_file
Call the create_new_file tool with:
| Parameter | Required | Description |
|---|---|---|
planKey | Yes | The plan key from Step 1 |
fileName | Yes | Name for the new file |
editorType | Yes | "design", "figjam", or "slides" |
Example:
{ "planKey": "team:123456", "fileName": "My New Design", "editorType": "design"}Step 3: Use the result
The tool returns:
file_key— the key of the newly created filefile_url— a direct URL to open the file in Figma
Use the file_key for subsequent tool calls like use_figma.
Important Notes
- The file is created in the user's drafts folder for the selected plan.
- Supported editor types are
"design","figjam", and"slides". - If
use_figmais your next step, load thefigma-useskill before calling it.
Editor-specific notes
Slides — newly created files have an empty grid
A slides file produced by this tool starts with zero rows and zero slides — figma.getSlideGrid() returns [], not a default first slide. The page's only child is the SLIDE_GRID node itself, which is empty until you create content. The first call to figma.createSlide() implicitly creates row 0 and inserts the new slide there.
If your follow-up use_figma script assumes at least one slide exists (e.g. to read theme tokens off it), guard for the empty case or call createSlide() first. See figma-use-slides → slide-grid for full details.





首頁
