content 陣列的 MCP 內容區塊。文字工具傳回 { type: "text", text: "<json-string>" }。影像工具傳回 { type: "image", data: "<base64>", mimeType: "image/png" }。失敗時,設定 isError: true,文字區塊包含錯誤訊息。
檔案工具
list-files
列出現行使用者的 Flowstep 檔案。
輸入
輸出 — 檔案物件的 JSON 陣列。
get-file
按 ID 取得單一檔案。檔案內容有意省略 — 使用 get-screen 或 get-screen-image 檢查畫面,使用 get-design-guidelines 取得附加的指南。
輸入
輸出 — JSON 檔案物件。
create-file
建立新的 Flowstep 檔案。
輸入
輸出 — 帶有新檔案
id 的 JSON 檔案物件。
id 作為後續工具呼叫中的 fileId。
update-file
重新命名檔案。
輸入
輸出 — 與
get-file 相同形狀的更新檔案物件。
delete-file
永久刪除檔案。你傳遞的 name 會在刪除前驗證為對比檔案的實際名稱 — 如果不相符,刪除會被中止。這防止意外刪除錯誤的檔案。
輸入
輸出 —
"File deleted successfully"
畫面工具
list-screens
列出檔案的所有產生畫面。使用返回的 screenId 值在 get-screen、get-screen-image、upload-attachment 中參考畫面,以及在 edit-design、regenerate-design 或 expand-design 中作為 targets。
輸入
輸出 — 畫面摘要的 JSON 陣列。
name 是使用者指定的畫面名稱,或 null(如果未命名)。
get-screen
取得畫面的 JSX 代碼,允許你編輯或在 Flowstep 外部使用代碼。改用 get-screen-image 取得視覺預覽。
輸入
輸出 — 畫面代碼(JSX)。注意第一行註解,在使用
add-screen 工具時需要。
add-screen
從原始 JSX 字串將新畫面新增至 Flowstep 檔案。
輸入
注意 - 類似下面的註解必須出現在 JSX 的第一行,因為它用於正確新增畫面。
screenType、name 和 screenId 都是選用的 — 如果存在(例如當傳遞從 get-screen 輸出複製的 JSX 時),會使用 screenId(內部),但非強制。畫面名稱取自註解的 name 欄位(顯示為”<name> 的副本”),或如果不存在則為”Untitled”。
<!-- screenType: "iphone-x-vertical" width: "375" height: "812" name: "Change to a light theme" colorTheme: "blue" -->
輸出 — 新增畫面的 ID。
get-screen-image
將畫面呈現為 PNG 並作為內聯影像傳回。需要支援影像內容區塊的客戶端。
輸入
輸出 — MCP 影像內容區塊 (
image/png)。
AI 工具
create-new-design
從文字提示詞產生一或多個畫面設計。省略 fileId 以自動建立新檔案。區塊直到產生完成或逾時(180 秒)。
輸入
輸出 —
{ fileId, screenIds }。將每個 screenId 傳遞到 get-screen-image 以查看結果。
regenerate-design
從頭或使用風格變體重新製作現有畫面。在 targets 中至少需要一個 screenId。區塊直到產生完成或逾時(180 秒)。
輸入
輸出 —
{ fileId, screenIds }。將每個 screenId 傳遞到 get-screen-image 以查看結果。
expand-design
將後續畫面新增至現有設計。在 targets 中至少需要一個 screenId 和強制 operationVariant。區塊直到產生完成或逾時(180 秒)。
輸入
輸出 —
{ fileId, screenIds }。將每個 screenId 傳遞到 get-screen-image 以查看結果。
edit-design
透過提示詞修改現有畫面。在 targets 中至少需要一個 screenId。區塊直到產生完成或逾時(180 秒)。
輸入
輸出 —
{ fileId, screenIds }。將每個 screenId 傳遞到 get-screen-image 以查看結果。
upload-attachment
上傳檔案以在 create-new-design 或 edit-design 中用作附件。傳回 { id, path, type, mimeType } — 直接將此物件傳遞到 attachments 陣列。
兩種模式:
模式 1 — 按 ID 的畫面
傳遞 screenId 和 fileId。伺服器從資料庫提取畫面狀態並將其呈現為影像。
模式 2 — 外部檔案
直接傳遞檔案內容。二進位檔案必須經過 base64 編碼;文字檔案(包括原始程式碼)作為純 UTF-8 字串傳遞。
最大檔案大小:3 MB。對於大型影像,偏好
image/jpeg 勝於 image/png。
輸出
type 針對影像/PDF 上傳是 "image",針對文字/代碼檔案是 "document"。
聊天工具
get-chat-history
取得檔案的聊天訊息歷史記錄。
輸入
輸出 — 含
messages 陣列的 JSON 物件。每條訊息有 type("request" 或 "response")、author("human" 或 "ai")和 content_type("text"、"summary" 或 "followup")。
設計工具
get-design-guidelines
取得為檔案儲存的設計指南。
輸入
輸出
guidelines 是 null。
update-design-guidelines
設定或替換檔案的設計指南。指南以 Google 的 design.md 格式作為純文字字串傳遞 — 不要傳遞物件或 JSON。
伺服器執行軟驗證,可能在回應中傳回列出問題(未知金鑰、非十六進位顏色)的 Warnings: 區段,這些問題已被接受但可能被 AI 忽略。向使用者表示這些。
輸入
驗證規則
- Frontmatter 必須正確開啟和關閉
- Frontmatter 行必須是有效的區塊樣式 YAML
- Markdown 正文必須不包含重複的
##區段標題
"Design guidelines updated successfully",可選後跟 Warnings: 區段。
delete-design-guidelines
清除檔案的設計指南。
輸入
輸出 —
"Design guidelines deleted successfully"
Figma 工具
import-figma
將 Figma 畫面匯入 Flowstep 檔案作為其畫布上的可編輯元素。重新匯入同一個畫面會就地更新它。檔案的組織必須在 Flowstep 設定中已連接 Figma。
輸入
輸出 —
{ fileId, screenId }。screenId 是匯入畫面元素的 ID — 將其傳遞到 get-screen-image 以查看結果。當頁面 URL 匯入多個畫面時,screenId 是 null,而改為傳回 frameCount。