@mastra/mcp-docs-server 1.2.3 → 1.2.4-alpha.5

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.
Files changed (91) hide show
  1. package/.docs/docs/agent-controller/overview.md +1 -0
  2. package/.docs/docs/agent-controller/subagents.md +1 -0
  3. package/.docs/docs/agent-controller/threads-and-state.md +1 -0
  4. package/.docs/docs/agents/background-tasks.md +3 -3
  5. package/.docs/docs/agents/channels.md +4 -1
  6. package/.docs/docs/agents/code-mode.md +2 -0
  7. package/.docs/docs/agents/durable-agents.md +1 -1
  8. package/.docs/docs/agents/file-based-agents.md +1 -1
  9. package/.docs/docs/agents/goals.md +2 -0
  10. package/.docs/docs/agents/heartbeats.md +1 -1
  11. package/.docs/docs/agents/overview.md +104 -0
  12. package/.docs/docs/agents/processors.md +8 -2
  13. package/.docs/docs/agents/supervisor-agents.md +1 -0
  14. package/.docs/docs/agents/using-tools.md +3 -0
  15. package/.docs/docs/editor/overview.md +1 -0
  16. package/.docs/docs/evals/overview.md +1 -0
  17. package/.docs/docs/evals/quick-checks.md +1 -0
  18. package/.docs/docs/getting-started/build-with-ai.md +3 -5
  19. package/.docs/docs/getting-started/manual-install.md +15 -5
  20. package/.docs/docs/index.md +104 -0
  21. package/.docs/docs/memory/memory-processors.md +2 -0
  22. package/.docs/docs/memory/observational-memory.md +4 -0
  23. package/.docs/docs/memory/overview.md +3 -1
  24. package/.docs/docs/memory/semantic-recall.md +6 -0
  25. package/.docs/docs/observability/integrations/exporters/langfuse.md +1 -0
  26. package/.docs/docs/workspace/filesystem.md +3 -1
  27. package/.docs/docs/workspace/sandbox.md +2 -0
  28. package/.docs/guides/getting-started/quickstart.md +2 -0
  29. package/.docs/guides/migrations/agentnetwork.md +1 -0
  30. package/.docs/guides/migrations/upgrade-to-v1/memory.md +1 -0
  31. package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -0
  32. package/.docs/models/environment-variables.md +142 -0
  33. package/.docs/models/gateways/netlify.md +3 -2
  34. package/.docs/models/gateways/openrouter.md +4 -2
  35. package/.docs/models/gateways/vercel.md +4 -1
  36. package/.docs/models/index.md +8 -8
  37. package/.docs/models/providers/cerebras.md +5 -4
  38. package/.docs/models/providers/google.md +3 -1
  39. package/.docs/models/providers/llmgateway.md +2 -1
  40. package/.docs/models/providers/opencode.md +5 -1
  41. package/.docs/models/providers/zhipuai.md +1 -1
  42. package/.docs/reference/agents/agent.md +3 -2
  43. package/.docs/reference/agents/channels.md +5 -0
  44. package/.docs/reference/evals/hallucination.md +1 -0
  45. package/.docs/reference/evals/prompt-alignment.md +1 -0
  46. package/.docs/reference/index.md +2 -0
  47. package/.docs/reference/memory/memory-class.md +1 -0
  48. package/.docs/reference/memory/observational-memory.md +8 -0
  49. package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -0
  50. package/.docs/reference/processors/batch-parts-processor.md +1 -0
  51. package/.docs/reference/processors/cost-guard-processor.md +1 -0
  52. package/.docs/reference/processors/message-history-processor.md +1 -0
  53. package/.docs/reference/processors/moderation-processor.md +2 -0
  54. package/.docs/reference/processors/pii-detector.md +2 -0
  55. package/.docs/reference/processors/prefill-error-handler.md +2 -0
  56. package/.docs/reference/processors/processor-interface.md +3 -2
  57. package/.docs/reference/processors/prompt-injection-detector.md +1 -0
  58. package/.docs/reference/processors/provider-history-compat.md +2 -0
  59. package/.docs/reference/processors/regex-filter-processor.md +1 -0
  60. package/.docs/reference/processors/response-cache.md +1 -0
  61. package/.docs/reference/processors/semantic-recall-processor.md +1 -0
  62. package/.docs/reference/processors/skill-search-processor.md +1 -0
  63. package/.docs/reference/processors/stream-error-retry-processor.md +2 -0
  64. package/.docs/reference/processors/system-prompt-scrubber.md +1 -0
  65. package/.docs/reference/processors/token-limiter-processor.md +3 -0
  66. package/.docs/reference/processors/tool-call-filter.md +2 -0
  67. package/.docs/reference/processors/tool-search-processor.md +2 -0
  68. package/.docs/reference/processors/working-memory-processor.md +1 -0
  69. package/.docs/reference/signals/signal-provider.md +1 -0
  70. package/.docs/reference/signals/task-signal-provider.md +1 -0
  71. package/.docs/reference/signals/webhook-signal-provider.md +1 -0
  72. package/.docs/reference/templates/overview.md +1 -0
  73. package/.docs/reference/tools/create-code-mode.md +1 -0
  74. package/.docs/reference/tools/create-tool.md +2 -0
  75. package/.docs/reference/tools/mcp-client.md +1 -0
  76. package/.docs/reference/tools/mcp-server.md +1 -1
  77. package/.docs/reference/voice/voice.addInstructions.md +1 -0
  78. package/.docs/reference/workspace/agentcore-runtime-sandbox.md +1 -0
  79. package/.docs/reference/workspace/agentfs-filesystem.md +1 -0
  80. package/.docs/reference/workspace/apple-container-sandbox.md +257 -0
  81. package/.docs/reference/workspace/archil-filesystem.md +1 -0
  82. package/.docs/reference/workspace/azure-blob-filesystem.md +1 -0
  83. package/.docs/reference/workspace/docker-sandbox.md +1 -0
  84. package/.docs/reference/workspace/e2b-sandbox.md +1 -0
  85. package/.docs/reference/workspace/files-sdk-filesystem.md +1 -0
  86. package/.docs/reference/workspace/gcs-filesystem.md +1 -0
  87. package/.docs/reference/workspace/mesa-filesystem.md +319 -0
  88. package/.docs/reference/workspace/s3-filesystem.md +1 -0
  89. package/.docs/reference/workspace/vercel.md +1 -0
  90. package/CHANGELOG.md +22 -0
  91. package/package.json +5 -5
