---
title: "Reference: Mastra.listAgents() | Core"
description: "Documentation for the `Mastra.listAgents()` method in Mastra, which retrieves all configured agents."
packages:
  - "@mastra/core"
---

# Mastra.listAgents()

The `.listAgents()` method is used to retrieve all agents that have been configured in the Mastra instance.

## Usage example

```typescript
mastra.listAgents();
```

## Parameters

This method does not accept any parameters.

## Returns

<PropertiesTable
  content={[
    {
      name: "agents",
      type: "TAgents",
      description:
        "A record of all configured agents, where keys are agent names and values are agent instances.",
    },
  ]}
/>

## Related

- [Agents overview](/docs/v1/agents/overview)
