# list_subagents

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/subagents/list_subagents)

List subagents from user and/or project directories.

Scans for subagent definitions in the provided directories.
Project subagents override user subagents with the same name.

## Signature

```python
list_subagents(
    *,
    user_agents_dir: Path | None = None,
    project_agents_dir: Path | None = None,
) -> list[SubagentMetadata]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `user_agents_dir` | `Path \| None` | No | Path to user-level agents directory. (default: `None`) |
| `project_agents_dir` | `Path \| None` | No | Path to project-level agents directory. (default: `None`) |

## Returns

`list[SubagentMetadata]`

List of subagent metadata, with project subagents taking precedence.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/3bcc51a95da80094cfc8bc4bcaf25dc1e2ad8f44/libs/cli/deepagents_cli/subagents.py#L146)