@@ -63,6 +63,7 @@ import { createDiscordAdapter } from '@chat-adapter/discord'
63
63
  import { createSlackAdapter } from '@chat-adapter/slack'
64
64
 
65
65
  const agent = new Agent({
66
+ id: 'example',
66
67
  name: 'Example',
67
68
  instructions: '...',
68
69
  model: 'openai/gpt-5.5',
@@ -118,6 +119,7 @@ import { Agent } from '@mastra/core/agent'
118
119
  import { createSlackAdapter } from '@chat-adapter/slack'
119
120
 
120
121
  const agent = new Agent({
122
+ id: 'streaming-agent',
121
123
  name: 'Streaming Agent',
122
124
  instructions: '...',
123
125
  model: 'openai/gpt-5.5',
@@ -145,6 +147,7 @@ import { defaultTypingStatus } from '@mastra/core/channels'
145
147
  import { createDiscordAdapter } from '@chat-adapter/discord'
146
148
 
147
149
  const agent = new Agent({
150
+ id: 'custom-typing-agent',
148
151
  name: 'Custom Typing Agent',
149
152
  instructions: '...',
150
153
  model: 'openai/gpt-5.5',
@@ -177,6 +180,7 @@ import { Agent } from '@mastra/core/agent'
177
180
  import { createSlackAdapter } from '@chat-adapter/slack'
178
181
 
179
182
  const agent = new Agent({
183
+ id: 'custom-handler-agent',
180
184
  name: 'Custom Handler Agent',
181
185
  instructions: '...',
182
186
  model: 'openai/gpt-5.5',
@@ -222,6 +226,7 @@ import { Agent } from '@mastra/core/agent'
222
226
  import { createSlackAdapter } from '@chat-adapter/slack'
223
227
 
224
228
  const agent = new Agent({
229
+ id: 'sso-agent',
225
230
  name: 'SSO Agent',
226
231
  instructions: '...',
227
232
  model: 'openai/gpt-5.5',
@@ -155,6 +155,7 @@ const hallucinationScorer = createHallucinationScorer({
155
155
  })
156
156
 
157
157
  const agent = new Agent({
158
+ id: 'my-agent',
158
159
  name: 'my-agent',
159
160
  model: 'openai/gpt-5.5',
160
161
  instructions: 'You are a helpful assistant.',
@@ -219,6 +219,7 @@ Measure how well your AI agents follow user instructions:
219
219
 
220
220
  ```typescript
221
221
  const agent = new Agent({
222
+ id: 'coding-assistant',
222
223
  name: 'CodingAssistant',
223
224
  instructions: 'You are a helpful coding assistant. Always provide working code examples.',
224
225
  model: 'openai/gpt-5.5',
@@ -348,6 +348,7 @@ The Reference section provides documentation of Mastra's API, including paramete
348
348
  - [.timeTravel()](https://mastra.ai/reference/workflows/run-methods/timeTravel)
349
349
  - [AgentCoreRuntimeSandbox](https://mastra.ai/reference/workspace/agentcore-runtime-sandbox)
350
350
  - [AgentFSFilesystem](https://mastra.ai/reference/workspace/agentfs-filesystem)
351
+ - [AppleContainerSandbox](https://mastra.ai/reference/workspace/apple-container-sandbox)
351
352
  - [ArchilFilesystem](https://mastra.ai/reference/workspace/archil-filesystem)
352
353
  - [AzureBlobFilesystem](https://mastra.ai/reference/workspace/azure-blob-filesystem)
353
354
  - [BlaxelSandbox](https://mastra.ai/reference/workspace/blaxel-sandbox)
@@ -359,6 +360,7 @@ The Reference section provides documentation of Mastra's API, including paramete
359
360
  - [GoogleDriveFilesystem](https://mastra.ai/reference/workspace/google-drive-filesystem)
360
361
  - [LocalFilesystem](https://mastra.ai/reference/workspace/local-filesystem)
361
362
  - [LocalSandbox](https://mastra.ai/reference/workspace/local-sandbox)
363
+ - [MesaFilesystem](https://mastra.ai/reference/workspace/mesa-filesystem)
362
364
  - [ModalSandbox](https://mastra.ai/reference/workspace/modal-sandbox)
363
365
  - [RailwaySandbox](https://mastra.ai/reference/workspace/railway-sandbox)
364
366
  - [S3Filesystem](https://mastra.ai/reference/workspace/s3-filesystem)
@@ -9,6 +9,7 @@ import { Memory } from '@mastra/memory'
9
9
  import { Agent } from '@mastra/core/agent'
10
10
 
11
11
  export const agent = new Agent({
12
+ id: 'test-agent',
12
13
  name: 'test-agent',
13
14
  instructions: 'You are an agent with memory.',
14
15
  model: 'openai/gpt-5.5',
@@ -11,6 +11,7 @@ import { Memory } from '@mastra/memory'
11
11
  import { Agent } from '@mastra/core/agent'
12
12
 
13
13
  export const agent = new Agent({
14
+ id: 'my-agent',
14
15
  name: 'my-agent',
15
16
  instructions: 'You are a helpful assistant.',
16
17
  model: 'openai/gpt-5-mini',
@@ -203,6 +204,7 @@ import { Memory } from '@mastra/memory'
203
204
  import { Agent } from '@mastra/core/agent'
204
205
 
205
206
  export const agent = new Agent({
207
+ id: 'my-agent',
206
208
  name: 'my-agent',
207
209
  instructions: 'You are a helpful assistant.',
208
210
  model: 'openai/gpt-5-mini',
@@ -232,6 +234,7 @@ import { Memory } from '@mastra/memory'
232
234
  import { Agent } from '@mastra/core/agent'
233
235
 
234
236
  export const agent = new Agent({
237
+ id: 'my-agent',
235
238
  name: 'my-agent',
236
239
  instructions: 'You are a helpful assistant.',
237
240
  model: 'openai/gpt-5-mini',
@@ -261,6 +264,7 @@ import { Memory } from '@mastra/memory'
261
264
  import { Agent } from '@mastra/core/agent'
262
265
 
263
266
  export const agent = new Agent({
267
+ id: 'my-agent',
264
268
  name: 'my-agent',
265
269
  instructions: 'You are a helpful assistant.',
266
270
  model: 'openai/gpt-5.5',
@@ -281,6 +285,7 @@ import { Memory } from '@mastra/memory'
281
285
  import { Agent } from '@mastra/core/agent'
282
286
 
283
287
  export const agent = new Agent({
288
+ id: 'my-agent',
284
289
  name: 'my-agent',
285
290
  instructions: 'You are a helpful assistant.',
286
291
  model: 'openai/gpt-5.5',
@@ -308,6 +313,7 @@ import { Memory } from '@mastra/memory'
308
313
  import { Agent } from '@mastra/core/agent'
309
314
 
310
315
  export const agent = new Agent({
316
+ id: 'health-assistant',
311
317
  name: 'health-assistant',
312
318
  instructions: 'You are a health and wellness assistant.',
313
319
  model: 'openai/gpt-5.5',
@@ -351,6 +357,7 @@ import { Memory } from '@mastra/memory'
351
357
  import { Agent } from '@mastra/core/agent'
352
358
 
353
359
  export const agent = new Agent({
360
+ id: 'my-agent',
354
361
  name: 'my-agent',
355
362
  instructions: 'You are a helpful assistant.',
356
363
  model: 'openai/gpt-5-mini',
@@ -666,6 +673,7 @@ const om = new ObservationalMemory({
666
673
  })
667
674
 
668
675
  export const agent = new Agent({
676
+ id: 'my-agent',
669
677
  name: 'my-agent',
670
678
  instructions: 'You are a helpful assistant.',
671
679
  model: 'openai/gpt-5-mini',
@@ -102,6 +102,7 @@ const exporter = new LangfuseExporter()
102
102
  const prompt = await exporter.client.prompt.get('customer-support', { type: 'text' })
103
103
 
104
104
  const agent = new Agent({
105
+ id: 'support-agent',
105
106
  name: 'support-agent',
106
107
  instructions: prompt.compile(),
107
108
  model: 'openai/gpt-5.5',
@@ -41,6 +41,7 @@ import { Agent } from '@mastra/core/agent'
41
41
  import { BatchPartsProcessor } from '@mastra/core/processors'
42
42
 
43
43
  export const agent = new Agent({
44
+ id: 'batched-agent',
44
45
  name: 'batched-agent',
45
46
  instructions: 'You are a helpful assistant',
46
47
  model: 'openai/gpt-5.5',
@@ -55,6 +55,7 @@ costGuard.onViolation = ({ detail }) => {
55
55
  }
56
56
 
57
57
  const agent = new Agent({
58
+ id: 'my-agent',
58
59
  name: 'my-agent',
59
60
  model: 'openai/gpt-5-nano',
60
61
  processors: {
@@ -43,6 +43,7 @@ const storage = new PostgresStorage({
43
43
  })
44
44
 
45
45
  export const agent = new Agent({
46
+ id: 'memory-agent',
46
47
  name: 'memory-agent',
47
48
  instructions: 'You are a helpful assistant with conversation memory',
48
49
  model: 'openai/gpt-5.5',
@@ -57,6 +57,7 @@ import { Agent } from '@mastra/core/agent'
57
57
  import { ModerationProcessor } from '@mastra/core/processors'
58
58
 
59
59
  export const agent = new Agent({
60
+ id: 'moderated-agent',
60
61
  name: 'moderated-agent',
61
62
  instructions: 'You are a helpful assistant',
62
63
  model: 'openai/gpt-5.5',
@@ -82,6 +83,7 @@ import { Agent } from '@mastra/core/agent'
82
83
  import { BatchPartsProcessor, ModerationProcessor } from '@mastra/core/processors'
83
84
 
84
85
  export const agent = new Agent({
86
+ id: 'output-moderated-agent',
85
87
  name: 'output-moderated-agent',
86
88
  instructions: 'You are a helpful assistant',
87
89
  model: 'openai/gpt-5.5',
@@ -59,6 +59,7 @@ import { Agent } from '@mastra/core/agent'
59
59
  import { PIIDetector } from '@mastra/core/processors'
60
60
 
61
61
  export const agent = new Agent({
62
+ id: 'private-agent',
62
63
  name: 'private-agent',
63
64
  instructions: 'You are a helpful assistant',
64
65
  model: 'openai/gpt-5.5',
@@ -87,6 +88,7 @@ import { Agent } from '@mastra/core/agent'
87
88
  import { BatchPartsProcessor, PIIDetector } from '@mastra/core/processors'
88
89
 
89
90
  export const agent = new Agent({
91
+ id: 'output-pii-agent',
90
92
  name: 'output-pii-agent',
91
93
  instructions: 'You are a helpful assistant',
92
94
  model: 'openai/gpt-5.5',
@@ -24,6 +24,7 @@ import { Agent } from '@mastra/core/agent'
24
24
  import { PrefillErrorHandler } from '@mastra/core/processors'
25
25
 
26
26
  export const agent = new Agent({
27
+ id: 'my-agent',
27
28
  name: 'my-agent',
28
29
  instructions: 'You are a helpful assistant.',
29
30
  model: 'anthropic/claude-opus-4-7',
@@ -45,6 +46,7 @@ const customErrorHandler: Processor = {
45
46
  }
46
47
 
47
48
  export const agent = new Agent({
49
+ id: 'my-agent',
48
50
  name: 'my-agent',
49
51
  instructions: 'You are a helpful assistant.',
50
52
  model: 'anthropic/claude-opus-4-7',
@@ -726,7 +726,7 @@ Configure processors that implement `processAPIError` in `errorProcessors`:
726
726
 
727
727
  ```typescript
728
728
  const agent = new Agent({
729
- // ...
729
+ id: 'agent',
730
730
  errorProcessors: [new PrefillErrorHandler()],
731
731
  })
732
732
  ```
@@ -987,6 +987,7 @@ import { Agent } from '@mastra/core/agent'
987
987
  import { PrefillErrorHandler } from '@mastra/core/processors'
988
988
 
989
989
  const agent = new Agent({
990
+ id: 'support-agent',
990
991
  name: 'support-agent',
991
992
  model: 'openai/gpt-5',
992
993
  instructions: '...',
@@ -1005,7 +1006,7 @@ Each array also accepts a function so processors can be built per-request from `
1005
1006
 
1006
1007
  ```typescript
1007
1008
  new Agent({
1008
- // ...
1009
+ id: 'processor-interface-agent',
1009
1010
  inputProcessors: ({ requestContext }) => {
1010
1011
  const blockedWords = requestContext.get('blockedWords') ?? []
1011
1012
  return [new ContentFilter(blockedWords)]
@@ -51,6 +51,7 @@ import { Agent } from '@mastra/core/agent'
51
51
  import { PromptInjectionDetector } from '@mastra/core/processors'
52
52
 
53
53
  export const agent = new Agent({
54
+ id: 'secure-agent',
54
55
  name: 'secure-agent',
55
56
  instructions: 'You are a helpful assistant',
56
57
  model: 'openai/gpt-5.5',
@@ -13,6 +13,7 @@ import { Agent } from '@mastra/core/agent'
13
13
  import { ProviderHistoryCompat } from '@mastra/core/processors'
14
14
 
15
15
  export const agent = new Agent({
16
+ id: 'my-agent',
16
17
  name: 'my-agent',
17
18
  instructions: 'You are a helpful assistant.',
18
19
  model: 'anthropic/claude-sonnet-4-5',
@@ -112,6 +113,7 @@ const stripUnsupportedAssistantMetadata: CompatRule = {
112
113
  }
113
114
 
114
115
  export const agent = new Agent({
116
+ id: 'custom-provider-agent',
115
117
  name: 'custom-provider-agent',
116
118
  instructions: 'You are a helpful assistant.',
117
119
  model: 'example-provider/model',
@@ -48,6 +48,7 @@ import { Agent } from '@mastra/core/agent'
48
48
  import { RegexFilterProcessor } from '@mastra/core/processors'
49
49
 
50
50
  const agent = new Agent({
51
+ id: 'my-agent',
51
52
  name: 'my-agent',
52
53
  model: 'openai/gpt-5-nano',
53
54
  processors: {
@@ -16,6 +16,7 @@ import { ResponseCache } from '@mastra/core/processors'
16
16
  const cache = new InMemoryServerCache()
17
17
 
18
18
  const agent = new Agent({
19
+ id: 'search-agent',
19
20
  name: 'Search Agent',
20
21
  instructions: 'You answer questions concisely.',
21
22
  model: 'openai/gpt-5',
@@ -80,6 +80,7 @@ const semanticRecall = new SemanticRecall({
80
80
  })
81
81
 
82
82
  export const agent = new Agent({
83
+ id: 'semantic-memory-agent',
83
84
  name: 'semantic-memory-agent',
84
85
  instructions: 'You are a helpful assistant with semantic memory recall',
85
86
  model: 'openai/gpt-5.5',
@@ -71,6 +71,7 @@ const skillSearch = new SkillSearchProcessor({
71
71
  })
72
72
 
73
73
  const agent = new Agent({
74
+ id: 'skill-agent',
74
75
  name: 'skill-agent',
75
76
  instructions:
76
77
  'You are a helpful assistant. Use search_skills to find relevant skills, then load_skill to load their instructions.',
@@ -13,6 +13,7 @@ import { Agent } from '@mastra/core/agent'
13
13
  import { StreamErrorRetryProcessor } from '@mastra/core/processors'
14
14
 
15
15
  export const agent = new Agent({
16
+ id: 'openai-agent',
16
17
  name: 'openai-agent',
17
18
  instructions: 'You are a helpful assistant.',
18
19
  model: 'openai/gpt-5',
@@ -49,6 +50,7 @@ const isECONNRESET = (error: unknown) => {
49
50
  }
50
51
 
51
52
  export const agent = new Agent({
53
+ id: 'resilient-agent',
52
54
  name: 'resilient-agent',
53
55
  instructions: 'You are a helpful assistant.',
54
56
  model: 'openai/gpt-5',
@@ -55,6 +55,7 @@ import { Agent } from '@mastra/core/agent'
55
55
  import { BatchPartsProcessor, SystemPromptScrubber } from '@mastra/core/processors'
56
56
 
57
57
  export const agent = new Agent({
58
+ id: 'scrubbed-agent',
58
59
  name: 'scrubbed-agent',
59
60
  instructions: 'You are a helpful assistant',
60
61
  model: 'openai/gpt-5.5',
@@ -79,6 +79,7 @@ import { Memory } from '@mastra/memory'
79
79
  import { TokenLimiterProcessor } from '@mastra/core/processors'
80
80
 
81
81
  export const agent = new Agent({
82
+ id: 'context-limited-agent',
82
83
  name: 'context-limited-agent',
83
84
  instructions: 'You are a helpful assistant',
84
85
  model: 'openai/gpt-5.5',
@@ -100,6 +101,7 @@ import { Agent } from '@mastra/core/agent'
100
101
  import { TokenLimiterProcessor } from '@mastra/core/processors'
101
102
 
102
103
  export const agent = new Agent({
104
+ id: 'multi-step-agent',
103
105
  name: 'multi-step-agent',
104
106
  instructions: 'You are a helpful research assistant with access to tools',
105
107
  model: 'openai/gpt-5.5',
@@ -123,6 +125,7 @@ import { Agent } from '@mastra/core/agent'
123
125
  import { TokenLimiterProcessor } from '@mastra/core/processors'
124
126
 
125
127
  export const agent = new Agent({
128
+ id: 'response-limited-agent',
126
129
  name: 'response-limited-agent',
127
130
  instructions: 'You are a helpful assistant',
128
131
  model: 'openai/gpt-5.5',
@@ -88,6 +88,7 @@ import { Agent } from '@mastra/core/agent'
88
88
  import { ToolCallFilter } from '@mastra/core/processors'
89
89
 
90
90
  export const agent = new Agent({
91
+ id: 'filtered-agent',
91
92
  name: 'filtered-agent',
92
93
  instructions: 'You are a helpful assistant',
93
94
  model: 'openai/gpt-5.5',
@@ -113,6 +114,7 @@ import { Agent } from '@mastra/core/agent'
113
114
  import { ToolCallFilter } from '@mastra/core/processors'
114
115
 
115
116
  export const agent = new Agent({
117
+ id: 'no-tools-context-agent',
116
118
  name: 'no-tools-context-agent',
117
119
  instructions: 'You are a helpful assistant',
118
120
  model: 'openai/gpt-5.5',
@@ -144,6 +144,7 @@ const toolSearch = new ToolSearchProcessor({
144
144
  })
145
145
 
146
146
  const agent = new Agent({
147
+ id: 'dynamic-tools-agent',
147
148
  name: 'dynamic-tools-agent',
148
149
  instructions:
149
150
  'You are a helpful assistant with access to many tools. Use search_tools to find relevant tools, then load_tool to make them available.',
@@ -225,6 +226,7 @@ import { Agent } from '@mastra/core/agent'
225
226
  import { ToolSearchProcessor, TokenLimiter } from '@mastra/core/processors'
226
227
 
227
228
  const agent = new Agent({
229
+ id: 'my-agent',
228
230
  name: 'my-agent',
229
231
  model: 'openai/gpt-5.5',
230
232
  inputProcessors: [
@@ -65,6 +65,7 @@ const storage = new PostgresStorage({
65
65
  })
66
66
 
67
67
  export const agent = new Agent({
68
+ id: 'personalized-agent',
68
69
  name: 'personalized-agent',
69
70
  instructions: 'You are a helpful assistant that remembers user preferences',
70
71
  model: 'openai/gpt-5.5',
@@ -44,6 +44,7 @@ Register with an agent:
44
44
  import { Agent } from '@mastra/core/agent'
45
45
 
46
46
  const agent = new Agent({
47
+ id: 'agent',
47
48
  signals: [new SlackSignals()],
48
49
  })
49
50
  ```
@@ -13,6 +13,7 @@ import { Agent } from '@mastra/core/agent'
13
13
  import { TaskSignalProvider } from '@mastra/core/signals'
14
14
 
15
15
  const agent = new Agent({
16
+ id: 'coder',
16
17
  name: 'coder',
17
18
  instructions: '...',
18
19
  model,
@@ -30,6 +30,7 @@ Register with an agent and subscribe a thread:
30
30
  import { Agent } from '@mastra/core/agent'
31
31
 
32
32
  const agent = new Agent({
33
+ id: 'agent',
33
34
  signals: [webhookProvider],
34
35
  })
35
36
 
@@ -201,6 +201,7 @@ We recommend using OpenAI, Anthropic, or Google model providers for templates. C
201
201
  import { Agent } from '@mastra/core/agent'
202
202
 
203
203
  const agent = new Agent({
204
+ id: 'example-agent',
204
205
  name: 'example-agent',
205
206
  model: 'openai/gpt-5.5', // or other provider strings
206
207
  instructions: 'Your agent instructions here',
@@ -40,6 +40,7 @@ const { tool, instructions } = createCodeMode({
40
40
  })
41
41
 
42
42
  export const shopAgent = new Agent({
43
+ id: 'shop-assistant',
43
44
  name: 'shop-assistant',
44
45
  instructions: ['You are a helpful shopping assistant.', instructions],
45
46
  model: 'openai/gpt-5.5',
@@ -298,6 +298,8 @@ export const weatherTool = createTool({
298
298
 
299
299
  **execute.context.mcp** (`MCPToolExecutionContext`): MCP-specific context (elicitation, etc.)
300
300
 
301
+ **execute.context.observe** (`ToolObserve`): Observability helpers for recording child spans and structured logs from inside a tool's execute function. Always provided — when no tracing context is active, \`span\` runs the function directly and \`log\` is a no-op.
302
+
301
303
  **onInputStart** (`function`): Optional callback invoked when the tool call input streaming begins. Receives \`toolCallId\`, \`messages\`, and \`abortSignal\`.
302
304
 
303
305
  **onInputDelta** (`function`): Optional callback invoked for each incremental chunk of input text as it streams in. Receives \`inputTextDelta\`, \`toolCallId\`, \`messages\`, and \`abortSignal\`.
@@ -1063,6 +1063,7 @@ const mcpClient = new MCPClient({
1063
1063
 
1064
1064
  // Use with an agent — requestContext is automatically forwarded
1065
1065
  const agent = new Agent({
1066
+ id: 'my-agent',
1066
1067
  name: 'My Agent',
1067
1068
  instructions: 'You are a helpful assistant.',
1068
1069
  model: openai('gpt-5.4'),
@@ -112,7 +112,7 @@ When you provide agents in the `agents` configuration property, `MCPServer` will
112
112
 
113
113
  The description for this generated tool will be: "Ask agent `<agent.name>` a question. Agent description: `<agent.description>`".
114
114
 
115
- **Important**: For an agent to be converted into a tool, it **must** have a non-empty `description` string property set in its configuration when it was instantiated (e.g., `new Agent({ name: 'myAgent', description: 'This agent does X.', ... })`). If an agent is passed to `MCPServer` with a missing or empty `description`, an error will be thrown when the `MCPServer` is instantiated, and server setup will fail.
115
+ **Important**: For an agent to be converted into a tool, it **must** have a non-empty `description` string property set in its configuration when it was instantiated (e.g., `new Agent({ id: 'my-agent', name: 'myAgent', description: 'This agent does X.', ... })`). If an agent is passed to `MCPServer` with a missing or empty `description`, an error will be thrown when the `MCPServer` is instantiated, and server setup will fail.
116
116
 
117
117
  This allows you to quickly expose the generative capabilities of your agents through the MCP, enabling clients to "ask" your agents questions directly.
118
118
 
@@ -18,6 +18,7 @@ const voice = new OpenAIRealtimeVoice({
18
18
 
19
19
  // Create an agent with the voice provider
20
20
  const agent = new Agent({
21
+ id: 'customer-support-agent',
21
22
  name: 'Customer Support Agent',
22
23
  instructions: 'You are a helpful customer support agent for a software company.',
23
24
  model: 'openai/gpt-5.5',
@@ -52,6 +52,7 @@ const workspace = new Workspace({
52
52
  })
53
53
 
54
54
  const agent = new Agent({
55
+ id: 'dev-agent',
55
56
  name: 'dev-agent',
56
57
  model: 'anthropic/claude-sonnet-4-6',
57
58
  instructions: 'You are a helpful development assistant.',
@@ -46,6 +46,7 @@ const workspace = new Workspace({
46
46
  })
47
47
 
48
48
  const agent = new Agent({
49
+ id: 'file-agent',
49
50
  name: 'file-agent',
50
51
  model: 'openai/gpt-5.5',
51
52
  workspace,