createNotificationInboxTool()
Added in: @mastra/core@1.39.0
Breaking changes may occur without a major version bump until the API is stable.
createNotificationInboxTool() creates a Mastra tool that lets an agent inspect and manage notification inbox records for the current thread.
Use this tool with durable notification signals. For sending notification records, see Agent.sendNotificationSignal().
Usage exampleDirect link to Usage example
The following example adds the inbox tool to an agent.
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 }),
},
})
ParametersDirect link to Parameters
options:
storage:
storage.getStore('notifications').Tool inputDirect link to Tool input
The generated tool has the id notification-inbox and accepts these input fields.
action:
threadId?:
id?:
markSeen, dismiss, and archive. Optional for read.status?:
priority?:
source?:
query?:
action is search.limit?:
ActionsDirect link to Actions
| Action | Description |
|---|---|
list | Returns matching notifications. |
read | Delivers readable notification contents as signals and marks delivered records as seen. |
markSeen | Marks one notification as seen. |
dismiss | Marks one notification as dismissed. |
archive | Marks one notification as archived. |
search | Searches notifications by query and optional filters. |
When read finds pending or delivered notifications, the tool delivers their contents as notification signals instead of returning the full contents as normal tool output. Use this after a <notification-summary> signal when the agent needs the full records behind the summary.