@mastra/mcp-docs-server 1.3.11-alpha.0 → 1.3.11-alpha.2

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 (87) hide show
  1. package/.docs/course/01-first-agent/16-adding-memory-to-agent.md +7 -1
  2. package/.docs/course/02-agent-tools-mcp/25-creating-notes-directory.md +8 -0
  3. package/.docs/course/02-agent-tools-mcp/26-updating-mcp-config-filesystem.md +10 -7
  4. package/.docs/course/02-agent-tools-mcp/27-updating-agent-instructions-filesystem.md +3 -1
  5. package/.docs/course/02-agent-tools-mcp/29-troubleshooting-filesystem.md +3 -2
  6. package/.docs/course/02-agent-tools-mcp/31-enhancing-memory-configuration.md +2 -2
  7. package/.docs/course/03-agent-memory/04-creating-basic-memory-agent.md +3 -1
  8. package/.docs/course/03-agent-memory/08-configuring-conversation-history.md +1 -1
  9. package/.docs/course/03-agent-memory/09-using-memory-in-application.md +8 -6
  10. package/.docs/course/03-agent-memory/10-storage-configuration.md +11 -1
  11. package/.docs/course/03-agent-memory/12-handling-memory-frontend.md +5 -3
  12. package/.docs/course/03-agent-memory/13-vector-store-configuration.md +4 -2
  13. package/.docs/course/03-agent-memory/16-configuring-semantic-recall.md +2 -2
  14. package/.docs/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +2 -2
  15. package/.docs/course/03-agent-memory/21-configuring-working-memory.md +2 -2
  16. package/.docs/course/03-agent-memory/22-custom-working-memory-templates.md +2 -5
  17. package/.docs/course/03-agent-memory/25-combining-memory-features.md +2 -2
  18. package/.docs/course/03-agent-memory/27-creating-learning-assistant.md +2 -2
  19. package/.docs/course/04-workflows/05-chaining-steps-together.md +2 -1
  20. package/.docs/course/04-workflows/12-using-agent-in-workflow.md +11 -14
  21. package/.docs/course/04-workflows/20-building-conditional-workflow.md +32 -6
  22. package/.docs/docs/agents/guardrails.md +1 -1
  23. package/.docs/docs/agents/human-in-the-loop.md +1 -1
  24. package/.docs/docs/agents/structured-output.md +11 -0
  25. package/.docs/docs/channels.md +2 -0
  26. package/.docs/docs/classifier.md +103 -0
  27. package/.docs/docs/deployment/mastra-server.md +3 -1
  28. package/.docs/docs/evals/custom-scorers.md +20 -0
  29. package/.docs/docs/evals/quick-checks.md +7 -7
  30. package/.docs/docs/guides/context-engineering.md +2 -2
  31. package/.docs/docs/mastra-platform/observability.md +1 -1
  32. package/.docs/docs/memory/memory-processors.md +49 -3
  33. package/.docs/docs/memory/observational-memory.md +27 -1
  34. package/.docs/docs/observability/tracing/overview.md +41 -1
  35. package/.docs/docs/workflows/control-flow.md +1 -1
  36. package/.docs/integrations/databases/postgresql.md +31 -0
  37. package/.docs/integrations/deploy/vercel.md +11 -0
  38. package/.docs/integrations/observability/langfuse.md +13 -0
  39. package/.docs/models/gateways/netlify.md +2 -5
  40. package/.docs/models/gateways/openrouter.md +2 -11
  41. package/.docs/models/gateways/vercel.md +1 -1
  42. package/.docs/models/index.md +1 -1
  43. package/.docs/models/providers/cortecs.md +1 -1
  44. package/.docs/models/providers/deepinfra.md +0 -1
  45. package/.docs/models/providers/edenai.md +25 -4
  46. package/.docs/models/providers/empiriolabs.md +2 -1
  47. package/.docs/models/providers/google.md +1 -4
  48. package/.docs/models/providers/inceptron.md +4 -4
  49. package/.docs/models/providers/kilo.md +13 -27
  50. package/.docs/models/providers/llmgateway-providers.md +16 -21
  51. package/.docs/models/providers/llmgateway.md +4 -3
  52. package/.docs/models/providers/melious.md +10 -10
  53. package/.docs/models/providers/mistral.md +25 -24
  54. package/.docs/models/providers/nano-gpt.md +10 -21
  55. package/.docs/models/providers/nvidia.md +0 -1
  56. package/.docs/models/providers/ofox.md +3 -1
  57. package/.docs/models/providers/openai.md +1 -4
  58. package/.docs/models/providers/opencode.md +0 -1
  59. package/.docs/models/providers/scaleway.md +1 -1
  60. package/.docs/reference/agents/channels.md +61 -1
  61. package/.docs/reference/agents/generate.md +0 -10
  62. package/.docs/reference/agents/generateLegacy.md +0 -10
  63. package/.docs/reference/agents/network.md +0 -10
  64. package/.docs/reference/browser/agent-browser.md +7 -3
  65. package/.docs/reference/browser/mastra-browser.md +34 -0
  66. package/.docs/reference/classifier/classifier.md +3 -1
  67. package/.docs/reference/client-js/observability.md +16 -15
  68. package/.docs/reference/configuration.md +3 -1
  69. package/.docs/reference/connect/providers.md +65 -1
  70. package/.docs/reference/core/getDeployer.md +1 -1
  71. package/.docs/reference/core/mastra-class.md +1 -1
  72. package/.docs/reference/deployer/vercel.md +24 -1
  73. package/.docs/reference/editor/mastra-editor.md +1 -1
  74. package/.docs/reference/evals/tool-call-accuracy.md +7 -4
  75. package/.docs/reference/memory/memory-class.md +77 -0
  76. package/.docs/reference/observability/tracing/advanced-queries.md +33 -16
  77. package/.docs/reference/observability/tracing/exporters/langfuse.md +11 -0
  78. package/.docs/reference/observability/tracing/exporters/otel.md +123 -3
  79. package/.docs/reference/observability/tracing/interfaces.md +15 -0
  80. package/.docs/reference/observability/tracing/spans.md +1 -1
  81. package/.docs/reference/signals/signal-provider.md +42 -1
  82. package/.docs/reference/streaming/agents/stream.md +19 -10
  83. package/.docs/reference/streaming/agents/streamLegacy.md +0 -10
  84. package/.docs/reference/workspace/factory-sandbox.md +18 -0
  85. package/.docs/reference/workspace/filesystem.md +1 -1
  86. package/.docs/reference/workspace/local-filesystem.md +1 -1
  87. package/package.json +3 -3
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Ofox logo](https://models.dev/logos/ofox.svg)Ofox
6
6
 
7
- Access 148 Ofox models through Mastra's model router. Authentication is handled automatically using the `OFOX_API_KEY` environment variable.
7
+ Access 150 Ofox models through Mastra's model router. Authentication is handled automatically using the `OFOX_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Ofox documentation](https://ofox.ai/docs).
10
10
 
@@ -109,6 +109,7 @@ for await (const chunk of stream) {
109
109
  | `ofox/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
110
110
  | `ofox/moonshotai/kimi-k2.7-code-highspeed` | 262K | | | | | | $2 | $8 |
111
111
  | `ofox/moonshotai/kimi-k3` | 1.0M | | | | | | $3 | $15 |
112
+ | `ofox/moonshotai/kimi-k3.1-pro` | 1.0M | | | | | | $2 | $11 |
112
113
  | `ofox/openai/gpt-4.1` | 1.0M | | | | | | $2 | $8 |
113
114
  | `ofox/openai/gpt-4.1-mini` | 1.0M | | | | | | $0.40 | $2 |
114
115
  | `ofox/openai/gpt-4o` | 128K | | | | | | $3 | $10 |
@@ -134,6 +135,7 @@ for await (const chunk of stream) {
134
135
  | `ofox/openai/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
135
136
  | `ofox/openai/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
136
137
  | `ofox/openai/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
138
+ | `ofox/openai/gpt-6.1-terra` | 1.1M | | | | | | $1 | $5 |
137
139
  | `ofox/qwen/qwen-flash` | 1.0M | | | | | | $0.02 | $0.22 |
138
140
  | `ofox/qwen/qwen-max` | 32K | | | | | | $0.35 | $1 |
139
141
  | `ofox/qwen/qwen-plus` | 1.0M | | | | | | $0.12 | $0.29 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![OpenAI logo](https://models.dev/logos/openai.svg)OpenAI
6
6
 
7
- Access 52 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
7
+ Access 51 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [OpenAI documentation](https://platform.openai.com/docs/models).
10
10
 
@@ -36,7 +36,6 @@ for await (const chunk of stream) {
36
36
 
37
37
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
38
38
  | --------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
39
- | `openai/chatgpt-image-latest` | — | | | | | | — | — |
40
39
  | `openai/gpt-4.1` | 1.0M | | | | | | $2 | $8 |
41
40
  | `openai/gpt-4.1-mini` | 1.0M | | | | | | $0.40 | $2 |
42
41
  | `openai/gpt-4o` | 128K | | | | | | $3 | $10 |
@@ -69,8 +68,6 @@ for await (const chunk of stream) {
69
68
  | `openai/gpt-6.1-terra` | 1.1M | | | | | | $1 | $5 |
70
69
  | `openai/gpt-daybreak-blue-latest` | 1.1M | | | | | | $4 | $20 |
71
70
  | `openai/gpt-daybreak-red-latest` | 400K | | | | | | $13 | $75 |
72
- | `openai/gpt-image-1-mini` | — | | | | | | — | — |
73
- | `openai/gpt-image-1.5` | — | | | | | | — | — |
74
71
  | `openai/gpt-image-2` | — | | | | | | $5 | $30 |
75
72
  | `openai/gpt-realtime-2.1` | 128K | | | | | | $4 | $24 |
76
73
  | `openai/o3` | 200K | | | | | | $2 | $8 |
@@ -112,7 +112,6 @@ for await (const chunk of stream) {
112
112
  | `opencode/muse-spark-1.2` | 1.0M | | | | | | $1 | $4 |
113
113
  | `opencode/muse-spark-1.3` | 1.0M | | | | | | $1 | $4 |
114
114
  | `opencode/muse-wonder-1.0` | 1.0M | | | | | | $4 | $20 |
115
- | `opencode/nemotron-3-ultra-free` | 1.0M | | | | | | — | — |
116
115
  | `opencode/nemotron-3.5-lightning-free` | 262K | | | | | | — | — |
117
116
  | `opencode/nemotron-3.5-super-vl-free` | 1.0M | | | | | | — | — |
118
117
  | `opencode/qwen3.5-plus` | 262K | | | | | | $0.20 | $1 |
@@ -40,7 +40,7 @@ for await (const chunk of stream) {
40
40
  | ---------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
41
  | `scaleway/bge-multilingual-gemma2` | 8K | | | | | | $0.11 | — |
42
42
  | `scaleway/deepseek-v4-flash-0731` | 256K | | | | | | $0.47 | $0.94 |
43
- | `scaleway/deepseek-v4.1-flash` | 256K | | | | | | $0.67 | $2 |
43
+ | `scaleway/deepseek-v4.1-flash-1017` | 256K | | | | | | $0.67 | $2 |
44
44
  | `scaleway/gemma-4-26b-a4b-it` | 256K | | | | | | $0.28 | $0.56 |
45
45
  | `scaleway/glm-5.2` | 256K | | | | | | $2 | $6 |
46
46
  | `scaleway/glm-5.3` | 256K | | | | | | $2 | $6 |
@@ -145,7 +145,7 @@ toolDisplay: event => {
145
145
  }
146
146
  ```
147
147
 
148
- Approve/deny prompts (`requireApproval`) render as a separate built-in card in every string mode, because inline task entries can't carry interactive buttons. With a `toolDisplay` function, the `approval` event is passed to your function in both streaming and static modes; return a non-blank `{ kind: 'post', message }` to replace the built-in card with your own message (for example, a localized one). Returning `undefined`, a blank message, or `{ kind: 'stream' }` falls back to the built-in card so the user can still approve or deny the request.
148
+ Approve/deny prompts (`requireApproval`) render as a separate built-in card in every string mode, because inline task entries can't carry interactive buttons. With a `toolDisplay` function, the `approval` event is passed to your function in both streaming and static modes; return a non-blank `{ kind: 'post', message }` to replace the built-in card with your own message (for example, a localized one). Returning `undefined`, a blank message, or `{ kind: 'stream' }` falls back to the built-in card so the user can still approve or deny the request. Keep the button ids in the format the default action handler expects. See [Custom approval cards](#custom-approval-cards).
149
149
 
150
150
  ```typescript
151
151
  import { Agent } from '@mastra/core/agent'
@@ -168,6 +168,66 @@ const agent = new Agent({
168
168
  })
169
169
  ```
170
170
 
171
+ ### Custom approval cards
172
+
173
+ A custom approval message replaces the built-in card, but Mastra's default `onAction` handler still handles the button action. It only resumes the suspended run when the button ids are exactly:
174
+
175
+ - Approve: `tool_approve:<toolCallId>`
176
+ - Deny: `tool_deny:<toolCallId>`
177
+
178
+ `<toolCallId>` is `event.toolCallId` from the `approval` event. Any other id, including one with extra whitespace, doesn't match a pending approval. The run stays suspended. The default handler must also stay enabled: don't set `handlers.onAction: false`, and if you provide your own `onAction`, call `defaultHandler()` so approval clicks are processed.
179
+
180
+ A custom `toolDisplay` function replaces the built-in renderer for every tool event. The example below only renders approvals, so other tool calls post nothing; return a message for `result` and `error` events as well if you want those visible.
181
+
182
+ ```typescript
183
+ import { Agent } from '@mastra/core/agent'
184
+ import { createSlackAdapter } from '@chat-adapter/slack'
185
+
186
+ const agent = new Agent({
187
+ id: 'localized-approval-agent',
188
+ name: 'Localized Approval Agent',
189
+ instructions: '...',
190
+ model: 'openai/gpt-6.1-sol',
191
+ channels: {
192
+ adapters: {
193
+ slack: {
194
+ adapter: createSlackAdapter(),
195
+ toolDisplay: event => {
196
+ if (event.kind !== 'approval') return undefined
197
+
198
+ return {
199
+ kind: 'post',
200
+ message: {
201
+ type: 'card',
202
+ title: `Approve ${event.displayName}?`,
203
+ children: [
204
+ {
205
+ type: 'actions',
206
+ children: [
207
+ {
208
+ type: 'button',
209
+ id: `tool_approve:${event.toolCallId}`,
210
+ label: 'Genehmigen',
211
+ style: 'primary',
212
+ },
213
+ {
214
+ type: 'button',
215
+ id: `tool_deny:${event.toolCallId}`,
216
+ label: 'Ablehnen',
217
+ style: 'danger',
218
+ },
219
+ ],
220
+ },
221
+ ],
222
+ },
223
+ }
224
+ },
225
+ },
226
+ },
227
+ },
228
+ })
229
+ ```
230
+
171
231
  ## Custom typing status
172
232
 
173
233
  Pass a function to `typingStatus` to customize the status copy. The function is called once per stream chunk; return a string to set the status, or `false` / `null` / `undefined` to leave the current status unchanged. Return values are de-duplicated so the platform only sees a call when the status changes. When the run ends, any status it set is cleared automatically so runs that finish without posting a message don't leave a stale status on the thread.
@@ -144,16 +144,6 @@ const result = await agent.generate('message for agent')
144
144
 
145
145
  **options.onStepFinish** (`LoopConfig['onStepFinish']`): Callback fired after each generation step.
146
146
 
147
- **options.telemetry** (`TelemetrySettings`): Settings for OTLP telemetry collection during generation (not Tracing).
148
-
149
- **options.telemetry.isEnabled** (`boolean`): Whether telemetry collection is enabled.
150
-
151
- **options.telemetry.recordInputs** (`boolean`): Whether to record input data in telemetry.
152
-
153
- **options.telemetry.recordOutputs** (`boolean`): Whether to record output data in telemetry.
154
-
155
- **options.telemetry.functionId** (`string`): Identifier for the function being executed.
156
-
157
147
  **options.modelSettings** (`CallSettings`): Model-specific settings like temperature, maxOutputTokens, topP, etc. These settings control how the language model generates responses.
158
148
 
159
149
  **options.modelSettings.temperature** (`number`): Controls randomness in generation (0-2). Higher values make output more random.
@@ -68,16 +68,6 @@ Scorer judges with legacy model adapters call `generateLegacy()`. They don't rec
68
68
 
69
69
  **options.runId** (`string`): Unique ID for this generation run. Useful for tracking and debugging purposes.
70
70
 
71
- **options.telemetry** (`TelemetrySettings`): Settings for telemetry collection during generation.
72
-
73
- **options.telemetry.isEnabled** (`boolean`): Enable or disable telemetry. Disabled by default while experimental.
74
-
75
- **options.telemetry.recordInputs** (`boolean`): Enable or disable input recording. Enabled by default. You might want to disable input recording to avoid recording sensitive information.
76
-
77
- **options.telemetry.recordOutputs** (`boolean`): Enable or disable output recording. Enabled by default. You might want to disable output recording to avoid recording sensitive information.
78
-
79
- **options.telemetry.functionId** (`string`): Identifier for this function. Used to group telemetry data by function.
80
-
81
71
  **options.temperature** (`number`): Controls randomness in the model's output. Higher values (e.g., 0.8) make the output more random, lower values (e.g., 0.2) make it more focused and deterministic.
82
72
 
83
73
  **options.toolChoice** (`'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }`): Controls how the agent uses tools during generation.
@@ -80,16 +80,6 @@ await agent.network(`
80
80
 
81
81
  **options.tracingOptions.tags** (`string[]`): Tags to apply to this trace. String labels for categorizing and filtering traces.
82
82
 
83
- **options.telemetry** (`TelemetrySettings`): Settings for OTLP telemetry collection during streaming (not Tracing).
84
-
85
- **options.telemetry.isEnabled** (`boolean`): Enable or disable telemetry. Disabled by default while experimental.
86
-
87
- **options.telemetry.recordInputs** (`boolean`): Enable or disable input recording. Enabled by default. You might want to disable input recording to avoid recording sensitive information.
88
-
89
- **options.telemetry.recordOutputs** (`boolean`): Enable or disable output recording. Enabled by default. You might want to disable output recording to avoid recording sensitive information.
90
-
91
- **options.telemetry.functionId** (`string`): Identifier for this function. Used to group telemetry data by function.
92
-
93
83
  **options.modelSettings** (`CallSettings`): Model-specific settings like temperature, maxOutputTokens, topP, etc. These settings control how the language model generates responses.
94
84
 
95
85
  **options.modelSettings.temperature** (`number`): Controls randomness in generation (0-2). Higher values make output more random.
@@ -367,11 +367,15 @@ Capture a screenshot of the current page as PNG (viewport by default. Set `fullP
367
367
 
368
368
  // Full scrollable page
369
369
  { "fullPage": true }
370
+
371
+ // Also save the PNG to the workspace
372
+ { "path": "screenshots/home.png" }
370
373
  ```
371
374
 
372
- | Parameter | Type | Description |
373
- | ---------- | --------- | ---------------------------------------------------------------------------------------- |
374
- | `fullPage` | `boolean` | Capture the full scrollable page instead of only the viewport (optional, default: false) |
375
+ | Parameter | Type | Description |
376
+ | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
377
+ | `fullPage` | `boolean` | Capture the full scrollable page instead of only the viewport (optional, default: false) |
378
+ | `path` | `string` | Also save the PNG to this path in the agent's workspace. Missing folders are created. The model is told where the file went, or why it couldn't be saved (for example, when the agent has no workspace). Follows the workspace's write-file settings: nothing is saved when writing is turned off, needs approval, or the filesystem is read-only. The screenshot is returned either way (optional) |
375
379
 
376
380
  ### `browser_close`
377
381
 
@@ -143,6 +143,40 @@ Closes a specific thread's browser session. With 'thread' scope, it closes that
143
143
  await browser.closeThreadSession('thread-123')
144
144
  ```
145
145
 
146
+ ### Cookies
147
+
148
+ #### `setCookies(cookies, threadId?)`
149
+
150
+ Adds cookies to a thread's browser. Use it when your app can sign in to a site but the agent can't, such as a preview behind your own login. The cookie value never passes through the model. If the thread's browser hasn't opened yet, the cookies are added when it does. When `threadId` is omitted, the current thread is used.
151
+
152
+ ```typescript
153
+ await browser.setCookies(
154
+ [
155
+ {
156
+ name: 'my_app_session',
157
+ value: sessionToken,
158
+ domain: 'app.example.com',
159
+ path: '/',
160
+ httpOnly: true,
161
+ secure: true,
162
+ },
163
+ ],
164
+ threadId,
165
+ )
166
+ ```
167
+
168
+ Each cookie is a `BrowserCookie` from `@mastra/core/browser`: `name` and `value`, plus either `url` or `domain` and `path`, and optionally `expires` (Unix time in seconds), `httpOnly`, `secure` and `sameSite`. To cover subdomains, start `domain` with a dot (`.example.com`).
169
+
170
+ With `'thread'` scope, the cookies reach only that thread's browser. With `'shared'` scope every thread uses one browser, so they reach every thread.
171
+
172
+ Cookies still waiting for a browser are dropped when you call `close()`, and with `'thread'` scope when you close that thread with `closeThreadSession()`. With `'shared'` scope they stay until the shared browser opens.
173
+
174
+ A cookie must have either a `url` or both `domain` and `path`; otherwise, `setCookies` throws.
175
+
176
+ `AgentBrowser`, `BrowserViewer`, `FirecrawlBrowser` and `StagehandBrowser` support cookies. Other providers throw.
177
+
178
+ **Returns:** `Promise<void>`
179
+
146
180
  ### Tools
147
181
 
148
182
  #### `getTools()`
@@ -326,7 +326,7 @@ Input validation includes:
326
326
 
327
327
  Provider responses must contain exactly one answer for each question. Each answer must match the question type or be a refusal. The classifier also rejects invalid choices, out-of-range scores or probabilities, incomplete probability distributions, non-finite token counts, malformed warnings, and invalid response timestamps.
328
328
 
329
- Only retryable AI SDK `APICallError` failures are retried. Other errors reject immediately. When all retries fail, `decide()` rethrows the last provider error. Aborting the supplied signal rejects with the signal's abort reason, including when cancellation occurs during retry backoff.
329
+ Only retryable AI SDK `APICallError` failures are retried, two times by default. Set `maxRetries` to change the count. Other errors reject immediately. When all retries fail, `decide()` rethrows the last provider error. Aborting the supplied signal rejects with the signal's abort reason, including when cancellation occurs during retry backoff.
330
330
 
331
331
  ## Observability
332
332
 
@@ -334,6 +334,8 @@ When an active Mastra span exists, `decide()` creates a `CLASSIFIER_EVALUATION`
334
334
 
335
335
  To keep the state and answers out of exported traces, set `hideInput` and `hideOutput` in the `tracingOptions` of the agent or workflow run that calls the classifier. See [hiding sensitive input/output](https://mastra.ai/docs/observability/tracing/overview).
336
336
 
337
+ In [Studio](https://mastra.ai/docs/studio/overview), filter traces by the Classifier entity type to see classifier calls on their own. Workflow classifier steps appear as classifier nodes in the workflow graph.
338
+
337
339
  ## Customize provider responses
338
340
 
339
341
  `Classifier` automatically wraps a raw AI SDK decision model in `MastraDecisionModel`. Pass your own wrapper when provider output needs normalization before validation.
@@ -90,7 +90,7 @@ const result = await mastraClient.querySpans({
90
90
  console.log(result.spans)
91
91
  ```
92
92
 
93
- Pages default to 100 rows and allow at most 1,000. The response is `{ spans, page: { next } }`, without a total count. Ordering accepts exactly one of `startedAt`, `endedAt`, or `timeToFirstChunkMs`, ascending or descending, and defaults to descending start time. Spans without a `timeToFirstChunkMs` value sort last in both directions.
93
+ Pages default to 100 rows and allow at most 1,000. The response is `{ spans, page: { next } }`, without a total count. Ordering accepts exactly one of `startedAt`, `endedAt`, `timeToFirstChunkMs`, or `timeToFirstTokenMs`, ascending or descending, and defaults to descending start time. Spans without a value for the `timeToFirstChunkMs` or `timeToFirstTokenMs` sort field sort last in both directions.
94
94
 
95
95
  | Fields | Operators |
96
96
  | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
@@ -98,7 +98,7 @@ Pages default to 100 rows and allow at most 1,000. The response is `{ spans, pag
98
98
  | `organizationId`, `resourceId`, `runId`, `sessionId`, `userId`, `requestId`, `serviceName`, `experimentId`, `environment`, `executionSource` | Same string operators |
99
99
  | Entity, parent entity and root entity `Type`, `Id`, `Name`, `VersionId` fields, such as `parentEntityId` | Same string operators |
100
100
  | `name`, `spanType`, `status` | Same string operators; `name` also accepts `matches` / `notMatches` for normalized whole words and phrases |
101
- | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | Comparisons, membership and presence |
101
+ | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs`, `timeToFirstTokenMs` | Comparisons, membership and presence |
102
102
  | `error` | `exists`, `notExists` |
103
103
 
104
104
  Combine predicates with `and`, `or` and `not`. Membership uses `{ op: 'in', value: { path: 'spanType' }, set: ['agent_run', 'tool_call'] }`. A span's status is `error` when it has an error and `success` otherwise.
@@ -192,7 +192,7 @@ Use `where` to filter thread rows. Combine predicates with `and`, `or` and `not`
192
192
  | `resourceId`, `userId`, `runId`, `sessionId`, `requestId`, `serviceName`, `experimentId`, `environment`, `executionSource` | Same string operators |
193
193
  | `entityType`, `entityId`, `entityName`, `entityVersionId` | Same string operators |
194
194
  | `status` | `eq`, `ne`, `in`, `notIn`, with values `success` or `error` |
195
- | `startedAt`, `endedAt`, `timeToFirstChunkMs` | `eq`, `ne`, `lt`, `lte`, `gt`, `gte`, `in`, `notIn`, `exists`, `notExists` |
195
+ | `startedAt`, `endedAt`, `timeToFirstChunkMs`, `timeToFirstTokenMs` | `eq`, `ne`, `lt`, `lte`, `gt`, `gte`, `in`, `notIn`, `exists`, `notExists` |
196
196
  | `traceCount` | `eq`, `ne`, `lt`, `lte`, `gt`, `gte` |
197
197
 
198
198
  For example, filter for threads from selected agents with at least three traces:
@@ -221,18 +221,19 @@ Presence filters use `{ op: 'exists', path: 'userId' }` to check for a non-null
221
221
 
222
222
  The response is `{ threads, page: { next } }`, without a total count. Each entry in `threads` contains these fields:
223
223
 
224
- | Returned fields | Meaning |
225
- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
226
- | `threadId`, `organizationId` | Thread identity. Equal thread IDs in different organizations remain separate. |
227
- | `firstTraceId`, `lastTraceId` | Earliest and latest trace by start time. Equal start times use trace ID as a deterministic tie-breaker. |
228
- | `resourceId`, `userId`, `runId`, `sessionId`, `requestId`, `serviceName`, `experimentId`, `environment`, `executionSource` | First-trace context, or `null` when missing. |
229
- | `entityType`, `entityId`, `entityName`, `entityVersionId` | First-trace entity. |
230
- | `startedAt`, `endedAt` | Earliest start and maximum end time across the thread. |
231
- | `status` | `error` when the last-started trace's root span has an error, otherwise `success`. |
232
- | `traceCount` | Number of logical traces in the thread. |
233
- | `inputPreview` | First trace's input preview. |
234
- | `outputPreview`, `errorPreview` | Last-started trace's previews. |
235
- | `timeToFirstChunkMs` | First trace's root agent time to first chunk, in milliseconds. `null` when unavailable or the root isn't an agent. |
224
+ | Returned fields | Meaning |
225
+ | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
226
+ | `threadId`, `organizationId` | Thread identity. Equal thread IDs in different organizations remain separate. |
227
+ | `firstTraceId`, `lastTraceId` | Earliest and latest trace by start time. Equal start times use trace ID as a deterministic tie-breaker. |
228
+ | `resourceId`, `userId`, `runId`, `sessionId`, `requestId`, `serviceName`, `experimentId`, `environment`, `executionSource` | First-trace context, or `null` when missing. |
229
+ | `entityType`, `entityId`, `entityName`, `entityVersionId` | First-trace entity. |
230
+ | `startedAt`, `endedAt` | Earliest start and maximum end time across the thread. |
231
+ | `status` | `error` when the last-started trace's root span has an error, otherwise `success`. |
232
+ | `traceCount` | Number of logical traces in the thread. |
233
+ | `inputPreview` | First trace's input preview. |
234
+ | `outputPreview`, `errorPreview` | Last-started trace's previews. |
235
+ | `timeToFirstChunkMs` | First trace's root agent time to first chunk, in milliseconds. `null` when unavailable or the root isn't an agent. |
236
+ | `timeToFirstTokenMs` | First trace's root agent time to first token, in milliseconds, with the same `null` rules. Present only when the store supports it. |
236
237
 
237
238
  An earlier-started trace can finish last. In that case, it supplies `endedAt`, while the last-started trace still supplies status and output/error previews. Missing first-trace values aren't replaced with values from a later trace.
238
239
 
@@ -107,7 +107,7 @@ export const mastra = new Mastra({
107
107
 
108
108
  ### deployer
109
109
 
110
- **Type:** `MastraDeployer`
110
+ **Type:** `IDeployer`
111
111
 
112
112
  Deployment provider for publishing applications to cloud platforms.
113
113
 
@@ -1033,6 +1033,8 @@ export const mastra = new Mastra({
1033
1033
 
1034
1034
  Request timeout in milliseconds. Requests that exceed this duration will be terminated.
1035
1035
 
1036
+ On serverless platforms this limit is independent of the platform's own function timeout. For example, the [Vercel deployer](https://mastra.ai/reference/deployer/vercel) sets Vercel's limit with `maxDuration` (seconds) while `server.timeout` still applies, so long requests need both raised.
1037
+
1036
1038
  ```typescript
1037
1039
  import { Mastra } from '@mastra/core'
1038
1040
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Provider toolsets
6
6
 
7
- This page documents generated toolsets for 24 providers (948 tools in this version of `@mastra/connect`). It isn't an exhaustive list of providers registered in the SDK or available in the platform catalog. [`tools()`](https://mastra.ai/reference/connect/tools) exposes a provider's toolset when the project has an active connection for its provider ID.
7
+ This page documents generated toolsets for 26 providers (996 tools in this version of `@mastra/connect`). It isn't an exhaustive list of providers registered in the SDK or available in the platform catalog. [`tools()`](https://mastra.ai/reference/connect/tools) exposes a provider's toolset when the project has an active connection for its provider ID.
8
8
 
9
9
  Tool keys are stable identifiers of the form `<provider>_<action>` and are the values accepted by `allowTools` and `disallowTools`. Toolsets are versioned with the package: the exact list depends on the installed `@mastra/connect` version, and this page reflects the version it was generated from.
10
10
 
@@ -27,9 +27,11 @@ MCP providers (Attio, Canva, Clay, Neon, Render, Robinhood, and Sanity) serve th
27
27
  | ![](https://cdn.simpleicons.org/linear?viewbox=auto\&size=28) [Linear](#linear) | `linear` | 46 |
28
28
  | ![](https://app.nango.dev/images/template-logos/microsoft-powerpoint.svg) [Microsoft PowerPoint](#microsoft-powerpoint) | `microsoft-powerpoint` | 18 |
29
29
  | ![](https://cdn.simpleicons.org/microsoftteams?viewbox=auto\&size=28) [Microsoft Teams](#microsoft-teams) | `microsoft-teams` | 25 |
30
+ | ![](https://app.nango.dev/images/template-logos/microsoft-word.svg) [Microsoft Word](#microsoft-word) | `microsoft-word` | 18 |
30
31
  | ![](https://cdn.simpleicons.org/notion?viewbox=auto\&size=28) [Notion](#notion) | `notion` | 44 |
31
32
  | [OneDrive](#onedrive) | `one-drive` | 20 |
32
33
  | ![](https://svgl.app/library/openai.svg) [OpenAI](#openai) | `openai` | 26 |
34
+ | ![](https://cdn.simpleicons.org/microsoftoutlook?viewbox=auto\&size=28) [Microsoft Outlook](#microsoft-outlook) | `outlook` | 30 |
33
35
  | ![](https://cdn.simpleicons.org/posthog?viewbox=auto\&size=28) [PostHog](#posthog) | `posthog` | 67 |
34
36
  | ![](https://cdn.simpleicons.org/resend?viewbox=auto\&size=28) [Resend](#resend) | `resend` | 80 |
35
37
  | ![](https://svgl.app/library/slack.svg) [Slack](#slack) | `slack` | 52 |
@@ -719,6 +721,31 @@ Provider ID: `microsoft-teams` · 25 tools
719
721
  | `microsoft_teams_reply_to_channel_message` | Reply to a channel message thread. |
720
722
  | `microsoft_teams_update_channel` | Update mutable channel properties. |
721
723
 
724
+ ## Microsoft Word
725
+
726
+ Provider ID: `microsoft-word` · 18 tools
727
+
728
+ | Tool | Description |
729
+ | ----------------------------------------------- | ----------------------------------------------------------------------------------- |
730
+ | `microsoft_word_copy_word_document` | Copy a Word document to a (possibly different) folder, optionally renaming it. |
731
+ | `microsoft_word_create_folder` | Create a folder in a drive to organize Word documents. |
732
+ | `microsoft_word_create_sharing_link` | Create a sharing link for a Word document. |
733
+ | `microsoft_word_create_word_document` | Upload a new Word document to a drive folder |
734
+ | `microsoft_word_delete_word_document` | Delete a Word document. |
735
+ | `microsoft_word_get_site_drive` | Get the default document library (drive) for a SharePoint site. |
736
+ | `microsoft_word_get_user_drive` | Get the connected user's OneDrive, or another user's drive when userId is provided. |
737
+ | `microsoft_word_get_word_document` | Retrieve metadata for a Word document (driveItem). |
738
+ | `microsoft_word_get_word_document_as_pdf` | Download a Word document converted to PDF |
739
+ | `microsoft_word_get_word_document_content` | Download the raw .docx content of a Word document. |
740
+ | `microsoft_word_list_sites` | Search/list SharePoint sites accessible to the app |
741
+ | `microsoft_word_list_users` | List/search tenant users, to resolve a user id for personal OneDrive access. |
742
+ | `microsoft_word_list_word_document_permissions` | List sharing permissions on a Word document. |
743
+ | `microsoft_word_list_word_document_versions` | List the version history of a Word document. |
744
+ | `microsoft_word_list_word_documents` | List/search .docx files within a drive |
745
+ | `microsoft_word_move_word_document` | Move a Word document to a different folder. |
746
+ | `microsoft_word_update_word_document_content` | Replace the content of an existing Word document. |
747
+ | `microsoft_word_update_word_document_metadata` | Rename a Word document or update its description, without touching content. |
748
+
722
749
  ## Notion
723
750
 
724
751
  Provider ID: `notion` · 44 tools
@@ -830,6 +857,43 @@ Provider ID: `openai` · 26 tools
830
857
  | `openai_search_vector_store` | Search a vector store for semantically matching content chunks |
831
858
  | `openai_update_vector_store` | Update a vector store in OpenAI |
832
859
 
860
+ ## Microsoft Outlook
861
+
862
+ Provider ID: `outlook` · 30 tools
863
+
864
+ | Tool | Description |
865
+ | ------------------------------------- | ------------------------------------------------------------------------- |
866
+ | `outlook_add_event_attachment` | Attach a small file (under 3 MB) to an Outlook event. |
867
+ | `outlook_add_message_attachment` | Attach a file to a draft message. Note: 3 MB simple upload limit applies. |
868
+ | `outlook_cancel_event` | Cancel a meeting and send the cancellation notice to attendees |
869
+ | `outlook_copy_message` | Copy a message to another mail folder. |
870
+ | `outlook_create_calendar` | Create a secondary calendar in the mailbox. |
871
+ | `outlook_create_draft_message` | Create a draft email message |
872
+ | `outlook_create_event` | Create an event on a calendar. |
873
+ | `outlook_create_mail_folder` | Create a child mail folder in Outlook. |
874
+ | `outlook_delete_calendar` | Delete a secondary calendar. |
875
+ | `outlook_delete_event` | Delete an event from a calendar. |
876
+ | `outlook_delete_message` | Delete a message from the mailbox |
877
+ | `outlook_download_message_attachment` | Download the content of a file attachment on a message. |
878
+ | `outlook_get_calendar` | Retrieve a calendar by ID. |
879
+ | `outlook_get_event` | Retrieve an event by ID from the user's calendar |
880
+ | `outlook_get_message` | Retrieve a message by ID. |
881
+ | `outlook_list_calendar_events` | List events from a calendar or date window. |
882
+ | `outlook_list_calendars` | List calendars in the mailbox. |
883
+ | `outlook_list_event_attachments` | List attachments on an event. |
884
+ | `outlook_list_mail_folder_children` | List child folders under a mail folder |
885
+ | `outlook_list_mail_folders` | List top-level mail folders from the mailbox |
886
+ | `outlook_list_message_attachments` | List attachments on a message. |
887
+ | `outlook_list_messages` | List messages from a mail folder. |
888
+ | `outlook_move_message` | Move a message to another mail folder. |
889
+ | `outlook_reply_all_to_message` | Reply to all recipients on a message |
890
+ | `outlook_reply_to_message` | Reply to a message sender. |
891
+ | `outlook_send_draft_message` | Send an existing draft message. |
892
+ | `outlook_send_mail` | Send a new email message immediately |
893
+ | `outlook_update_calendar` | Update calendar properties. |
894
+ | `outlook_update_event` | Update event details in Outlook calendar. |
895
+ | `outlook_update_message` | Update a draft or mutable message fields. |
896
+
833
897
  ## PostHog
834
898
 
835
899
  Provider ID: `posthog` · 67 tools
@@ -18,7 +18,7 @@ This method doesn't accept any parameters.
18
18
 
19
19
  ## Returns
20
20
 
21
- **deployer** (`MastraDeployer | undefined`): The configured deployer instance, or undefined if no deployer has been configured.
21
+ **deployer** (`IDeployer | undefined`): The configured deployer instance, or undefined if no deployer has been configured.
22
22
 
23
23
  ## Related
24
24
 
@@ -77,7 +77,7 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
77
77
 
78
78
  **environment** (`string`): Deployment environment name (e.g. production, staging, development). When set, automatically attached to all observability signals so they can be filtered by environment without passing tracingOptions.metadata.environment on each call. When unset, resolves to development for mastra dev runs, then falls back to process.env.NODE_ENV; left undefined if none are set. Per-call tracingOptions.metadata.environment always takes precedence.
79
79
 
80
- **deployer** (`MastraDeployer`): An instance of a MastraDeployer for managing deployments.
80
+ **deployer** (`IDeployer`): A deployer for managing deployments, such as VercelDeployer from @mastra/deployer-vercel.
81
81
 
82
82
  **server** (`ServerConfig`): Server configuration including port, host, timeout, API routes, middleware, CORS settings, and build options for Swagger UI, API request logging, and OpenAPI docs.
83
83
 
@@ -52,7 +52,7 @@ export const mastra = new Mastra({
52
52
  The deployer accepts the following options:
53
53
 
54
54
  - `studio?: boolean`: Deploy [Studio](https://mastra.ai/docs/studio/overview) alongside your API as static assets served from Vercel's Edge CDN. Defaults to `false`.
55
- - `maxDuration?: number`: Function execution timeout (in seconds)
55
+ - `maxDuration?: number`: Function execution timeout (in seconds). This sets Vercel's limit only; Mastra's own request timeout is configured separately, see [Request timeouts](#request-timeouts).
56
56
  - `memory?: number`: Function memory (in MB)
57
57
  - `regions?: string[]`: Regions to deploy the function (e.g. `['sfo1','iad1']`)
58
58
 
@@ -74,6 +74,29 @@ export const mastra = new Mastra({
74
74
  })
75
75
  ```
76
76
 
77
+ ## Request timeouts
78
+
79
+ Vercel's function execution time and Mastra's request timeout are enforced separately:
80
+
81
+ - **Vercel function execution time**: set by the deployer's `maxDuration` option, in seconds.
82
+ - **Mastra request timeout**: set by `server.timeout` in your `Mastra` config, in milliseconds. When unset it defaults to `180000` (180 seconds), and requests that exceed it are answered with `504 Gateway Timeout`.
83
+
84
+ `maxDuration` doesn't change `server.timeout`. A request that takes longer than 180 seconds fails even if `maxDuration` is higher, so raise both when you run long requests such as workflow runs or streaming agents:
85
+
86
+ ```typescript
87
+ import { Mastra } from '@mastra/core'
88
+ import { VercelDeployer } from '@mastra/deployer-vercel'
89
+
90
+ export const mastra = new Mastra({
91
+ deployer: new VercelDeployer({
92
+ maxDuration: 600, // seconds
93
+ }),
94
+ server: {
95
+ timeout: 600_000, // milliseconds, keep at or below maxDuration
96
+ },
97
+ })
98
+ ```
99
+
77
100
  ## Build output
78
101
 
79
102
  After running `mastra build`, the deployer generates a `.vercel/output` directory conforming to Vercel's [Build Output API (v3)](https://vercel.com/docs/build-output-api/v3). This directory contains routing configuration and serverless function bundles that Vercel deploys directly, bypassing framework detection.
@@ -40,7 +40,7 @@ export const mastra = new Mastra({
40
40
 
41
41
  **source** (`'code' | 'db'`): Where agent overrides are stored. With 'db', overrides live in the configured storage backend and Studio shows the save and publish flow. With 'code', overrides live as per-agent JSON files on disk (routed through a local FilesystemStore) and Studio shows filesystem actions. See Editor storage options for the difference. (Default: `'db'`)
42
42
 
43
- **codePath** (`string`): Directory used by the 'code' source for per-agent JSON files. Ignored when source is not 'code'. (Default: `'./mastra/editor/'`)
43
+ **codePath** (`string`): Directory used by the 'code' source for per-agent JSON files. Ignored when source is not 'code'. (Default: `'./mastra/editor'`)
44
44
 
45
45
  ### Provider interfaces
46
46
 
@@ -285,6 +285,8 @@ The `createToolCallAccuracyScorerLLM()` function from `@mastra/evals/scorers/pre
285
285
 
286
286
  **availableTools** (`Tool[]`): Tools available to the agent, for example created with createTool(). Each tool's id and description are passed to the judge as context.
287
287
 
288
+ Pass the tools available for the specific agent run in `availableTools`. If tool availability changes between runs, create a scorer with each run's tool snapshot. A global superset can cause the judge to report unavailable tools as missing and lower the score.
289
+
288
290
  ### Features
289
291
 
290
292
  The LLM-based scorer provides:
@@ -299,12 +301,13 @@ The LLM-based scorer provides:
299
301
 
300
302
  1. **Extract Tool Calls**: Identifies tools mentioned in agent output
301
303
  2. **Analyze Appropriateness**: Evaluates each tool against user request
302
- 3. **Generate Score**: Calculates score based on appropriate vs total tool calls
304
+ 3. **Generate Score**: Divides appropriate calls by the number of actual calls plus judge-reported missing tools
303
305
  4. **Generate Reasoning**: Provides human-readable explanation
304
306
 
305
307
  ## LLM-based scoring details
306
308
 
307
- - **Fractional scores**: Returns values between 0.0 and 1.0
309
+ - **Fractional scores**: Returns values between 0.0 and 1.0, rounded to two decimal places. The score counts appropriate evaluations only when they match actual calls to that tool, so extra evaluations don't increase it. The denominator counts all actual calls plus judge-reported missing tools.
310
+ - **No tool calls**: Returns 0 if the judge reports missing tools, or 1 if no tools were needed.
308
311
  - **Context-aware**: Considers user intent and appropriateness
309
312
  - **Explanatory**: Provides reasoning for scores
310
313
 
@@ -436,8 +439,8 @@ const inappropriateOutput = [
436
439
  const run = createAgentTestRun({ inputMessages, output: inappropriateOutput })
437
440
  const result = await llmScorer.run(run)
438
441
 
439
- console.log(result.score) // 0.5 - partially appropriate
440
- console.log(result.reason) // "The agent used search-tool when weather-tool would have been more appropriate for a direct weather query."
442
+ console.log(result.score) // 0 - if the judge marks search-tool inappropriate and reports weather-tool as missing
443
+ console.log(result.reason) // The judge explains why search-tool was inappropriate for this weather request.
441
444
  ```
442
445
 
443
446
  ### Evaluating clarification requests