# Mastra.getEditor()

The `.getEditor()` method is used to retrieve the editor instance that has been configured on the Mastra instance. The editor exposes CRUD namespaces for managing stored agents, prompt blocks, MCP clients, scorers, skills, and workspaces programmatically.

## Usage example

```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.',
})
```

## Parameters

This method doesn't accept any parameters.

## Returns

**editor** (`MastraEditor | undefined`): The configured editor instance, or undefined if no editor has been configured.

## Related

- [Editor overview](https://mastra.ai/docs/editor/overview)
- [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor)