@mastra/mcp-docs-server 1.1.8-alpha.0 → 1.1.9-alpha.0

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 (228) hide show
  1. package/.docs/docs/agents/agent-memory.md +2 -2
  2. package/.docs/docs/agents/guardrails.md +3 -3
  3. package/.docs/docs/agents/network-approval.md +4 -1
  4. package/.docs/docs/agents/networks.md +1 -1
  5. package/.docs/docs/agents/overview.md +1 -1
  6. package/.docs/docs/agents/processors.md +35 -17
  7. package/.docs/docs/agents/structured-output.md +1 -1
  8. package/.docs/docs/agents/using-tools.md +2 -2
  9. package/.docs/docs/build-with-ai/mcp-docs-server.md +4 -4
  10. package/.docs/docs/build-with-ai/skills.md +1 -1
  11. package/.docs/docs/community/discord.md +1 -1
  12. package/.docs/docs/community/licensing.md +1 -1
  13. package/.docs/docs/deployment/mastra-server.md +1 -1
  14. package/.docs/docs/deployment/studio.md +2 -2
  15. package/.docs/docs/deployment/web-framework.md +1 -1
  16. package/.docs/docs/evals/overview.md +1 -1
  17. package/.docs/docs/getting-started/build-with-ai.md +1 -1
  18. package/.docs/docs/getting-started/project-structure.md +1 -1
  19. package/.docs/docs/index.md +62 -16
  20. package/.docs/docs/mastra-cloud/deployment.md +1 -1
  21. package/.docs/docs/mastra-cloud/studio.md +1 -1
  22. package/.docs/docs/mcp/publishing-mcp-server.md +1 -1
  23. package/.docs/docs/memory/memory-processors.md +1 -1
  24. package/.docs/docs/memory/message-history.md +2 -2
  25. package/.docs/docs/memory/observational-memory.md +6 -2
  26. package/.docs/docs/memory/semantic-recall.md +2 -2
  27. package/.docs/docs/memory/storage.md +1 -1
  28. package/.docs/docs/memory/working-memory.md +6 -6
  29. package/.docs/docs/observability/tracing/bridges/otel.md +2 -2
  30. package/.docs/docs/observability/tracing/exporters/default.md +1 -1
  31. package/.docs/docs/observability/tracing/overview.md +4 -4
  32. package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +2 -2
  33. package/.docs/docs/rag/chunking-and-embedding.md +1 -1
  34. package/.docs/docs/rag/vector-databases.md +2 -2
  35. package/.docs/docs/server/auth/auth0.md +1 -1
  36. package/.docs/docs/server/auth/firebase.md +1 -1
  37. package/.docs/docs/server/auth/simple-auth.md +1 -1
  38. package/.docs/docs/server/auth.md +1 -1
  39. package/.docs/docs/server/mastra-client.md +1 -1
  40. package/.docs/docs/server/mastra-server.md +1 -1
  41. package/.docs/docs/server/server-adapters.md +2 -2
  42. package/.docs/docs/streaming/events.md +1 -1
  43. package/.docs/docs/streaming/overview.md +1 -1
  44. package/.docs/docs/streaming/tool-streaming.md +44 -30
  45. package/.docs/docs/streaming/workflow-streaming.md +1 -1
  46. package/.docs/docs/workflows/control-flow.md +44 -2
  47. package/.docs/docs/workflows/error-handling.md +1 -1
  48. package/.docs/docs/workflows/overview.md +3 -3
  49. package/.docs/docs/workflows/snapshots.md +1 -1
  50. package/.docs/docs/workflows/time-travel.md +2 -2
  51. package/.docs/docs/workspace/filesystem.md +2 -2
  52. package/.docs/docs/workspace/overview.md +52 -7
  53. package/.docs/docs/workspace/sandbox.md +72 -13
  54. package/.docs/docs/workspace/skills.md +2 -2
  55. package/.docs/guides/build-your-ui/copilotkit.md +1 -1
  56. package/.docs/guides/deployment/inngest.md +4 -4
  57. package/.docs/guides/guide/ai-recruiter.md +1 -1
  58. package/.docs/guides/guide/github-actions-pr-description.md +2 -2
  59. package/.docs/guides/guide/notes-mcp-server.md +1 -1
  60. package/.docs/guides/guide/stock-agent.md +2 -2
  61. package/.docs/guides/migrations/agentnetwork.md +1 -1
  62. package/.docs/guides/migrations/upgrade-to-v1/client.md +2 -2
  63. package/.docs/guides/migrations/upgrade-to-v1/deployment.md +1 -1
  64. package/.docs/guides/migrations/upgrade-to-v1/memory.md +2 -2
  65. package/.docs/guides/migrations/upgrade-to-v1/storage.md +1 -1
  66. package/.docs/guides/migrations/upgrade-to-v1/tools.md +2 -2
  67. package/.docs/guides/migrations/upgrade-to-v1/workflows.md +5 -5
  68. package/.docs/guides/migrations/vnext-to-standard-apis.md +2 -2
  69. package/.docs/models/gateways/netlify.md +1 -2
  70. package/.docs/models/gateways/openrouter.md +8 -1
  71. package/.docs/models/gateways/vercel.md +3 -1
  72. package/.docs/models/index.md +1 -1
  73. package/.docs/models/providers/abacus.md +21 -11
  74. package/.docs/models/providers/aihubmix.md +7 -2
  75. package/.docs/models/providers/alibaba-cn.md +80 -71
  76. package/.docs/models/providers/alibaba-coding-plan-cn.md +78 -0
  77. package/.docs/models/providers/alibaba-coding-plan.md +78 -0
  78. package/.docs/models/providers/chutes.md +1 -1
  79. package/.docs/models/providers/clarifai.md +81 -0
  80. package/.docs/models/providers/cloudferro-sherlock.md +5 -4
  81. package/.docs/models/providers/cloudflare-workers-ai.md +3 -2
  82. package/.docs/models/providers/cortecs.md +7 -5
  83. package/.docs/models/providers/deepinfra.md +7 -2
  84. package/.docs/models/providers/deepseek.md +1 -1
  85. package/.docs/models/providers/drun.md +73 -0
  86. package/.docs/models/providers/firmware.md +28 -20
  87. package/.docs/models/providers/google.md +3 -1
  88. package/.docs/models/providers/inception.md +4 -2
  89. package/.docs/models/providers/kilo.md +3 -1
  90. package/.docs/models/providers/nano-gpt.md +519 -40
  91. package/.docs/models/providers/nebius.md +34 -34
  92. package/.docs/models/providers/nvidia.md +4 -2
  93. package/.docs/models/providers/ollama-cloud.md +1 -2
  94. package/.docs/models/providers/openai.md +3 -1
  95. package/.docs/models/providers/opencode.md +36 -33
  96. package/.docs/models/providers/poe.md +8 -2
  97. package/.docs/models/providers/qiniu-ai.md +20 -5
  98. package/.docs/models/providers/requesty.md +17 -1
  99. package/.docs/models/providers/siliconflow-cn.md +7 -1
  100. package/.docs/models/providers/togetherai.md +1 -3
  101. package/.docs/models/providers/xai.md +28 -25
  102. package/.docs/models/providers/xiaomi.md +1 -1
  103. package/.docs/models/providers/zenmux.md +3 -1
  104. package/.docs/models/providers.md +4 -0
  105. package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
  106. package/.docs/reference/agents/getDefaultOptions.md +1 -1
  107. package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
  108. package/.docs/reference/agents/getDescription.md +1 -1
  109. package/.docs/reference/agents/network.md +3 -1
  110. package/.docs/reference/ai-sdk/handle-chat-stream.md +2 -0
  111. package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
  112. package/.docs/reference/ai-sdk/network-route.md +2 -0
  113. package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
  114. package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
  115. package/.docs/reference/auth/auth0.md +3 -3
  116. package/.docs/reference/auth/firebase.md +1 -1
  117. package/.docs/reference/auth/workos.md +2 -2
  118. package/.docs/reference/cli/mastra.md +4 -4
  119. package/.docs/reference/client-js/mastra-client.md +1 -1
  120. package/.docs/reference/configuration.md +62 -6
  121. package/.docs/reference/core/getDeployer.md +1 -1
  122. package/.docs/reference/core/getLogger.md +1 -1
  123. package/.docs/reference/core/getScorer.md +2 -2
  124. package/.docs/reference/core/getServer.md +1 -1
  125. package/.docs/reference/core/getStorage.md +1 -1
  126. package/.docs/reference/core/getStoredAgentById.md +1 -1
  127. package/.docs/reference/core/getTelemetry.md +1 -1
  128. package/.docs/reference/core/getWorkflow.md +1 -1
  129. package/.docs/reference/core/listAgents.md +1 -1
  130. package/.docs/reference/core/listMCPServers.md +1 -1
  131. package/.docs/reference/core/listStoredAgents.md +1 -1
  132. package/.docs/reference/core/listVectors.md +1 -1
  133. package/.docs/reference/core/mastra-class.md +1 -1
  134. package/.docs/reference/core/setLogger.md +1 -1
  135. package/.docs/reference/core/setStorage.md +1 -1
  136. package/.docs/reference/datasets/dataset.md +1 -1
  137. package/.docs/reference/datasets/datasets-manager.md +1 -1
  138. package/.docs/reference/datasets/get.md +2 -2
  139. package/.docs/reference/datasets/getDetails.md +1 -1
  140. package/.docs/reference/datasets/listItems.md +1 -1
  141. package/.docs/reference/deployer/vercel.md +1 -1
  142. package/.docs/reference/evals/answer-relevancy.md +1 -1
  143. package/.docs/reference/evals/completeness.md +1 -1
  144. package/.docs/reference/evals/context-precision.md +3 -3
  145. package/.docs/reference/evals/context-relevance.md +1 -1
  146. package/.docs/reference/evals/hallucination.md +3 -9
  147. package/.docs/reference/evals/keyword-coverage.md +1 -1
  148. package/.docs/reference/evals/mastra-scorer.md +1 -1
  149. package/.docs/reference/evals/noise-sensitivity.md +2 -2
  150. package/.docs/reference/evals/textual-difference.md +1 -1
  151. package/.docs/reference/evals/tone-consistency.md +1 -1
  152. package/.docs/reference/evals/tool-call-accuracy.md +1 -1
  153. package/.docs/reference/harness/harness-class.md +4 -2
  154. package/.docs/reference/index.md +2 -0
  155. package/.docs/reference/memory/cloneThread.md +1 -1
  156. package/.docs/reference/memory/observational-memory.md +7 -5
  157. package/.docs/reference/observability/tracing/bridges/otel.md +1 -1
  158. package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
  159. package/.docs/reference/observability/tracing/spans.md +2 -0
  160. package/.docs/reference/processors/message-history-processor.md +1 -1
  161. package/.docs/reference/processors/processor-interface.md +6 -2
  162. package/.docs/reference/processors/token-limiter-processor.md +2 -2
  163. package/.docs/reference/rag/metadata-filters.md +10 -10
  164. package/.docs/reference/server/create-route.md +2 -0
  165. package/.docs/reference/server/koa-adapter.md +1 -1
  166. package/.docs/reference/server/register-api-route.md +2 -2
  167. package/.docs/reference/storage/cloudflare-d1.md +3 -3
  168. package/.docs/reference/storage/cloudflare.md +1 -1
  169. package/.docs/reference/storage/convex.md +1 -1
  170. package/.docs/reference/storage/dynamodb.md +2 -2
  171. package/.docs/reference/storage/lance.md +2 -2
  172. package/.docs/reference/storage/mongodb.md +1 -1
  173. package/.docs/reference/storage/mssql.md +1 -1
  174. package/.docs/reference/storage/postgresql.md +2 -2
  175. package/.docs/reference/storage/upstash.md +1 -1
  176. package/.docs/reference/streaming/workflows/observeStream.md +1 -1
  177. package/.docs/reference/templates/overview.md +1 -1
  178. package/.docs/reference/tools/create-tool.md +1 -1
  179. package/.docs/reference/tools/mcp-server.md +4 -4
  180. package/.docs/reference/vectors/chroma.md +2 -2
  181. package/.docs/reference/vectors/couchbase.md +6 -6
  182. package/.docs/reference/vectors/pg.md +2 -0
  183. package/.docs/reference/vectors/s3vectors.md +5 -5
  184. package/.docs/reference/voice/azure.md +4 -2
  185. package/.docs/reference/voice/cloudflare.md +4 -2
  186. package/.docs/reference/voice/elevenlabs.md +1 -1
  187. package/.docs/reference/voice/google-gemini-live.md +2 -2
  188. package/.docs/reference/voice/google.md +3 -3
  189. package/.docs/reference/voice/mastra-voice.md +1 -1
  190. package/.docs/reference/voice/murf.md +2 -2
  191. package/.docs/reference/voice/openai-realtime.md +3 -1
  192. package/.docs/reference/voice/openai.md +7 -3
  193. package/.docs/reference/voice/playai.md +4 -2
  194. package/.docs/reference/voice/sarvam.md +3 -1
  195. package/.docs/reference/voice/speechify.md +6 -4
  196. package/.docs/reference/voice/voice.addInstructions.md +2 -2
  197. package/.docs/reference/voice/voice.addTools.md +1 -1
  198. package/.docs/reference/voice/voice.close.md +2 -2
  199. package/.docs/reference/voice/voice.connect.md +4 -2
  200. package/.docs/reference/voice/voice.events.md +2 -2
  201. package/.docs/reference/voice/voice.getSpeakers.md +1 -1
  202. package/.docs/reference/voice/voice.listen.md +11 -5
  203. package/.docs/reference/voice/voice.off.md +2 -2
  204. package/.docs/reference/voice/voice.on.md +2 -2
  205. package/.docs/reference/voice/voice.speak.md +14 -4
  206. package/.docs/reference/voice/voice.updateConfig.md +1 -1
  207. package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
  208. package/.docs/reference/workspace/blaxel-sandbox.md +164 -0
  209. package/.docs/reference/workspace/daytona-sandbox.md +48 -139
  210. package/.docs/reference/workspace/e2b-sandbox.md +39 -75
  211. package/.docs/reference/workspace/filesystem.md +24 -10
  212. package/.docs/reference/workspace/gcs-filesystem.md +20 -0
  213. package/.docs/reference/workspace/local-filesystem.md +23 -9
  214. package/.docs/reference/workspace/local-sandbox.md +23 -98
  215. package/.docs/reference/workspace/process-manager.md +296 -0
  216. package/.docs/reference/workspace/s3-filesystem.md +20 -0
  217. package/.docs/reference/workspace/sandbox.md +9 -1
  218. package/.docs/reference/workspace/workspace-class.md +93 -25
  219. package/CHANGELOG.md +16 -0
  220. package/dist/tools/course.d.ts +7 -27
  221. package/dist/tools/course.d.ts.map +1 -1
  222. package/dist/tools/docs.d.ts +6 -18
  223. package/dist/tools/docs.d.ts.map +1 -1
  224. package/dist/tools/embedded-docs.d.ts +12 -112
  225. package/dist/tools/embedded-docs.d.ts.map +1 -1
  226. package/dist/tools/migration.d.ts +6 -26
  227. package/dist/tools/migration.d.ts.map +1 -1
  228. package/package.json +9 -9
@@ -2,7 +2,7 @@
2
2
 
3
3
  The `MastraScorer` class is the base class for all scorers in Mastra. It provides a standard `.run()` method for evaluating input/output pairs and supports multi-step scoring workflows with preprocess → analyze → generateScore → generateReason execution flow.
4
4
 
5
- **Note:** Most users should use [`createScorer`](https://mastra.ai/reference/evals/create-scorer) to create scorer instances. Direct instantiation of `MastraScorer` is not recommended.
5
+ **Note:** Most users should use [`createScorer`](https://mastra.ai/reference/evals/create-scorer) to create scorer instances. Direct instantiation of `MastraScorer` isn't recommended.
6
6
 
7
7
  ## How to Get a MastraScorer Instance
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  The `createNoiseSensitivityScorerLLM()` function creates a **CI/testing scorer** that evaluates how robust an agent is when exposed to irrelevant, distracting, or misleading information. Unlike live scorers that evaluate single production runs, this scorer requires predetermined test data including both baseline responses and noisy variations.
4
4
 
5
- **Important:** This is not a live scorer. It requires pre-computed baseline responses and cannot be used for real-time agent evaluation. Use this scorer in your CI/CD pipeline or testing suites only.
5
+ **Important:** This isn't a live scorer. It requires pre-computed baseline responses and can't be used for real-time agent evaluation. Use this scorer in your CI/CD pipeline or testing suites only.
6
6
 
7
7
  Before using the noise sensitivity scorer, prepare your test data:
8
8
 
@@ -26,7 +26,7 @@ This scorer is designed exclusively for CI/testing environments and has specific
26
26
  1. **Requires Baseline Data**: You must provide a pre-computed baseline response (the "correct" answer without noise)
27
27
  2. **Needs Test Variations**: Requires both the original query and a noisy variation prepared in advance
28
28
  3. **Comparative Analysis**: The scorer compares responses between baseline and noisy versions, which is only possible in controlled test conditions
29
- 4. **Not Suitable for Production**: Cannot evaluate single, real-time agent responses without predetermined test data
29
+ 4. **Not Suitable for Production**: Can't evaluate single, real-time agent responses without predetermined test data
30
30
 
31
31
  ### Test Data Preparation
32
32
 
@@ -4,7 +4,7 @@ The `createTextualDifferenceScorer()` function uses sequence matching to measure
4
4
 
5
5
  ## Parameters
6
6
 
7
- The `createTextualDifferenceScorer()` function does not take any options.
7
+ The `createTextualDifferenceScorer()` function doesn't take any options.
8
8
 
9
9
  This function returns an instance of the MastraScorer class. See the [MastraScorer reference](https://mastra.ai/reference/evals/mastra-scorer) for details on the `.run()` method and its input/output.
10
10
 
@@ -4,7 +4,7 @@ The `createToneScorer()` function evaluates the text's emotional tone and sentim
4
4
 
5
5
  ## Parameters
6
6
 
7
- The `createToneScorer()` function does not take any options.
7
+ The `createToneScorer()` function doesn't take any options.
8
8
 
9
9
  This function returns an instance of the MastraScorer class. See the [MastraScorer reference](https://mastra.ai/reference/evals/mastra-scorer) for details on the `.run()` method and its input/output.
10
10
 
@@ -43,7 +43,7 @@ The code-based scorer operates in two distinct modes:
43
43
 
44
44
  #### Single Tool Mode
45
45
 
46
- When `expectedToolOrder` is not provided, the scorer evaluates single tool selection:
46
+ When `expectedToolOrder` isn't provided, the scorer evaluates single tool selection:
47
47
 
48
48
  - **Standard Mode (strictMode: false)**: Returns `1` if the expected tool is called, regardless of other tools
49
49
  - **Strict Mode (strictMode: true)**: Returns `1` only if exactly one tool is called and it matches the expected tool
@@ -82,6 +82,8 @@ await harness.sendMessage({ content: 'Hello!' })
82
82
 
83
83
  **subagents.allowedHarnessTools** (`string[]`): Tool IDs from the harness's shared \`tools\` config. Merged with \`tools\` above to let subagents use a subset of harness tools.
84
84
 
85
+ **subagents.allowedWorkspaceTools** (`string[]`): Workspace tool names the subagent is allowed to use. Uses the exposed names (after any renames via workspace tool config). When set, workspace tools not in this list are hidden from the model. Non-workspace tools are never affected. When omitted, all workspace tools are visible.
86
+
85
87
  **subagents.defaultModelId** (`string`): Default model ID for this subagent type.
86
88
 
87
89
  **subagents.maxSteps** (`number`): Optional maximum number of steps for the spawned subagent. Defaults to \`50\` when omitted.
@@ -94,7 +96,7 @@ await harness.sendMessage({ content: 'Hello!' })
94
96
 
95
97
  **heartbeatHandlers** (`HeartbeatHandler[]`): Periodic background tasks started during \`init()\`. Use for gateway sync, cache refresh, and similar tasks.
96
98
 
97
- **idGenerator** (`() => string`): Custom ID generator for threads, messages, and other entities. (Default: `timestamp + random string`)
99
+ **idGenerator** (`() => string`): Custom ID generator for Harness-managed IDs such as threads and mode-run identifiers. (Default: `timestamp + random string`)
98
100
 
99
101
  **modelAuthChecker** (`ModelAuthChecker`): Custom auth checker for model providers. Return \`true\`/\`false\` to override the default environment variable check, or \`undefined\` to fall back to defaults.
100
102
 
@@ -567,7 +569,7 @@ if (harness.isWorkspaceReady()) {
567
569
 
568
570
  #### `destroyWorkspace()`
569
571
 
570
- Destroy the workspace and release resources. Only applies to static workspaces — dynamic workspaces are not destroyed.
572
+ Destroy the workspace and release resources. Only applies to static workspaces — dynamic workspaces aren't destroyed.
571
573
 
572
574
  ```typescript
573
575
  await harness.destroyWorkspace()
@@ -266,12 +266,14 @@ The Reference section provides documentation of Mastra's API, including paramete
266
266
  - [.start()](https://mastra.ai/reference/workflows/run-methods/start)
267
267
  - [.startAsync()](https://mastra.ai/reference/workflows/run-methods/startAsync)
268
268
  - [.timeTravel()](https://mastra.ai/reference/workflows/run-methods/timeTravel)
269
+ - [BlaxelSandbox](https://mastra.ai/reference/workspace/blaxel-sandbox)
269
270
  - [DaytonaSandbox](https://mastra.ai/reference/workspace/daytona-sandbox)
270
271
  - [E2BSandbox](https://mastra.ai/reference/workspace/e2b-sandbox)
271
272
  - [GCSFilesystem](https://mastra.ai/reference/workspace/gcs-filesystem)
272
273
  - [LocalFilesystem](https://mastra.ai/reference/workspace/local-filesystem)
273
274
  - [LocalSandbox](https://mastra.ai/reference/workspace/local-sandbox)
274
275
  - [S3Filesystem](https://mastra.ai/reference/workspace/s3-filesystem)
276
+ - [SandboxProcessManager](https://mastra.ai/reference/workspace/process-manager)
275
277
  - [Workspace Class](https://mastra.ai/reference/workspace/workspace-class)
276
278
  - [WorkspaceFilesystem](https://mastra.ai/reference/workspace/filesystem)
277
279
  - [WorkspaceSandbox](https://mastra.ai/reference/workspace/sandbox)
@@ -135,4 +135,4 @@ When [Observational Memory](https://mastra.ai/docs/memory/observational-memory)
135
135
  - **Resource-scoped OM (same `resourceId`)**: The OM record is shared between the source and cloned threads since they belong to the same resource. No duplication occurs.
136
136
  - **Resource-scoped OM (different `resourceId`)**: The OM record is cloned to the new resource. Message IDs are remapped and any thread-identifying tags within observations are updated to reference the cloned thread.
137
137
 
138
- Only the current (most recent) OM generation is cloned — older history generations are not copied. Transient processing state (observation/reflection in-progress flags) is reset on the cloned record.
138
+ Only the current (most recent) OM generation is cloned — older history generations aren't copied. Transient processing state (observation/reflection in-progress flags) is reset on the cloned record.
@@ -26,6 +26,8 @@ export const agent = new Agent({
26
26
 
27
27
  The `observationalMemory` option accepts `true`, a configuration object, or `false`. Setting `true` enables OM with `google/gemini-2.5-flash` as the default model. When passing a config object, a `model` must be explicitly set — either at the top level, or on `observation.model` and/or `reflection.model`.
28
28
 
29
+ Observer input is multimodal-aware. OM keeps text placeholders like `[Image #1: screenshot.png]` in the transcript it builds for the Observer, and also sends the underlying image parts when possible. This applies to both single-thread observation and batched multi-thread observation. Non-image files appear as placeholders only.
30
+
29
31
  **enabled** (`boolean`): Enable or disable Observational Memory. When omitted from a config object, defaults to \`true\`. Only \`enabled: false\` explicitly disables it. (Default: `true`)
30
32
 
31
33
  **model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Sets the model for both at once. Cannot be used together with \`observation.model\` or \`reflection.model\` — an error will be thrown if both are set. When using \`observationalMemory: true\`, defaults to \`google/gemini-2.5-flash\`. When passing a config object, this or \`observation.model\`/\`reflection.model\` must be set. Use \`"default"\` to explicitly use the default model (\`google/gemini-2.5-flash\`). (Default: `'google/gemini-2.5-flash' (when using observationalMemory: true)`)
@@ -40,7 +42,7 @@ The `observationalMemory` option accepts `true`, a configuration object, or `fal
40
42
 
41
43
  **observation.instruction** (`string`): Custom instruction appended to the Observer's system prompt. Use this to customize what the Observer focuses on, such as domain-specific preferences or priorities.
42
44
 
43
- **observation.messageTokens** (`number`): Token count of unobserved messages that triggers observation. When unobserved message tokens exceed this threshold, the Observer agent is called.
45
+ **observation.messageTokens** (`number`): Token count of unobserved messages that triggers observation. When unobserved message tokens exceed this threshold, the Observer agent is called. Image parts are included with model-aware estimates when possible, with deterministic fallbacks when image metadata is incomplete. Image-like \`file\` parts are counted the same way when uploads are normalized as files.
44
46
 
45
47
  **observation.maxTokensPerBatch** (`number`): Maximum tokens per batch when observing multiple threads in resource scope. Threads are chunked into batches of this size and processed in parallel. Lower values mean more parallelism but more API calls.
46
48
 
@@ -80,9 +82,9 @@ OM persists token payload estimates so repeated counting can reuse prior tiktoke
80
82
 
81
83
  - Part-level cache: `part.providerMetadata.mastra`.
82
84
  - String-content fallback cache: message-level metadata when no parts exist.
83
- - Cache entries are ignored and recomputed if cache version/tokenizer source does not match.
84
- - Per-message and per-conversation overhead are always recomputed at runtime and are not cached.
85
- - `data-*` and `reasoning` parts are skipped and do not receive cache entries.
85
+ - Cache entries are ignored and recomputed if cache version/tokenizer source doesn't match.
86
+ - Per-message and per-conversation overhead are always recomputed at runtime and aren't cached.
87
+ - `data-*` and `reasoning` parts are skipped and don't receive cache entries.
86
88
 
87
89
  ## Examples
88
90
 
@@ -283,7 +285,7 @@ observationalMemory: {
283
285
 
284
286
  Setting `bufferTokens: false` disables both observation and reflection async buffering. Observations and reflections will run synchronously when their thresholds are reached.
285
287
 
286
- > **Note:** Async buffering is not supported with `scope: 'resource'` and is automatically disabled in resource scope.
288
+ > **Note:** Async buffering isn't supported with `scope: 'resource'` and is automatically disabled in resource scope.
287
289
 
288
290
  ## Streaming data parts
289
291
 
@@ -38,7 +38,7 @@ Executes a synchronous function within the OTEL context of a Mastra span.
38
38
  async shutdown(): Promise<void>
39
39
  ```
40
40
 
41
- Shuts down the bridge and cleans up resources. Ends any spans that were not properly closed.
41
+ Shuts down the bridge and cleans up resources. Ends any spans that weren't properly closed.
42
42
 
43
43
  ## Usage Examples
44
44
 
@@ -105,7 +105,7 @@ When no custom fields are provided:
105
105
  - **Exact matching**: After normalization, fields must match exactly
106
106
 
107
107
  - `token` matches `token`, `Token`, `TOKEN`
108
- - `token` does NOT match `promptTokens` or `tokenCount`
108
+ - `token` doesn't match `promptTokens` or `tokenCount`
109
109
 
110
110
  ### Redaction Styles
111
111
 
@@ -45,6 +45,8 @@ interface BaseSpan<TType extends SpanType> {
45
45
  details?: Record<string, any>
46
46
  }
47
47
 
48
+ /** Snapshot of the RequestContext */
49
+ requestContext?: Record<string, any>
48
50
  /** Is an event span? (occurs at startTime, has no endTime) */
49
51
  isEvent: boolean
50
52
  }
@@ -66,7 +66,7 @@ export const agent = new Agent({
66
66
 
67
67
  1. Retrieves `threadId` from the request context
68
68
  2. Fetches historical messages from storage (ordered by creation date, descending)
69
- 3. Filters out system messages (they should not be stored in the database)
69
+ 3. Filters out system messages (they shouldn't be stored in the database)
70
70
  4. Merges historical messages with incoming messages, avoiding duplicates by ID
71
71
  5. Adds historical messages with `source: 'memory'` tag
72
72
 
@@ -88,7 +88,7 @@ interface Processor<TId extends string = string> {
88
88
 
89
89
  ### processInput
90
90
 
91
- Processes input messages before they are sent to the LLM. Runs once at the start of agent execution.
91
+ Processes input messages before they're sent to the LLM. Runs once at the start of agent execution.
92
92
 
93
93
  ```typescript
94
94
  processInput?(args: ProcessInputArgs): Promise<ProcessInputResult> | ProcessInputResult;
@@ -124,7 +124,7 @@ The method can return one of three types:
124
124
 
125
125
  ### processInputStep
126
126
 
127
- Processes input messages at each step of the agentic loop, before they are sent to the LLM. Unlike `processInput` which runs once at the start, this runs at every step including tool call continuations.
127
+ Processes input messages at each step of the agentic loop, before they're sent to the LLM. Unlike `processInput` which runs once at the start, this runs at every step including tool call continuations.
128
128
 
129
129
  ```typescript
130
130
  processInputStep?(args: ProcessInputStepArgs): ProcessorMessageResult;
@@ -269,6 +269,10 @@ processOutputResult?(args: ProcessOutputResultArgs): ProcessorMessageResult;
269
269
 
270
270
  **messageList** (`MessageList`): MessageList instance for managing messages.
271
271
 
272
+ **state** (`Record<string, unknown>`): Per-processor state that persists across all method calls within this request. Shared with processOutputStream and other methods.
273
+
274
+ **result** (`OutputResult`): Resolved generation result containing \`text\` (accumulated text), \`usage\` (token usage with inputTokens, outputTokens, totalTokens), \`finishReason\` (why generation ended), and \`steps\` (all LLM step results, each with toolCalls, toolResults, reasoning, sources, files, etc.).
275
+
272
276
  **abort** (`(reason?: string) => never`): Function to abort processing.
273
277
 
274
278
  **tracingContext** (`TracingContext`): Tracing context for observability.
@@ -47,8 +47,8 @@ const processor = new TokenLimiterProcessor({
47
47
 
48
48
  When used as an input processor, `TokenLimiterProcessor` throws a `TripWire` error in the following cases:
49
49
 
50
- - **Empty messages**: If there are no messages to process, a TripWire is thrown because you cannot send an LLM request with no messages.
51
- - **System messages exceed limit**: If system messages alone exceed the token limit, a TripWire is thrown because you cannot send an LLM request with only system messages and no user/assistant messages.
50
+ - **Empty messages**: If there are no messages to process, a TripWire is thrown because you can't send an LLM request with no messages.
51
+ - **System messages exceed limit**: If system messages alone exceed the token limit, a TripWire is thrown because you can't send an LLM request with only system messages and no user/assistant messages.
52
52
 
53
53
  ```typescript
54
54
  import { TripWire } from '@mastra/core/agent'
@@ -48,7 +48,7 @@ const results = await store.query({
48
48
 
49
49
  ## Common Rules and Restrictions
50
50
 
51
- 1. Field names cannot:
51
+ 1. Field names can't:
52
52
 
53
53
  - Contain dots (.) unless referring to nested fields
54
54
  - Start with $ or contain null characters
@@ -63,11 +63,11 @@ const results = await store.query({
63
63
  3. Logical operators:
64
64
 
65
65
  - Must contain valid conditions
66
- - Cannot be empty
66
+ - Can't be empty
67
67
  - Must be properly nested
68
68
  - Can only be used at top level or nested within other logical operators
69
- - Cannot be used at field level or nested inside a field
70
- - Cannot be used inside an operator
69
+ - Can't be used at field level or nested inside a field
70
+ - Can't be used inside an operator
71
71
  - Valid: `{ "$and": [{ "field": { "$gt": 100 } }] }`
72
72
  - Valid: `{ "$or": [{ "$and": [{ "field": { "$gt": 100 } }] }] }`
73
73
  - Invalid: `{ "field": { "$and": [{ "$gt": 100 }] } }`
@@ -76,7 +76,7 @@ const results = await store.query({
76
76
  4. $not operator:
77
77
 
78
78
  - Must be an object
79
- - Cannot be empty
79
+ - Can't be empty
80
80
  - Can be used at field level or top level
81
81
  - Valid: `{ "$not": { "field": "value" } }`
82
82
  - Valid: `{ "field": { "$not": { "$eq": "value" } } }`
@@ -98,7 +98,7 @@ const results = await store.query({
98
98
  ### ChromaDB
99
99
 
100
100
  - Where filters only return results where the filtered field exists in metadata
101
- - Empty metadata fields are not included in filter results
101
+ - Empty metadata fields aren't included in filter results
102
102
  - Metadata fields must be present for negative matches (e.g., $ne won't match documents missing the field)
103
103
 
104
104
  ### Cloudflare Vectorize
@@ -109,7 +109,7 @@ const results = await store.query({
109
109
  - String values are indexed up to first 64 bytes (truncated on UTF-8 boundaries)
110
110
  - Number values use float64 precision
111
111
  - Filter JSON must be under 2048 bytes
112
- - Field names cannot contain dots (.) or start with $
112
+ - Field names can't contain dots (.) or start with $
113
113
  - Field names limited to 512 characters
114
114
  - Vectors must be re-upserted after creating new metadata indexes to be included in filtered results
115
115
  - Range queries may have reduced accuracy with very large datasets (\~10M+ vectors)
@@ -186,12 +186,12 @@ const results = await store.query({
186
186
 
187
187
  ### Couchbase
188
188
 
189
- - Currently does not have support for metadata filters. Filtering must be done client-side after retrieving results or by using the Couchbase SDK's Search capabilities directly for more complex queries.
189
+ - Currently doesn't have support for metadata filters. Filtering must be done client-side after retrieving results or by using the Couchbase SDK's Search capabilities directly for more complex queries.
190
190
 
191
191
  ### Amazon S3 Vectors
192
192
 
193
- - Equality values must be primitives (string/number/boolean). `null`/`undefined`, arrays, objects, and Date are not allowed for equality. Range operators accept numbers or Date (Dates are normalized to epoch ms).
194
- - `$in`/`$nin` require **non-empty arrays of primitives**; Date elements are allowed and normalized to epoch ms. **Array equality** is not supported.
193
+ - Equality values must be primitives (string/number/boolean). `null`/`undefined`, arrays, objects, and Date aren't allowed for equality. Range operators accept numbers or Date (Dates are normalized to epoch ms).
194
+ - `$in`/`$nin` require **non-empty arrays of primitives**; Date elements are allowed and normalized to epoch ms. **Array equality** isn't supported.
195
195
  - Implicit AND is canonicalized (`{a:1,b:2}` → `{$and:[{a:1},{b:2}]}`). Logical operators must contain field conditions, use non-empty arrays, and appear only at the root or within other logical operators (not inside field values).
196
196
  - Keys listed in `nonFilterableMetadataKeys` at index creation are stored but not filterable; this setting is immutable.
197
197
  - $exists requires a boolean value.
@@ -46,6 +46,8 @@ function createRoute<TPath, TQuery, TBody, TResponse, TResponseType>(
46
46
 
47
47
  **deprecated** (`boolean`): Mark route as deprecated
48
48
 
49
+ **onValidationError** (`(error: ZodError, context: 'query' | 'body' | 'path') => { status: number; body: unknown } | undefined`): Custom validation error handler for this route. Overrides the server-level \`onValidationError\` hook. Return \`{ status, body }\` to customize the response, or \`undefined\` to use the default.
50
+
49
51
  ## Handler parameters
50
52
 
51
53
  The handler receives validated parameters plus runtime context:
@@ -97,7 +97,7 @@ const server = new MastraServer({ app, mastra })
97
97
  await server.init()
98
98
  ```
99
99
 
100
- The [`server.onError`](https://mastra.ai/reference/configuration) hook is also supported. When configured, it is called before the error propagates to middleware, and its response is used directly:
100
+ The [`server.onError`](https://mastra.ai/reference/configuration) hook is also supported. When configured, it's called before the error propagates to middleware, and its response is used directly:
101
101
 
102
102
  ```typescript
103
103
  const mastra = new Mastra({
@@ -18,7 +18,7 @@ The URL path for the route. Supports path parameters using `:param` syntax.
18
18
  registerApiRoute("/items/:itemId", { ... })
19
19
  ```
20
20
 
21
- **Note:** Paths cannot start with `/api/` as this prefix is reserved for Mastra server routes.
21
+ **Note:** Paths can't start with `/api/` as this prefix is reserved for Mastra server routes.
22
22
 
23
23
  ### options
24
24
 
@@ -34,7 +34,7 @@ registerApiRoute("/items/:itemId", { ... })
34
34
 
35
35
  ## OpenAPI Options
36
36
 
37
- The `openapi` property accepts standard OpenAPI 3.1 operation fields from [hono-openapi](https://github.com/honojs/middleware/tree/main/packages/openapi). Routes without an `openapi` property are not included in Swagger UI.
37
+ The `openapi` property accepts standard OpenAPI 3.1 operation fields from [hono-openapi](https://github.com/honojs/middleware/tree/main/packages/openapi). Routes without an `openapi` property aren't included in Swagger UI.
38
38
 
39
39
  **summary** (`string`): Short summary of the operation
40
40
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Cloudflare D1 storage implementation provides a serverless SQL database solution using Cloudflare D1, supporting relational operations and transactional consistency.
4
4
 
5
- > **Observability Not Supported:** Cloudflare D1 storage **does not support the observability domain**. Traces from the `DefaultExporter` cannot be persisted to D1, and Mastra Studio's observability features won't work with D1 as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
5
+ > **Observability Not Supported:** Cloudflare D1 storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to D1, and Mastra Studio's observability features won't work with D1 as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
6
6
 
7
7
  > **Row Size Limit:** Cloudflare D1 enforces a **1 MiB maximum row size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage.
8
8
 
@@ -85,7 +85,7 @@ export default {
85
85
  > - The **property name** (`D1Database`) must match the `binding` name in your `wrangler.toml`
86
86
  > - The **type** (`: D1Database`) is from `@cloudflare/workers-types` for TypeScript type checking
87
87
  >
88
- > At runtime, Cloudflare Workers provides the actual D1 database instance via `env.D1Database`. You cannot use `D1Database` directly outside of the worker's context.
88
+ > At runtime, Cloudflare Workers provides the actual D1 database instance via `env.D1Database`. You can't use `D1Database` directly outside of the worker's context.
89
89
 
90
90
  ### Using with REST API
91
91
 
@@ -207,7 +207,7 @@ export default {
207
207
  }
208
208
  ```
209
209
 
210
- > **Warning:** If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
210
+ > **Warning:** If `init()` isn't called, tables won't be created and storage operations will fail silently or throw errors.
211
211
 
212
212
  ### Transactions & Consistency
213
213
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Cloudflare KV storage implementation provides a globally distributed, serverless key-value store solution using Cloudflare Workers KV.
4
4
 
5
- > **Observability Not Supported:** Cloudflare KV storage **does not support the observability domain**. Traces from the `DefaultExporter` cannot be persisted to KV, and Mastra Studio's observability features won't work with Cloudflare KV as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
5
+ > **Observability Not Supported:** Cloudflare KV storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to KV, and Mastra Studio's observability features won't work with Cloudflare KV as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
6
6
 
7
7
  ## Installation
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  The Convex storage implementation provides a serverless storage solution using [Convex](https://convex.dev), a full-stack TypeScript development platform with real-time sync and automatic caching.
4
4
 
5
- > **Observability Not Supported:** Convex storage **does not support the observability domain**. Traces from the `DefaultExporter` cannot be persisted to Convex, and Mastra Studio's observability features won't work with Convex as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
5
+ > **Observability Not Supported:** Convex storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to Convex, and Mastra Studio's observability features won't work with Convex as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
6
6
 
7
7
  > **Record Size Limit:** Convex enforces a **1 MiB maximum record size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage like S3, Cloudflare R2, or [Convex file storage](https://docs.convex.dev/file-storage).
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  The DynamoDB storage implementation provides a scalable and performant NoSQL database solution for Mastra, leveraging a single-table design pattern with [ElectroDB](https://electrodb.dev/).
4
4
 
5
- > **Observability Not Supported:** DynamoDB storage **does not support the observability domain**. Traces from the `DefaultExporter` cannot be persisted to DynamoDB, and Mastra Studio's observability features won't work with DynamoDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
5
+ > **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to DynamoDB, and Mastra Studio's observability features won't work with DynamoDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
6
6
 
7
7
  > **Item Size Limit:** DynamoDB enforces a **400 KB maximum item size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage.
8
8
 
@@ -211,7 +211,7 @@ aws dynamodb update-time-to-live \
211
211
  1. Go to the DynamoDB console
212
212
  2. Select your table
213
213
  3. Go to "Additional settings" tab
214
- 4. Under "Time to Live (TTL)", click "Manage TTL"
214
+ 4. Under "Time to Live (TTL)", select "Manage TTL"
215
215
  5. Enable TTL and specify the attribute name (default: `ttl`)
216
216
 
217
217
  > **Note:** DynamoDB deletes expired items within 48 hours after expiration. Items remain queryable until actually deleted.
@@ -2,7 +2,7 @@
2
2
 
3
3
  The LanceDB storage implementation provides a high-performance storage solution using the LanceDB database system, which excels at handling both traditional data storage and vector operations.
4
4
 
5
- > **Observability Not Supported:** LanceDB storage **does not support the observability domain**. Traces from the `DefaultExporter` cannot be persisted to LanceDB, and Mastra Studio's observability features won't work with LanceDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
5
+ > **Observability Not Supported:** LanceDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to LanceDB, and Mastra Studio's observability features won't work with LanceDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
6
6
 
7
7
  ## Installation
8
8
 
@@ -101,7 +101,7 @@ const memoryStore = await storage.getStore('memory')
101
101
  const thread = await memoryStore?.getThreadById({ threadId: '...' })
102
102
  ```
103
103
 
104
- > **Warning:** If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
104
+ > **Warning:** If `init()` isn't called, tables won't be created and storage operations will fail silently or throw errors.
105
105
 
106
106
  ### Deployment Options
107
107
 
@@ -136,7 +136,7 @@ const memoryStore = await storage.getStore('memory')
136
136
  const thread = await memoryStore?.getThreadById({ threadId: '...' })
137
137
  ```
138
138
 
139
- > **Warning:** If `init()` is not called, collections won't be created and storage operations will fail silently or throw errors.
139
+ > **Warning:** If `init()` isn't called, collections won't be created and storage operations will fail silently or throw errors.
140
140
 
141
141
  ## Vector Search Capabilities
142
142
 
@@ -138,7 +138,7 @@ const memoryStore = await storage.getStore('memory')
138
138
  const thread = await memoryStore?.getThreadById({ threadId: '...' })
139
139
  ```
140
140
 
141
- > **Warning:** If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
141
+ > **Warning:** If `init()` isn't called, tables won't be created and storage operations will fail silently or throw errors.
142
142
 
143
143
  ### Direct Database and Pool Access
144
144
 
@@ -177,7 +177,7 @@ const memoryStore = await storage.getStore('memory')
177
177
  const thread = await memoryStore?.getThreadById({ threadId: '...' })
178
178
  ```
179
179
 
180
- > **Warning:** If `init()` is not called, tables won't be created and storage operations will fail silently or throw errors.
180
+ > **Warning:** If `init()` isn't called, tables won't be created and storage operations will fail silently or throw errors.
181
181
 
182
182
  ### Using an Existing Pool
183
183
 
@@ -201,7 +201,7 @@ const storage = new PostgresStore({
201
201
 
202
202
  **Pool lifecycle behavior:**
203
203
 
204
- - When you **provide a pool**: Mastra uses your pool but does **not** close it when `store.close()` is called. You manage the pool lifecycle.
204
+ - When you **provide a pool**: Mastra uses your pool but **doesn't** close it when `store.close()` is called. You manage the pool lifecycle.
205
205
  - When Mastra **creates a pool**: Mastra owns the pool and will close it when `store.close()` is called.
206
206
 
207
207
  ### Direct Database and Pool Access
@@ -4,7 +4,7 @@ The Upstash storage implementation provides a serverless-friendly storage soluti
4
4
 
5
5
  > **Pricing:** When using Mastra with Upstash, the pay-as-you-go model can result in unexpectedly high costs due to the high volume of Redis commands generated during agent conversations. We strongly recommend using a **fixed pricing plan** for predictable costs. See [Upstash pricing](https://upstash.com/pricing/redis) for details and [GitHub issue #5850](https://github.com/mastra-ai/mastra/issues/5850) for context.
6
6
 
7
- > **Observability Not Supported:** Upstash storage **does not support the observability domain**. Traces from the `DefaultExporter` cannot be persisted to Upstash, and Mastra Studio's observability features won't work with Upstash as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
7
+ > **Observability Not Supported:** Upstash storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to Upstash, and Mastra Studio's observability features won't work with Upstash as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
8
8
 
9
9
  ## Installation
10
10
 
@@ -1,6 +1,6 @@
1
1
  # Run.observeStream()
2
2
 
3
- The `.observeStream()` method opens a new `ReadableStream` to a workflow run that is currently running, allowing you to observe the stream of events if the original stream is no longer available.
3
+ The `.observeStream()` method opens a new `ReadableStream` to a workflow run that's currently running, allowing you to observe the stream of events if the original stream is no longer available.
4
4
 
5
5
  ## Usage example
6
6
 
@@ -130,7 +130,7 @@ Templates must be:
130
130
  - **Single projects** - Not monorepos with multiple applications
131
131
  - **Framework-free** - No Next.js, Express, or other web framework boilerplate
132
132
  - **Mastra-focused** - Demonstrate Mastra functionality without additional layers
133
- - **Mergeable** - Structure code for easy integration into existing projects
133
+ - **Mergeable** - Structure code for seamless integration into existing projects
134
134
  - **Node.js compatible** - Support Node.js v22.13.0 and later
135
135
  - **ESM modules** - Use ES modules (`"type": "module"` in package.json)
136
136
 
@@ -251,7 +251,7 @@ Additionally:
251
251
 
252
252
  ### Error Handling
253
253
 
254
- Hook errors are caught and logged automatically, but do not prevent tool execution from continuing. If a hook throws an error, it will be logged to the console but will not fail the tool call.
254
+ Hook errors are caught and logged automatically, but don't prevent tool execution from continuing. If a hook throws an error, it will be logged to the console but won't fail the tool call.
255
255
 
256
256
  ## MCP Tool Annotations
257
257
 
@@ -96,9 +96,9 @@ A powerful feature of `MCPServer` is its ability to automatically expose your Ma
96
96
  - **Execution**: When this tool is called, it invokes the `generate()` method of the corresponding agent, passing the provided `query`.
97
97
  - **Output**: The direct result from the agent's `generate()` method is returned as the output of the tool.
98
98
 
99
- - **Name Collisions**: If an explicit tool defined in the `tools` configuration has the same name as an agent-derived tool (e.g., you have a tool named `ask_myAgentKey` and also an agent with the key `myAgentKey`), the _explicitly defined tool will take precedence_. The agent will not be converted into a tool in this conflicting case, and a warning will be logged.
99
+ - **Name Collisions**: If an explicit tool defined in the `tools` configuration has the same name as an agent-derived tool (e.g., you have a tool named `ask_myAgentKey` and also an agent with the key `myAgentKey`), the _explicitly defined tool will take precedence_. The agent won't be converted into a tool in this conflicting case, and a warning will be logged.
100
100
 
101
- This makes it straightforward to allow MCP clients to interact with your agents using natural language queries, just like any other tool.
101
+ This makes it straightforward to allow MCP clients to interact with your agents using natural language queries, like any other tool.
102
102
 
103
103
  ### Agent-to-Tool Conversion
104
104
 
@@ -391,7 +391,7 @@ serve(async req => {
391
391
  >
392
392
  > The serverless mode disables session management and creates fresh server instances per request, which is necessary for stateless environments where memory doesn't persist between invocations.
393
393
  >
394
- > **Note:** The following MCP features require session state or persistent connections and will **not work** in serverless mode:
394
+ > **Note:** The following MCP features require session state or persistent connections and **won't work** in serverless mode:
395
395
  >
396
396
  > - **Elicitation** - Interactive user input requests during tool execution require session management to route responses back to the correct client
397
397
  > - **Resource subscriptions** - `resources/subscribe` and `resources/unsubscribe` need persistent connections to maintain subscription state
@@ -778,7 +778,7 @@ The example at the beginning of this page also demonstrates how to instantiate `
778
778
 
779
779
  ## Elicitation
780
780
 
781
- ### What is Elicitation?
781
+ ### What's Elicitation?
782
782
 
783
783
  Elicitation is a feature in the Model Context Protocol (MCP) that allows servers to request structured information from users. This enables interactive workflows where servers can collect additional data dynamically.
784
784
 
@@ -30,7 +30,7 @@ The ChromaVector class provides vector search using [Chroma](https://docs.trychr
30
30
 
31
31
  ## Running a Chroma Server
32
32
 
33
- If you are a Chroma Cloud user, simply provide the `ChromaVector` constructor your API key, tenant, and database name.
33
+ If you are a Chroma Cloud user, provide the `ChromaVector` constructor your API key, tenant, and database name.
34
34
 
35
35
  When you install the `@mastra/chroma` package, you get access to the [Chroma CLI](https://docs.trychroma.com/docs/cli/db), which can set these as environment variables for you: `chroma db connect [DB-NAME] --env-file`.
36
36
 
@@ -54,7 +54,7 @@ Otherwise, you have several options for setting up your single-node Chroma serve
54
54
 
55
55
  Note: Forking is only supported on Chroma Cloud, or if you deploy your own OSS **distributed** Chroma.
56
56
 
57
- `forkIndex` lets you fork an existing Chroma index instantly. Operations on the forked index do not affect the original one. Learn more on the [Chroma docs](https://docs.trychroma.com/cloud/collection-forking).
57
+ `forkIndex` lets you fork an existing Chroma index instantly. Operations on the forked index don't affect the original one. Learn more on the [Chroma docs](https://docs.trychroma.com/cloud/collection-forking).
58
58
 
59
59
  **indexName** (`string`): Name of the index to fork
60
60