> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-TW/llms.txt # Mastra.getEditor() `.getEditor()` 方法用於取得 Mastra 執行個體中已設定的 Editor 執行個體。Editor 提供 CRUD 命名空間,可透過程式化方式管理已儲存的 Agent、prompt block、MCP client、Scorer、Skill 和 Workspace。 ## 使用範例 ```typescript import { Mastra } from '@mastra/core' import { MastraEditor } from '@mastra/editor' const mastra = new Mastra({ editor: new MastraEditor(), }) const editor = mastra.getEditor() const agent = await editor?.agent.create({ id: 'support-agent', name: 'Support Agent', instructions: 'Help customers with their questions.', }) ``` ## 參數 此方法不接受任何參數。 ## 傳回值 **editor** (`MastraEditor | undefined`): 已設定的 editor 執行個體;如果未設定 editor,則為 undefined。 ## 相關內容 - [Editor](https://mastra.zisheng.pro/zh-TW/docs/editor/overview) - [MastraEditor 參考](https://mastra.zisheng.pro/zh-TW/reference/editor/mastra-editor)