createNotificationInboxTool()
추가된 항목: @mastra/core@1.39.0
createNotificationInboxTool()Agent가 현재 스레드에 대한 알림 받은 편지함 기록을 검사하고 관리할 수 있는 Mastra Tool을 만듭니다.
내구성 있는 알림 신호와 함께 이 Tool을 사용하세요. 알림 기록 전송에 대해서는 다음을 참조하세요.Agent.sendNotificationSignal().
사용예사용예에 대한 직접 링크
다음 예에서는 Agent에 받은 편지함 Tool을 추가합니다.
src/mastra/agents/support-agent.ts
import { Agent } from '@mastra/core/agent'
import { createNotificationInboxTool } from '@mastra/core/notifications'
const notificationsStorage = await storage.getStore('notifications')
export const supportAgent = new Agent({
id: 'support-agent',
name: 'Support Agent',
instructions: 'Help the user triage updates.',
model: 'openai/gpt-5.6-sol',
tools: {
notificationInbox: createNotificationInboxTool({ storage: notificationsStorage }),
},
})
매개변수매개변수에 대한 직접 링크
options:
object
Tool 구성입니다.
object
storage:
NotificationsStorage
storage.getStore('notifications')가 반환한 알림 저장소 도메인입니다.Tool 입력Tool 입력에 대한 직접 링크
생성된 Tool의 ID는 notification-inbox이며 다음 입력 필드를 허용합니다.
action:
'list' | 'read' | 'markSeen' | 'dismiss' | 'archive' | 'search'
수행할 받은 편지함 작업입니다.
threadId?:
string
검사할 스레드 ID입니다. 사용할 수 있으면 현재 Agent 스레드가 기본값입니다.
id?:
string
알림 ID입니다.
markSeen, dismiss, archive에는 필수이며 read에는 선택 사항입니다.status?:
'pending' | 'delivered' | 'seen' | 'dismissed' | 'archived' | 'discarded'
나열, 읽기 또는 검색 작업에 사용할 상태 필터입니다.
priority?:
'low' | 'medium' | 'high' | 'urgent'
나열, 읽기 또는 검색 작업에 사용할 우선순위 필터입니다.
source?:
string
나열, 읽기 또는 검색 작업에 사용할 소스 필터입니다.
query?:
string
검색 쿼리입니다.
action이 search이면 필수입니다.limit?:
number
반환할 최대 알림 수입니다. 양의 정수여야 합니다.
행위행위에 대한 직접 링크
| 작업 | 설명 |
|---|---|
list | 일치하는 알림을 반환합니다. |
read | 읽을 수 있는 알림 내용을 신호로 전달하고, 전달된 레코드를 확인한 것으로 표시합니다. |
markSeen | 알림 하나를 확인한 것으로 표시합니다. |
dismiss | 알림 하나를 해제된 것으로 표시합니다. |
archive | 알림 하나를 보관된 것으로 표시합니다. |
search | 쿼리와 선택적 필터로 알림을 검색합니다. |
read가 대기 중이거나 전달된 알림을 찾으면 Tool은 전체 내용을 일반 Tool 출력으로 반환하는 대신 알림 신호로 전달합니다. Agent가 <notification-summary> 신호에 요약된 전체 레코드를 확인해야 할 때 사용하세요. |