> Discover all available pages from the documentation index: https://mastra.zisheng.pro/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/docs/editor/overview) - [MastraEditor 参考](https://mastra.zisheng.pro/reference/editor/mastra-editor)