.listSkills()
Returns metadata for all skills available to the agent, including both agent-level and workspace skills.
Usage exampleDirect link to Usage example
src/routes/skills.ts
import { agent } from '../mastra/agents'
const skills = await agent.listSkills()
for (const skill of skills) {
console.log(`${skill.name}: ${skill.description}`)
}
ParametersDirect link to Parameters
options?:
object
Options for skill resolution.
object
requestContext?:
RequestContext
Request context passed to dynamic skill resolvers.
Return valueDirect link to Return value
Returns Promise<SkillMetadata[]>.
Each entry contains the metadata for a discovered skill:
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>
}
Merging behaviorDirect link to Merging behavior
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.