Skip to content

Function: listThreads()

listThreads(opts): Promise<{ hasMore: boolean; page: number; perPage: number; threads: object[]; total: number; }>

Fetch a page of the resource’s conversation threads, newest (updatedAt DESC) first.

Uses the agent’s resolved Memory (getMemory()) so the per-agent storage namespace (mastra_<agentId> schema) applies automatically. When the agent has no memory configured the response is a successful empty page so callers don’t have to special-case stateless agents.

ListThreadsOptions

Promise<{ hasMore: boolean; page: number; perPage: number; threads: object[]; total: number; }>