@mastra/core
Version:
55 lines (38 loc) • 1.52 kB
Markdown
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
Returns metadata for all skills available to the agent, including both agent-level and workspace skills.
```typescript
import { agent } from '../mastra/agents'
const skills = await agent.listSkills()
for (const skill of skills) {
console.log(`${skill.name}: ${skill.description}`)
}
```
**options** (`object`): Options for skill resolution.
**options.requestContext** (`RequestContext`): Request context passed to dynamic skill resolvers.
Returns `Promise<SkillMetadata[]>`.
Each entry contains the metadata for a discovered skill:
```typescript
interface SkillMetadata {
name: string
description: string
path: string
source: { type: string; projectPath: string }
references: string[]
scripts: string[]
assets: string[]
license?: string
compatibility?: string[]
'user-invocable'?: boolean
metadata?: Record<string, unknown>
}
```
When both agent-level skills and workspace skills are configured, `.listSkills()` returns the merged set. Agent-level skills take precedence on name conflicts — if both define a skill named `code-review`, only the agent-level version appears in the result.
- [Agent skills](https://mastra.ai/docs/agents/skills)
- [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill)
- [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)