@mastra/mcp-docs-server 1.2.7-alpha.10 → 1.2.7-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agent-builder/overview.md +3 -4
- package/.docs/docs/agent-builder/skill-registries.md +3 -1
- package/.docs/docs/agent-controller/overview.md +2 -3
- package/.docs/docs/agent-controller/session.md +3 -1
- package/.docs/docs/agents/a2a.md +1 -2
- package/.docs/docs/agents/channels.md +225 -0
- package/.docs/docs/agents/code-mode.md +1 -1
- package/.docs/docs/agents/file-based-agents.md +297 -0
- package/.docs/docs/agents/guardrails.md +9 -10
- package/.docs/docs/agents/overview.md +4 -4
- package/.docs/docs/agents/skills.md +5 -3
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +4 -3
- package/.docs/docs/agents/using-tools.md +4 -2
- package/.docs/docs/browser/agent-browser.md +3 -1
- package/.docs/docs/browser/browser-viewer.md +3 -1
- package/.docs/docs/browser/overview.md +1 -2
- package/.docs/docs/browser/stagehand.md +1 -1
- package/.docs/docs/deployment/mastra-server.md +4 -2
- package/.docs/docs/editor/overview.md +6 -2
- package/.docs/docs/editor/prompts.md +1 -1
- package/.docs/docs/editor/tools.md +3 -1
- package/.docs/docs/evals/custom-scorers.md +3 -1
- package/.docs/docs/evals/datasets/overview.md +5 -4
- package/.docs/docs/evals/datasets/running-experiments.md +2 -4
- package/.docs/docs/evals/evals-with-memory.md +3 -1
- package/.docs/docs/evals/gates-and-verdicts.md +3 -1
- package/.docs/docs/evals/overview.md +1 -4
- package/.docs/docs/evals/quick-checks.md +3 -1
- package/.docs/docs/long-running-agents/background-tasks.md +1 -1
- package/.docs/docs/long-running-agents/durable-agents.md +5 -3
- package/.docs/docs/long-running-agents/goals.md +3 -1
- package/.docs/docs/long-running-agents/signal-providers.md +3 -1
- package/.docs/docs/long-running-agents/signals.md +22 -11
- package/.docs/docs/mastra-platform/observability.md +1 -5
- package/.docs/docs/mcp/mcp-apps.md +3 -3
- package/.docs/docs/mcp/overview.md +10 -6
- package/.docs/docs/memory/observational-memory.md +1 -2
- package/.docs/docs/memory/overview.md +4 -6
- package/.docs/docs/memory/semantic-recall.md +1 -1
- package/.docs/docs/memory/working-memory.md +3 -3
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +3 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/tracing/overview.md +1 -1
- package/.docs/docs/server/auth/auth0.md +1 -1
- package/.docs/docs/server/auth/better-auth.md +2 -2
- package/.docs/docs/server/auth/clerk.md +1 -1
- package/.docs/docs/server/auth/firebase.md +1 -1
- package/.docs/docs/server/auth/google.md +2 -2
- package/.docs/docs/server/auth/jwt.md +2 -2
- package/.docs/docs/server/auth/okta.md +2 -2
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +4 -4
- package/.docs/docs/server/server-adapters.md +8 -8
- package/.docs/docs/studio/auth.md +3 -1
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/voice/livekit.md +3 -100
- package/.docs/docs/workflows/agents-and-tools.md +5 -3
- package/.docs/docs/workflows/control-flow.md +3 -1
- package/.docs/docs/workflows/overview.md +7 -6
- package/.docs/docs/workspace/overview.md +1 -2
- package/.docs/docs/workspace/sandbox.md +0 -2
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/overview.md +1 -1
- package/.docs/guides/concepts/streaming.md +3 -3
- package/.docs/guides/getting-started/quickstart.md +1 -3
- package/.docs/guides/guide/chef-michel.md +2 -0
- package/.docs/guides/guide/slack-assistant.md +2 -2
- package/.docs/guides/guide/stock-agent.md +2 -0
- package/.docs/models/environment-variables.md +0 -3
- package/.docs/models/gateways/netlify.md +1 -4
- package/.docs/models/gateways/openrouter.md +6 -10
- package/.docs/models/gateways/vercel.md +1 -7
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/google.md +1 -2
- package/.docs/models/providers/llmgateway.md +181 -184
- package/.docs/models/providers/nano-gpt.md +2 -2
- package/.docs/models/providers/neon.md +29 -40
- package/.docs/models/providers/openai.md +1 -5
- package/.docs/models/providers/opencode.md +1 -2
- package/.docs/models/providers/poolside.md +5 -6
- package/.docs/models/providers/routing-run.md +34 -20
- package/.docs/models/providers/the-grid-ai.md +3 -3
- package/.docs/models/providers/wandb.md +14 -21
- package/.docs/models/providers/xai.md +1 -2
- package/.docs/models/providers.md +0 -3
- package/.docs/reference/agents/channels.md +2 -2
- package/.docs/reference/channels/channel-provider.md +1 -1
- package/.docs/reference/channels/slack-provider.md +2 -2
- package/.docs/reference/cli/mastra.md +10 -117
- package/.docs/reference/evals/create-scorer.md +0 -8
- package/.docs/reference/index.md +0 -15
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/serialized-memory-config.md +1 -1
- package/.docs/reference/project-structure.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +1 -1
- package/.docs/reference/server/express-adapter.md +3 -1
- package/.docs/reference/server/fastify-adapter.md +3 -1
- package/.docs/reference/server/hono-adapter.md +3 -1
- package/.docs/reference/server/koa-adapter.md +3 -1
- package/.docs/reference/server/nestjs-adapter.md +3 -1
- package/.docs/reference/storage/clickhouse.md +0 -32
- package/.docs/reference/storage/composite.md +1 -27
- package/.docs/reference/storage/retention.md +0 -11
- package/.docs/reference/tools/mcp-client.md +0 -22
- package/.docs/reference/tools/mcp-server.md +4 -161
- package/.docs/reference/voice/livekit.md +8 -272
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +3 -1
- package/.docs/reference/workspace/agentfs-filesystem.md +3 -1
- package/.docs/reference/workspace/apple-container-sandbox.md +3 -1
- package/.docs/reference/workspace/archil-filesystem.md +3 -1
- package/.docs/reference/workspace/azure-blob-filesystem.md +3 -1
- package/.docs/reference/workspace/blaxel-sandbox.md +3 -1
- package/.docs/reference/workspace/daytona-sandbox.md +3 -1
- package/.docs/reference/workspace/docker-sandbox.md +3 -1
- package/.docs/reference/workspace/e2b-sandbox.md +3 -1
- package/.docs/reference/workspace/files-sdk-filesystem.md +3 -1
- package/.docs/reference/workspace/gcs-filesystem.md +3 -1
- package/.docs/reference/workspace/google-drive-filesystem.md +3 -1
- package/.docs/reference/workspace/local-filesystem.md +3 -1
- package/.docs/reference/workspace/local-sandbox.md +3 -1
- package/.docs/reference/workspace/modal-sandbox.md +3 -1
- package/.docs/reference/workspace/railway-sandbox.md +3 -1
- package/.docs/reference/workspace/s3-filesystem.md +3 -1
- package/.docs/reference/workspace/vercel-sandbox.md +7 -5
- package/.docs/reference/workspace/vercel-serverless.md +3 -1
- package/CHANGELOG.md +0 -22
- package/package.json +5 -5
- package/.docs/docs/capabilities/channels/discord.md +0 -98
- package/.docs/docs/capabilities/channels/other-adapters.md +0 -68
- package/.docs/docs/capabilities/channels/overview.md +0 -255
- package/.docs/docs/capabilities/channels/slack.md +0 -225
- package/.docs/docs/capabilities/channels/teams.md +0 -100
- package/.docs/docs/capabilities/channels/telegram.md +0 -98
- package/.docs/docs/capabilities/channels/whatsapp.md +0 -99
- package/.docs/docs/getting-started/file-based-agents.md +0 -114
- package/.docs/models/providers/crossmodel.md +0 -109
- package/.docs/models/providers/meta.md +0 -101
- package/.docs/models/providers/zenifra.md +0 -73
- package/.docs/reference/file-based-agents/config.md +0 -97
- package/.docs/reference/file-based-agents/instructions.md +0 -54
- package/.docs/reference/file-based-agents/memory.md +0 -58
- package/.docs/reference/file-based-agents/observability.md +0 -32
- package/.docs/reference/file-based-agents/processors.md +0 -56
- package/.docs/reference/file-based-agents/server.md +0 -37
- package/.docs/reference/file-based-agents/skills.md +0 -56
- package/.docs/reference/file-based-agents/storage.md +0 -30
- package/.docs/reference/file-based-agents/studio.md +0 -56
- package/.docs/reference/file-based-agents/subagents.md +0 -123
- package/.docs/reference/file-based-agents/tools.md +0 -63
- package/.docs/reference/file-based-agents/workflows.md +0 -52
- package/.docs/reference/file-based-agents/workspace.md +0 -74
- package/.docs/reference/memory/summarizeConversation.md +0 -99
- package/.docs/reference/memory/summarizeThread.md +0 -93
|
@@ -29,7 +29,7 @@ export const normalizedAgent = new Agent({
|
|
|
29
29
|
})
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Visit [`UnicodeNormalizer()`](https://mastra.ai/reference/processors/unicode-normalizer) reference for a full list of configuration options.
|
|
32
|
+
> **Note:** Visit [`UnicodeNormalizer()`](https://mastra.ai/reference/processors/unicode-normalizer) reference for a full list of configuration options.
|
|
33
33
|
|
|
34
34
|
### Prevent prompt injection
|
|
35
35
|
|
|
@@ -52,7 +52,7 @@ export const secureAgent = new Agent({
|
|
|
52
52
|
})
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
Visit [`PromptInjectionDetector()`](https://mastra.ai/reference/processors/prompt-injection-detector) reference for a full list of configuration options.
|
|
55
|
+
> **Note:** Visit [`PromptInjectionDetector()`](https://mastra.ai/reference/processors/prompt-injection-detector) reference for a full list of configuration options.
|
|
56
56
|
|
|
57
57
|
### Detect and translate language
|
|
58
58
|
|
|
@@ -75,7 +75,7 @@ export const multilingualAgent = new Agent({
|
|
|
75
75
|
})
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Visit [`LanguageDetector()`](https://mastra.ai/reference/processors/language-detector) reference for a full list of configuration options.
|
|
78
|
+
> **Note:** Visit [`LanguageDetector()`](https://mastra.ai/reference/processors/language-detector) reference for a full list of configuration options.
|
|
79
79
|
|
|
80
80
|
## Output processors
|
|
81
81
|
|
|
@@ -101,7 +101,7 @@ export const batchedAgent = new Agent({
|
|
|
101
101
|
})
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
Visit [`BatchPartsProcessor()`](https://mastra.ai/reference/processors/batch-parts-processor) reference for a full list of configuration options.
|
|
104
|
+
> **Note:** Visit [`BatchPartsProcessor()`](https://mastra.ai/reference/processors/batch-parts-processor) reference for a full list of configuration options.
|
|
105
105
|
|
|
106
106
|
### Scrub system prompts
|
|
107
107
|
|
|
@@ -128,7 +128,7 @@ const scrubbedAgent = new Agent({
|
|
|
128
128
|
})
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
Visit [`SystemPromptScrubber()`](https://mastra.ai/reference/processors/system-prompt-scrubber) reference for a full list of configuration options.
|
|
131
|
+
> **Note:** Visit [`SystemPromptScrubber()`](https://mastra.ai/reference/processors/system-prompt-scrubber) reference for a full list of configuration options.
|
|
132
132
|
|
|
133
133
|
> **Note:** When streaming responses over HTTP, Mastra redacts sensitive request data (system prompts, tool definitions, API keys) from stream chunks at the server level by default. See [Stream data redaction](https://mastra.ai/docs/server/mastra-server) for details.
|
|
134
134
|
|
|
@@ -158,7 +158,7 @@ export const moderatedAgent = new Agent({
|
|
|
158
158
|
})
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
Visit [`ModerationProcessor()`](https://mastra.ai/reference/processors/moderation-processor) reference for a full list of configuration options.
|
|
161
|
+
> **Note:** Visit [`ModerationProcessor()`](https://mastra.ai/reference/processors/moderation-processor) reference for a full list of configuration options.
|
|
162
162
|
|
|
163
163
|
### Detect and redact PII
|
|
164
164
|
|
|
@@ -184,7 +184,7 @@ export const privateAgent = new Agent({
|
|
|
184
184
|
})
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
Visit [`PIIDetector()`](https://mastra.ai/reference/processors/pii-detector) reference for a full list of configuration options.
|
|
187
|
+
> **Note:** Visit [`PIIDetector()`](https://mastra.ai/reference/processors/pii-detector) reference for a full list of configuration options.
|
|
188
188
|
|
|
189
189
|
### Enforce cost limits
|
|
190
190
|
|
|
@@ -206,7 +206,7 @@ export const budgetedAgent = new Agent({
|
|
|
206
206
|
})
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
Visit [`CostGuardProcessor()`](https://mastra.ai/reference/processors/cost-guard-processor) reference for scoping modes, time windows, metric persistence delays, and the `onViolation` callback. Requires observability storage with `getMetricAggregate` support.
|
|
209
|
+
> **Note:** Visit [`CostGuardProcessor()`](https://mastra.ai/reference/processors/cost-guard-processor) reference for scoping modes, time windows, metric persistence delays, and the `onViolation` callback. Requires observability storage with `getMetricAggregate` support.
|
|
210
210
|
|
|
211
211
|
## Processor strategies
|
|
212
212
|
|
|
@@ -386,5 +386,4 @@ outputProcessors: [
|
|
|
386
386
|
|
|
387
387
|
- [Processors](https://mastra.ai/docs/agents/processors): How processors work, execution order, custom processors, and retry mechanism
|
|
388
388
|
- [`Processor` Interface](https://mastra.ai/reference/processors/processor-interface): API reference for the `Processor` interface
|
|
389
|
-
- [Memory Processors](https://mastra.ai/docs/memory/memory-processors): Processors for message history, semantic recall, and working memory
|
|
390
|
-
- 📹 [Mastra processors and guardrails workshop](https://www.youtube.com/watch?v=4Vpp7xQYvl0)
|
|
389
|
+
- [Memory Processors](https://mastra.ai/docs/memory/memory-processors): Processors for message history, semantic recall, and working memory
|
|
@@ -119,7 +119,7 @@ console.log(response.text)
|
|
|
119
119
|
|
|
120
120
|
Use agents when the task is open-ended and the steps aren't known in advance. An agent decides which tools to call, how many times to loop, and when to stop. You provide the goal and constraints instead of defining each step. For predetermined, multi-step processes with explicit control flow, use [workflows](https://mastra.ai/docs/workflows/overview) instead.
|
|
121
121
|
|
|
122
|
-
>
|
|
122
|
+
> **Tip:** Watch an introduction to agents, and how they compare to workflows on [YouTube (7 minutes)](https://youtu.be/0jg2g3sNvgw).
|
|
123
123
|
|
|
124
124
|
## Quickstart
|
|
125
125
|
|
|
@@ -151,10 +151,10 @@ export const mastra = new Mastra({
|
|
|
151
151
|
|
|
152
152
|
Once registered, it can be called from workflows, tools, or other agents, and has access to shared resources such as memory, logging, and observability features.
|
|
153
153
|
|
|
154
|
-
Visit the [agent reference](https://mastra.ai/reference/agents/agent) for more information on available properties and configurations.
|
|
155
|
-
|
|
156
154
|
> **Tip:** Use [Studio](https://mastra.ai/docs/studio/overview) to test your agent with different messages, inspect tool calls and responses, and debug agent behavior.
|
|
157
155
|
|
|
156
|
+
> **Note:** Visit the [agent reference](https://mastra.ai/reference/agents/agent) for more information on available properties and configurations.
|
|
157
|
+
|
|
158
158
|
## Use your agent
|
|
159
159
|
|
|
160
160
|
After registration, retrieve your agent with [`mastra.getAgentById()`](https://mastra.ai/reference/core/getAgentById). Call `.generate()` for a complete response or `.stream()` to deliver tokens in real time. You can call agents from [workflow steps](https://mastra.ai/docs/workflows/agents-and-tools), [tools](https://mastra.ai/docs/agents/using-tools), the [Mastra Client](https://mastra.ai/reference/client-js/mastra-client), route handlers, [server adapters](https://mastra.ai/docs/server/server-adapters), or the command line. Visit the [guides section](https://mastra.ai/guides) to learn how to use agents in your framework of choice.
|
|
@@ -205,7 +205,7 @@ Once your agent is running, use this table to find the right page for what you w
|
|
|
205
205
|
| Build agents that correct their work | [Rubric scorer](https://mastra.ai/docs/agents/supervisor-agents) |
|
|
206
206
|
| Swap instructions or models based on request context | [Dynamic configuration](https://mastra.ai/docs/server/request-context) |
|
|
207
207
|
| Add speech-to-text or text-to-speech | [Voice](https://mastra.ai/docs/voice/overview) |
|
|
208
|
-
| Connect to Slack, Discord, or Telegram | [Channels](https://mastra.ai/docs/
|
|
208
|
+
| Connect to Slack, Discord, or Telegram | [Channels](https://mastra.ai/docs/agents/channels) |
|
|
209
209
|
|
|
210
210
|
## Multi-agent systems
|
|
211
211
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Skills are reusable instructions that teach agents how to perform specific tasks. They follow the [Agent Skills specification](https://agentskills.io).
|
|
6
6
|
|
|
7
|
-
You can attach skills directly to an agent
|
|
7
|
+
You can attach skills directly to an agent without setting up a workspace, filesystem, or sandbox. This is useful when you want portable, code-defined capabilities that travel with your agent definition.
|
|
8
8
|
|
|
9
9
|
## When to use agent-level skills
|
|
10
10
|
|
|
@@ -69,7 +69,9 @@ export const releaseChecklist = createSkill({
|
|
|
69
69
|
})
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
The `references` field bundles supporting documents that the agent can read with the `skill_read` tool, like `references/` files in a filesystem skill.
|
|
72
|
+
The `references` field bundles supporting documents that the agent can read with the `skill_read` tool, like `references/` files in a filesystem skill.
|
|
73
|
+
|
|
74
|
+
> **Note:** Visit [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill) for the full API.
|
|
73
75
|
|
|
74
76
|
## Filesystem path skills
|
|
75
77
|
|
|
@@ -177,7 +179,7 @@ for (const meta of allSkills) {
|
|
|
177
179
|
}
|
|
178
180
|
```
|
|
179
181
|
|
|
180
|
-
Visit [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill) and [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills) for the full API.
|
|
182
|
+
> **Note:** Visit [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill) and [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills) for the full API.
|
|
181
183
|
|
|
182
184
|
## Related
|
|
183
185
|
|
|
@@ -103,7 +103,7 @@ const response = await testAgent.generate('Help me plan my day.', {
|
|
|
103
103
|
console.log(response.object)
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Visit [`.generate()`](https://mastra.ai/reference/agents/generate) for a full list of configuration options.
|
|
106
|
+
> **Note:** Visit [`.generate()`](https://mastra.ai/reference/agents/generate) for a full list of configuration options.
|
|
107
107
|
|
|
108
108
|
**Example output:** The `response.object` will contain the structured data as defined by the schema.
|
|
109
109
|
|
|
@@ -226,7 +226,9 @@ How it works:
|
|
|
226
226
|
2. **Scoped memory saves**: Only the delegation prompt and the subagent's response are saved to the subagent's memory
|
|
227
227
|
3. **Fresh thread per invocation**: Each delegation uses a unique thread ID, ensuring clean separation
|
|
228
228
|
|
|
229
|
-
This ensures subagents have the context they need without cluttering their memory with the entire supervisor conversation.
|
|
229
|
+
This ensures subagents have the context they need without cluttering their memory with the entire supervisor conversation.
|
|
230
|
+
|
|
231
|
+
> **Note:** Visit [memory in multi-agent systems](https://mastra.ai/docs/memory/overview) for more details.
|
|
230
232
|
|
|
231
233
|
## Tool approval propagation
|
|
232
234
|
|
|
@@ -426,5 +428,4 @@ Version overrides propagate automatically through delegation. See [Subagent vers
|
|
|
426
428
|
- [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
|
|
427
429
|
- [Agent approval](https://mastra.ai/docs/agents/agent-approval)
|
|
428
430
|
- [Memory in multi-agent systems](https://mastra.ai/docs/memory/overview)
|
|
429
|
-
- [Concept: Multi-agent systems](https://mastra.ai/guides/concepts/multi-agent-systems)
|
|
430
|
-
- 📹 [Mastra supervisor agents workshop](https://www.youtube.com/watch?v=FNb2fL9WhQg\&t=1872s)
|
|
431
|
+
- [Concept: Multi-agent systems](https://mastra.ai/guides/concepts/multi-agent-systems)
|
|
@@ -38,7 +38,9 @@ export const weatherTool = createTool({
|
|
|
38
38
|
})
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
When creating tools, keep descriptions concise and focused on what the tool does, emphasizing its primary use case. Descriptive schema names can also help guide the agent on how to use the tool.
|
|
41
|
+
When creating tools, keep descriptions concise and focused on what the tool does, emphasizing its primary use case. Descriptive schema names can also help guide the agent on how to use the tool.
|
|
42
|
+
|
|
43
|
+
> **Note:** Visit the [`createTool`](https://mastra.ai/reference/tools/create-tool) reference for more information on available properties, configurations, and examples.
|
|
42
44
|
|
|
43
45
|
To make a tool available to an agent, add it to the `tools` property on the `Agent` class. Mentioning available tools and their general purpose in the agent's system prompt helps the agent decide when to call a tool and when not to.
|
|
44
46
|
|
|
@@ -357,7 +359,7 @@ await agent.generate('Check the forecast', {
|
|
|
357
359
|
})
|
|
358
360
|
```
|
|
359
361
|
|
|
360
|
-
See the [`Agent.generate()` reference](https://mastra.ai/reference/agents/generate) for all runtime options including `toolsets`, `clientTools`, and `prepareStep`.
|
|
362
|
+
> **Note:** See the [`Agent.generate()` reference](https://mastra.ai/reference/agents/generate) for all runtime options including `toolsets`, `clientTools`, and `prepareStep`.
|
|
361
363
|
|
|
362
364
|
## Control `toolName` in stream responses
|
|
363
365
|
|
|
@@ -99,7 +99,9 @@ const browser = new AgentBrowser({
|
|
|
99
99
|
})
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
This adds `browser_record` and `browser_record_caption` to the agent's toolset. See [Browser recording (alpha)](https://mastra.ai/docs/browser/recording) for details.
|
|
102
|
+
This adds `browser_record` and `browser_record_caption` to the agent's toolset. See [Browser recording (alpha)](https://mastra.ai/docs/browser/recording) for details.
|
|
103
|
+
|
|
104
|
+
> **Note:** See [AgentBrowser reference](https://mastra.ai/reference/browser/agent-browser) for all configuration options and tool details.
|
|
103
105
|
|
|
104
106
|
## Related
|
|
105
107
|
|
|
@@ -140,7 +140,9 @@ npm install -g browse
|
|
|
140
140
|
browse skills install
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
CDP flag: `--ws`
|
|
143
|
+
CDP flag: `--ws`
|
|
144
|
+
|
|
145
|
+
> **Note:** See [BrowserViewer reference](https://mastra.ai/reference/browser/browser-viewer) for all configuration options, advanced connection modes, and method details.
|
|
144
146
|
|
|
145
147
|
## Related
|
|
146
148
|
|
|
@@ -169,5 +169,4 @@ const browser = new AgentBrowser({
|
|
|
169
169
|
- [Stagehand](https://mastra.ai/docs/browser/stagehand)
|
|
170
170
|
- [Browser recording (alpha)](https://mastra.ai/docs/browser/recording)
|
|
171
171
|
- [BrowserViewer](https://mastra.ai/docs/browser/browser-viewer)
|
|
172
|
-
- [MastraBrowser reference](https://mastra.ai/reference/browser/mastra-browser)
|
|
173
|
-
- 📹 [Mastra browser capabilities workshop](https://www.youtube.com/watch?v=E9KFsZEnQO8\&t=5s)
|
|
172
|
+
- [MastraBrowser reference](https://mastra.ai/reference/browser/mastra-browser)
|
|
@@ -146,7 +146,7 @@ const browser = new StagehandBrowser({
|
|
|
146
146
|
})
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
See [StagehandBrowser reference](https://mastra.ai/reference/browser/stagehand-browser) for all configuration options.
|
|
149
|
+
> **Note:** See [StagehandBrowser reference](https://mastra.ai/reference/browser/stagehand-browser) for all configuration options.
|
|
150
150
|
|
|
151
151
|
## Recording
|
|
152
152
|
|
|
@@ -14,7 +14,9 @@ Run the build command from your project root:
|
|
|
14
14
|
mastra build
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
This creates a `.mastra` directory containing your production-ready server.
|
|
17
|
+
This creates a `.mastra` directory containing your production-ready server.
|
|
18
|
+
|
|
19
|
+
> **Info:** Read the [`mastra build`](https://mastra.ai/reference/cli/mastra) reference for all available flags.
|
|
18
20
|
|
|
19
21
|
## Build output
|
|
20
22
|
|
|
@@ -57,7 +59,7 @@ The `mastra start` command provides additional features:
|
|
|
57
59
|
- Provides helpful error messages for missing modules
|
|
58
60
|
- Handles process signals for graceful shutdown
|
|
59
61
|
|
|
60
|
-
Read the [`mastra start`](https://mastra.ai/reference/cli/mastra) reference for all available flags.
|
|
62
|
+
> **Info:** Read the [`mastra start`](https://mastra.ai/reference/cli/mastra) reference for all available flags.
|
|
61
63
|
|
|
62
64
|
## Build configuration
|
|
63
65
|
|
|
@@ -64,7 +64,9 @@ export const mastra = new Mastra({
|
|
|
64
64
|
})
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Once registered, you can manage agents through [Studio](https://mastra.ai/docs/studio/overview) or programmatically through the server API and Client SDK.
|
|
67
|
+
Once registered, you can manage agents through [Studio](https://mastra.ai/docs/studio/overview) or programmatically through the server API and Client SDK.
|
|
68
|
+
|
|
69
|
+
> **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
|
|
68
70
|
|
|
69
71
|
## Code and database sources
|
|
70
72
|
|
|
@@ -171,7 +173,9 @@ Because stored agents are data, you can build automation loops that tune agents
|
|
|
171
173
|
- Re-run the experiment against the draft and compare scores to the baseline.
|
|
172
174
|
- Promote the draft to the published version when the scores improve.
|
|
173
175
|
|
|
174
|
-
This turns agent tuning into a closed feedback loop. One agent owns the production configuration, another agent iterates on it, and every change is versioned so you can roll back if a round of automated edits makes things worse. Combine this with [version targeting](#version-targeting-and-experimentation) to keep production traffic on the published version while the draft is being tested.
|
|
176
|
+
This turns agent tuning into a closed feedback loop. One agent owns the production configuration, another agent iterates on it, and every change is versioned so you can roll back if a round of automated edits makes things worse. Combine this with [version targeting](#version-targeting-and-experimentation) to keep production traffic on the published version while the draft is being tested.
|
|
177
|
+
|
|
178
|
+
> **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full namespace API.
|
|
175
179
|
|
|
176
180
|
## What can be overridden
|
|
177
181
|
|
|
@@ -122,7 +122,7 @@ await editor.agent.update({
|
|
|
122
122
|
})
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full `editor.prompt` API.
|
|
125
|
+
> **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full `editor.prompt` API.
|
|
126
126
|
|
|
127
127
|
## Versioning
|
|
128
128
|
|
|
@@ -142,7 +142,9 @@ When an agent runs, tools from all sources are merged in this order:
|
|
|
142
142
|
2. Integration tools
|
|
143
143
|
3. MCP tools
|
|
144
144
|
|
|
145
|
-
If a tool ID exists in multiple sources, later sources take precedence. Description overrides set at the agent level always take priority over the original tool description.
|
|
145
|
+
If a tool ID exists in multiple sources, later sources take precedence. Description overrides set at the agent level always take priority over the original tool description.
|
|
146
|
+
|
|
147
|
+
> **Note:** See the [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider) for the full provider API.
|
|
146
148
|
|
|
147
149
|
## Related
|
|
148
150
|
|
|
@@ -341,7 +341,9 @@ A custom scorer in Mastra uses `createScorer` with four core components:
|
|
|
341
341
|
3. [**Score Generation**](#score-generation)
|
|
342
342
|
4. [**Reason Generation**](#reason-generation)
|
|
343
343
|
|
|
344
|
-
Together, these components allow you to define custom evaluation logic using LLMs as judges.
|
|
344
|
+
Together, these components allow you to define custom evaluation logic using LLMs as judges.
|
|
345
|
+
|
|
346
|
+
> **Info:** Visit [createScorer](https://mastra.ai/reference/evals/create-scorer) for the full API and configuration options.
|
|
345
347
|
|
|
346
348
|
```typescript
|
|
347
349
|
import { createScorer } from '@mastra/core/evals'
|
|
@@ -41,7 +41,7 @@ const existing = await datasets.get({ id: 'dataset-id' })
|
|
|
41
41
|
const { datasets: all } = await datasets.list()
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Visit the [`DatasetsManager` reference](https://mastra.ai/reference/datasets/datasets-manager) for the full list of methods.
|
|
44
|
+
> **Info:** Visit the [`DatasetsManager` reference](https://mastra.ai/reference/datasets/datasets-manager) for the full list of methods.
|
|
45
45
|
|
|
46
46
|
## Studio
|
|
47
47
|
|
|
@@ -196,12 +196,13 @@ Fetch the exact items that existed at a past version:
|
|
|
196
196
|
const items = await dataset.listItems({ version: 2 })
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
You can also pin experiments to a version, see [running experiments](https://mastra.ai/docs/evals/datasets/running-experiments).
|
|
199
|
+
You can also pin experiments to a version, see [running experiments](https://mastra.ai/docs/evals/datasets/running-experiments).
|
|
200
|
+
|
|
201
|
+
> **Info:** Visit the [`Dataset` reference](https://mastra.ai/reference/datasets/dataset) for the full list of methods and parameters.
|
|
200
202
|
|
|
201
203
|
## Related
|
|
202
204
|
|
|
203
205
|
- [Running experiments](https://mastra.ai/docs/evals/datasets/running-experiments)
|
|
204
206
|
- [Scorers overview](https://mastra.ai/docs/evals/overview)
|
|
205
207
|
- [DatasetsManager reference](https://mastra.ai/reference/datasets/datasets-manager)
|
|
206
|
-
- [Dataset reference](https://mastra.ai/reference/datasets/dataset)
|
|
207
|
-
- 📹 [Mastra evals, datasets, and experiments workshop](https://www.youtube.com/watch?v=Vla5LfmOOrM)
|
|
208
|
+
- [Dataset reference](https://mastra.ai/reference/datasets/dataset)
|
|
@@ -127,7 +127,7 @@ for (const item of summary.results) {
|
|
|
127
127
|
}
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
Visit the [Scorers overview](https://mastra.ai/docs/evals/overview) for details on available and custom scorers.
|
|
130
|
+
> **Info:** Visit the [Scorers overview](https://mastra.ai/docs/evals/overview) for details on available and custom scorers.
|
|
131
131
|
|
|
132
132
|
## Tool mocks
|
|
133
133
|
|
|
@@ -321,8 +321,6 @@ console.log(experiment.startedAt)
|
|
|
321
321
|
console.log(experiment.completedAt)
|
|
322
322
|
```
|
|
323
323
|
|
|
324
|
-
> **📹 Watch:** Watch [Mastra datasets and experiments workflow](https://www.youtube.com/watch?v=R6pjAdGhxhQ) to see how datasets and experiments help improve reliability.
|
|
325
|
-
|
|
326
324
|
### Item-level results
|
|
327
325
|
|
|
328
326
|
```typescript
|
|
@@ -344,7 +342,7 @@ for (const result of results) {
|
|
|
344
342
|
- `completedWithErrors` is `true` when the experiment finished but some items failed.
|
|
345
343
|
- Items cancelled via `signal` appear in `skippedCount`.
|
|
346
344
|
|
|
347
|
-
Visit the [`startExperiment` reference](https://mastra.ai/reference/datasets/startExperiment) for the full parameter and return type documentation.
|
|
345
|
+
> **Info:** Visit the [`startExperiment` reference](https://mastra.ai/reference/datasets/startExperiment) for the full parameter and return type documentation.
|
|
348
346
|
|
|
349
347
|
## Related
|
|
350
348
|
|
|
@@ -136,7 +136,9 @@ const summary = await dataset.startExperiment({
|
|
|
136
136
|
})
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
The inline `task` receives the item's `metadata`, so each row can drive its own thread without changing the agent or any scorer.
|
|
139
|
+
The inline `task` receives the item's `metadata`, so each row can drive its own thread without changing the agent or any scorer.
|
|
140
|
+
|
|
141
|
+
> **Note:** Visit [runEvals reference](https://mastra.ai/reference/evals/run-evals) and [Dataset reference](https://mastra.ai/reference/datasets/dataset) for full configuration.
|
|
140
142
|
|
|
141
143
|
## Related
|
|
142
144
|
|
|
@@ -64,7 +64,9 @@ const result = await runEvals({
|
|
|
64
64
|
// result.gateResults: [{ id: 'check-called-tool', passed: true, score: 1 }]
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Any scorer works as a gate. Quick Checks are a natural fit because they return binary 1/0 scores.
|
|
67
|
+
Any scorer works as a gate. Quick Checks are a natural fit because they return binary 1/0 scores.
|
|
68
|
+
|
|
69
|
+
> **Note:** Visit [runEvals() reference](https://mastra.ai/reference/evals/run-evals) for the full parameter and return type documentation.
|
|
68
70
|
|
|
69
71
|
## Thresholds
|
|
70
72
|
|
|
@@ -8,8 +8,6 @@ Scorers are automated tests that evaluate Agents outputs using model-graded, rul
|
|
|
8
8
|
|
|
9
9
|
Scorers can be run in the cloud, capturing real-time results. But scorers can also be part of your CI/CD pipeline, allowing you to test and monitor your agents over time.
|
|
10
10
|
|
|
11
|
-
> **📹 Watch:** Watch [Mastra evals overview](https://www.youtube.com/watch?v=12WN6u2DrBk) for an introduction to evals and how to reason about agent quality.
|
|
12
|
-
|
|
13
11
|
## Types of scorers
|
|
14
12
|
|
|
15
13
|
Mastra provides different kinds of scorers, each serving a specific purpose. Here are some common types:
|
|
@@ -144,5 +142,4 @@ Once registered, you can score traces interactively within Studio under the **Ob
|
|
|
144
142
|
- Add [gates and verdicts](https://mastra.ai/docs/evals/gates-and-verdicts) to enforce hard requirements and quality thresholds
|
|
145
143
|
- Learn how to create your own scorers in the [Creating Custom Scorers](https://mastra.ai/docs/evals/custom-scorers) guide
|
|
146
144
|
- Explore built-in scorers in the [Built-in Scorers](https://mastra.ai/docs/evals/built-in-scorers) section
|
|
147
|
-
- Test scorers with [Studio](https://mastra.ai/docs/studio/overview)
|
|
148
|
-
- 📹 [Mastra evals workshop](https://www.youtube.com/watch?v=OHOZ5PgPj5M\&t=3578s)
|
|
145
|
+
- Test scorers with [Studio](https://mastra.ai/docs/studio/overview)
|
|
@@ -127,7 +127,9 @@ Each check is a standard `createScorer()` instance with a `preprocess` step and
|
|
|
127
127
|
1. **preprocess**: Extracts and normalizes relevant data from the agent run (text content, tool calls)
|
|
128
128
|
2. **generateScore**: Converts the preprocessed result into a score (typically binary 1 or 0)
|
|
129
129
|
|
|
130
|
-
Because checks skip the `analyze` and `generateReason` steps and make no LLM calls, they run in microseconds.
|
|
130
|
+
Because checks skip the `analyze` and `generateReason` steps and make no LLM calls, they run in microseconds.
|
|
131
|
+
|
|
132
|
+
> **Note:** Visit the [Quick Checks reference](https://mastra.ai/reference/evals/checks) for the full API, including all parameters and options for each check.
|
|
131
133
|
|
|
132
134
|
## Related
|
|
133
135
|
|
|
@@ -168,7 +168,7 @@ const stream = await agent.stream('Research solana for me', {
|
|
|
168
168
|
})
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
Visit [`Agent.stream()`](https://mastra.ai/reference/streaming/agents/stream) for the full API.
|
|
171
|
+
> **Note:** Visit [`Agent.stream()`](https://mastra.ai/reference/streaming/agents/stream) for the full API.
|
|
172
172
|
|
|
173
173
|
### Aggregate properties
|
|
174
174
|
|
|
@@ -60,7 +60,9 @@ for await (const chunk of output.fullStream) {
|
|
|
60
60
|
cleanup()
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
The returned `runId` identifies the execution. Pass it to `observe()` to reconnect from a different client.
|
|
63
|
+
The returned `runId` identifies the execution. Pass it to `observe()` to reconnect from a different client.
|
|
64
|
+
|
|
65
|
+
> **Note:** Visit the [DurableAgent reference](https://mastra.ai/reference/agents/durable-agent) for the full configuration and method API.
|
|
64
66
|
|
|
65
67
|
## How it works
|
|
66
68
|
|
|
@@ -138,7 +140,7 @@ const agent = new Agent({
|
|
|
138
140
|
export const inngestAnalyst = createInngestAgent({ agent, inngest })
|
|
139
141
|
```
|
|
140
142
|
|
|
141
|
-
Visit the [`createInngestAgent()` reference](https://mastra.ai/reference/agents/inngest-agent) for the full API, including Inngest-specific options like PubSub and cache configuration.
|
|
143
|
+
> **Note:** Visit the [`createInngestAgent()` reference](https://mastra.ai/reference/agents/inngest-agent) for the full API, including Inngest-specific options like PubSub and cache configuration.
|
|
142
144
|
|
|
143
145
|
## Resumable streams
|
|
144
146
|
|
|
@@ -197,7 +199,7 @@ await durableAgent.stream('Research topic', {
|
|
|
197
199
|
})
|
|
198
200
|
```
|
|
199
201
|
|
|
200
|
-
Visit [Background tasks](https://mastra.ai/docs/long-running-agents/background-tasks) for the full background task guide, including configuration, subagents, and suspend/resume.
|
|
202
|
+
> **Note:** Visit [Background tasks](https://mastra.ai/docs/long-running-agents/background-tasks) for the full background task guide, including configuration, subagents, and suspend/resume.
|
|
201
203
|
|
|
202
204
|
## Cleanup
|
|
203
205
|
|
|
@@ -103,7 +103,9 @@ await worker.updateObjectiveOptions({ threadId, maxRuns: 100 })
|
|
|
103
103
|
await worker.clearObjective({ threadId })
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Per-objective values written by `setObjective` / `updateObjectiveOptions` take precedence over the agent's `goal` config, and that precedence is remembered in thread state.
|
|
106
|
+
Per-objective values written by `setObjective` / `updateObjectiveOptions` take precedence over the agent's `goal` config, and that precedence is remembered in thread state.
|
|
107
|
+
|
|
108
|
+
> **Note:** See the [`GoalEvaluationPayload` in the ChunkType reference](https://mastra.ai/reference/streaming/ChunkType) for the full goal chunk shape.
|
|
107
109
|
|
|
108
110
|
## Related
|
|
109
111
|
|
|
@@ -157,7 +157,9 @@ export class CiSignals extends SignalProvider<'ci-signals'> {
|
|
|
157
157
|
}
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
`handleWebhook()` is a provider method, not an auto-mounted HTTP route. Invoke it from your own endpoint, passing the request body, headers, and any route params.
|
|
160
|
+
`handleWebhook()` is a provider method, not an auto-mounted HTTP route. Invoke it from your own endpoint, passing the request body, headers, and any route params.
|
|
161
|
+
|
|
162
|
+
> **Note:** Visit [`SignalProvider` reference](https://mastra.ai/reference/signals/signal-provider) for subscription, polling, lifecycle, and `notify()` details. For the complete notification payload shape, including deduplication and coalescing fields, visit [`Agent.sendNotificationSignal()` reference](https://mastra.ai/reference/agents/agent).
|
|
161
163
|
|
|
162
164
|
## Built-in webhook provider
|
|
163
165
|
|
|
@@ -10,8 +10,6 @@ Signals are a way to interact with an agent through a thread. Instead of startin
|
|
|
10
10
|
|
|
11
11
|
Use message APIs for user-authored input. Use `sendSignal()` for lower-level system context, such as background task notifications, policy reminders, or processor-generated context.
|
|
12
12
|
|
|
13
|
-
> **📹 Watch:** Watch [Mastra signals overview](https://www.youtube.com/watch?v=7It2y89TVP4) to see how signals wake and steer long-running agents.
|
|
14
|
-
|
|
15
13
|
## When to use signals
|
|
16
14
|
|
|
17
15
|
Use signals when an agent thread needs new input or context outside the original `stream()` call. Signals are useful when users send follow-up messages while a run is active, when background systems need to add context to a thread, or when external events should wake, update, or notify the agent.
|
|
@@ -112,7 +110,9 @@ const result = agent.sendSignal(
|
|
|
112
110
|
await result.persisted
|
|
113
111
|
```
|
|
114
112
|
|
|
115
|
-
Pass `ifIdle.streamOptions` when the idle wake-up stream needs options such as model settings, tools, or runtime context.
|
|
113
|
+
Pass `ifIdle.streamOptions` when the idle wake-up stream needs options such as model settings, tools, or runtime context.
|
|
114
|
+
|
|
115
|
+
> **Note:** Visit [`Agent.sendSignal()` reference](https://mastra.ai/reference/agents/agent) for `ifActive`, `ifIdle`, branch attributes, and `streamOptions`.
|
|
116
116
|
|
|
117
117
|
### Send notification context
|
|
118
118
|
|
|
@@ -197,7 +197,9 @@ Awaiting `sendSignal()` preserves stream echo ordering when a subscribed thread
|
|
|
197
197
|
|
|
198
198
|
### Conditional attributes
|
|
199
199
|
|
|
200
|
-
Use `ifActive.attributes` and `ifIdle.attributes` to tag input with context that depends on whether the agent is active or idle at delivery time. Top-level `attributes` always apply, and Mastra merges the selected branch's `attributes` into them when the input is accepted.
|
|
200
|
+
Use `ifActive.attributes` and `ifIdle.attributes` to tag input with context that depends on whether the agent is active or idle at delivery time. Top-level `attributes` always apply, and Mastra merges the selected branch's `attributes` into them when the input is accepted.
|
|
201
|
+
|
|
202
|
+
> **Note:** Visit [`Agent.sendMessage()` reference](https://mastra.ai/reference/agents/agent) and [`Agent.sendSignal()` reference](https://mastra.ai/reference/agents/agent) for branch-specific attributes.
|
|
201
203
|
|
|
202
204
|
## State and notification signals
|
|
203
205
|
|
|
@@ -272,7 +274,9 @@ Notification signals represent external events such as GitHub activity, email, S
|
|
|
272
274
|
|
|
273
275
|
Notification delivery has two phases. During ingress, `agent.sendNotificationSignal()` stores a notification record and resolves the agent's delivery policy. During dispatch, Mastra consumes due records and emits full notification or summary signals.
|
|
274
276
|
|
|
275
|
-
The default delivery policy is priority-aware. Urgent notifications deliver immediately, while lower-priority notifications may be batched into summaries or wait until the thread is idle.
|
|
277
|
+
The default delivery policy is priority-aware. Urgent notifications deliver immediately, while lower-priority notifications may be batched into summaries or wait until the thread is idle.
|
|
278
|
+
|
|
279
|
+
> **Note:** Visit [`Agent.sendNotificationSignal()` reference](https://mastra.ai/reference/agents/agent) for notification fields, [`Agent` constructor reference](https://mastra.ai/reference/agents/agent) for `notifications.deliveryPolicy` configuration, and [`createNotificationInboxTool()` reference](https://mastra.ai/reference/signals/create-notification-inbox-tool) for inbox tool actions.
|
|
276
280
|
|
|
277
281
|
```typescript
|
|
278
282
|
await agent.sendNotificationSignal(
|
|
@@ -308,11 +312,15 @@ Notification summaries tell the model that inbox records are waiting:
|
|
|
308
312
|
|
|
309
313
|
When Mastra emits a summary, it clears `summaryAt` and sets `summarySignalId` on each summarized record. The records stay pending and readable. When Mastra emits a full notification, it sets `deliveredSignalId` and marks the record `delivered`. If the inbox tool reads a notification first, it can inject the full notification signal and mark the record `seen`, which prevents duplicate full delivery.
|
|
310
314
|
|
|
311
|
-
Configure a delivery policy on the agent when some notifications should wait for a different dispatch window or summary rollup. Enable scheduled dispatch at the Mastra level when deferred notifications and summary rollups should be delivered automatically.
|
|
315
|
+
Configure a delivery policy on the agent when some notifications should wait for a different dispatch window or summary rollup. Enable scheduled dispatch at the Mastra level when deferred notifications and summary rollups should be delivered automatically.
|
|
316
|
+
|
|
317
|
+
> **Note:** Visit [`Agent` constructor reference](https://mastra.ai/reference/agents/agent) for `notifications.deliveryPolicy` and [`Mastra` class reference](https://mastra.ai/reference/core/mastra-class) for runtime notification dispatch configuration.
|
|
312
318
|
|
|
313
319
|
#### Notification inbox tool
|
|
314
320
|
|
|
315
|
-
Use `createNotificationInboxTool()` to give agents one tool for inbox actions instead of many CRUD tools. Use `read` after a `<notification-summary>` signal when the agent needs the full records behind the summary. The notification contents are delivered as signals, not as normal tool output.
|
|
321
|
+
Use `createNotificationInboxTool()` to give agents one tool for inbox actions instead of many CRUD tools. Use `read` after a `<notification-summary>` signal when the agent needs the full records behind the summary. The notification contents are delivered as signals, not as normal tool output.
|
|
322
|
+
|
|
323
|
+
> **Note:** Visit [`createNotificationInboxTool()` reference](https://mastra.ai/reference/signals/create-notification-inbox-tool) for the setup example, input schema, and action behavior.
|
|
316
324
|
|
|
317
325
|
`sendNotificationSignal()` requires a storage domain with `notifications` support. Use `sendSignal({ type: 'notification' })` only for lower-level notification-shaped context that should bypass inbox storage.
|
|
318
326
|
|
|
@@ -348,11 +356,15 @@ Mastra still accepts legacy signal payloads such as `type: 'user-message'` and `
|
|
|
348
356
|
- `type: 'user-message'`: Normalizes to `type: 'user'` and `tagName: 'user'`
|
|
349
357
|
- `type: 'system-reminder'`: Normalizes to `type: 'reactive'` and `tagName: 'system-reminder'`
|
|
350
358
|
|
|
351
|
-
Existing stored signal rows and older clients continue to load through the compatibility layer. New clients call the message routes when the server supports them; React's thread signal path falls back to the legacy `/signals` route when it detects an older server.
|
|
359
|
+
Existing stored signal rows and older clients continue to load through the compatibility layer. New clients call the message routes when the server supports them; React's thread signal path falls back to the legacy `/signals` route when it detects an older server.
|
|
360
|
+
|
|
361
|
+
> **Note:** Visit [Agent signals reference](https://mastra.ai/reference/agents/agent) for the full message, signal, and subscription types.
|
|
352
362
|
|
|
353
363
|
### Approve tool calls
|
|
354
364
|
|
|
355
|
-
When a subscribed run pauses for tool approval, approve or decline the tool call with the subscription-native methods. The resumed chunks arrive through the existing thread subscription.
|
|
365
|
+
When a subscribed run pauses for tool approval, approve or decline the tool call with the subscription-native methods. The resumed chunks arrive through the existing thread subscription.
|
|
366
|
+
|
|
367
|
+
> **Note:** Visit [`client.getAgent().sendToolApproval()` reference](https://mastra.ai/reference/client-js/agents) and [server agent routes](https://mastra.ai/reference/server/routes) for request and response shapes.
|
|
356
368
|
|
|
357
369
|
### Use HTTP routes
|
|
358
370
|
|
|
@@ -418,5 +430,4 @@ Use heartbeats together with client-side reconnect logic. Heartbeats reduce idle
|
|
|
418
430
|
- [Server agent routes](https://mastra.ai/reference/server/routes)
|
|
419
431
|
- [`client.getAgent().subscribeToThread()`](https://mastra.ai/reference/client-js/agents)
|
|
420
432
|
- [`client.getAgent().sendToolApproval()`](https://mastra.ai/reference/client-js/agents)
|
|
421
|
-
- [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams)
|
|
422
|
-
- 📹 [Mastra signals workshop](https://www.youtube.com/watch?v=KLg6uFKz9aw\&t=3020s)
|
|
433
|
+
- [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams)
|
|
@@ -128,8 +128,4 @@ yarn dlx mastra api trace list
|
|
|
128
128
|
bun x mastra api trace list
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
For observability commands, the CLI targets the hosted observability API and can infer credentials from your project environment. See the [`mastra api` CLI reference](https://mastra.ai/reference/cli/mastra) for available observability commands, filtering, pagination, credential resolution, and direct `curl` examples.
|
|
132
|
-
|
|
133
|
-
## Related
|
|
134
|
-
|
|
135
|
-
- 📹 [Mastra observability and Studio workshop](https://www.youtube.com/watch?v=dKO_a3RPra0)
|
|
131
|
+
For observability commands, the CLI targets the hosted observability API and can infer credentials from your project environment. See the [`mastra api` CLI reference](https://mastra.ai/reference/cli/mastra) for available observability commands, filtering, pagination, credential resolution, and direct `curl` examples.
|
|
@@ -81,7 +81,7 @@ calculatorTool._meta = {
|
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
Visit [MCPServer reference](https://mastra.ai/reference/tools/mcp-server) for the full `appResources` configuration.
|
|
84
|
+
> **Note:** Visit [MCPServer reference](https://mastra.ai/reference/tools/mcp-server) for the full `appResources` configuration.
|
|
85
85
|
|
|
86
86
|
## Connecting MCP Apps to agents
|
|
87
87
|
|
|
@@ -249,7 +249,7 @@ Establishes the connection to the host. Call this after registering all event ha
|
|
|
249
249
|
await app.connect()
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
See the [`App` class API reference](https://apps.extensions.modelcontextprotocol.io/api/classes/app.App.html) for the full list of methods, callbacks, and lifecycle hooks.
|
|
252
|
+
> **Note:** See the [`App` class API reference](https://apps.extensions.modelcontextprotocol.io/api/classes/app.App.html) for the full list of methods, callbacks, and lifecycle hooks.
|
|
253
253
|
|
|
254
254
|
## Using external MCP servers with apps
|
|
255
255
|
|
|
@@ -284,7 +284,7 @@ export const mastra = new Mastra({
|
|
|
284
284
|
})
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
-
Visit [MCPClient reference](https://mastra.ai/reference/tools/mcp-client) for more details on proxying external servers.
|
|
287
|
+
> **Note:** Visit [MCPClient reference](https://mastra.ai/reference/tools/mcp-client) for more details on proxying external servers.
|
|
288
288
|
|
|
289
289
|
## Sandbox security
|
|
290
290
|
|