@mastra/mcp-docs-server 1.2.11-alpha.6 → 1.2.12-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 (262) hide show
  1. package/.docs/docs/agents/using-tools.md +25 -0
  2. package/.docs/guides/build-your-ui/ai-sdk-ui.md +5 -5
  3. package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +8 -8
  4. package/.docs/guides/build-your-ui/copilotkit/overview.md +2 -2
  5. package/.docs/guides/build-your-ui/openui.md +1 -1
  6. package/.docs/guides/concepts/multi-agent-systems.md +5 -5
  7. package/.docs/guides/concepts/streaming.md +9 -9
  8. package/.docs/guides/deployment/amazon-ec2.md +1 -1
  9. package/.docs/guides/deployment/aws-lambda.md +1 -1
  10. package/.docs/guides/deployment/azure-app-services.md +1 -1
  11. package/.docs/guides/deployment/cloudflare.md +1 -1
  12. package/.docs/guides/deployment/inngest.md +6 -6
  13. package/.docs/guides/deployment/temporal.md +1 -1
  14. package/.docs/guides/deployment/vercel.md +1 -1
  15. package/.docs/guides/getting-started/astro.md +1 -1
  16. package/.docs/guides/getting-started/electron.md +1 -1
  17. package/.docs/guides/getting-started/nestjs.md +5 -5
  18. package/.docs/guides/getting-started/vite-react.md +1 -1
  19. package/.docs/guides/guide/chef-michel.md +1 -1
  20. package/.docs/guides/guide/code-review-bot.md +1 -1
  21. package/.docs/guides/guide/coding-agent.md +4 -4
  22. package/.docs/guides/guide/dev-assistant.md +1 -1
  23. package/.docs/guides/guide/docs-manager.md +3 -3
  24. package/.docs/guides/guide/github-actions-pr-description.md +4 -4
  25. package/.docs/guides/guide/research-assistant.md +3 -3
  26. package/.docs/guides/guide/research-coordinator.md +3 -3
  27. package/.docs/guides/guide/slack-assistant.md +1 -1
  28. package/.docs/guides/guide/stock-agent.md +1 -1
  29. package/.docs/guides/index.md +1 -1
  30. package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +1 -1
  31. package/.docs/guides/migrations/mastra-cloud.md +6 -6
  32. package/.docs/guides/migrations/network-to-supervisor.md +9 -9
  33. package/.docs/guides/migrations/upgrade-to-v1/agent.md +5 -5
  34. package/.docs/guides/migrations/upgrade-to-v1/cli.md +1 -1
  35. package/.docs/guides/migrations/upgrade-to-v1/client.md +3 -3
  36. package/.docs/guides/migrations/upgrade-to-v1/evals.md +2 -2
  37. package/.docs/guides/migrations/upgrade-to-v1/memory.md +1 -1
  38. package/.docs/guides/migrations/upgrade-to-v1/overview.md +3 -3
  39. package/.docs/guides/migrations/upgrade-to-v1/processors.md +1 -1
  40. package/.docs/guides/migrations/upgrade-to-v1/storage.md +11 -11
  41. package/.docs/guides/migrations/upgrade-to-v1/tools.md +3 -3
  42. package/.docs/guides/migrations/upgrade-to-v1/tracing.md +2 -2
  43. package/.docs/guides/migrations/upgrade-to-v1/voice.md +1 -1
  44. package/.docs/guides/migrations/upgrade-to-v1/workflows.md +1 -1
  45. package/.docs/models/environment-variables.md +1 -0
  46. package/.docs/models/gateways/vercel.md +1 -2
  47. package/.docs/models/index.md +1 -1
  48. package/.docs/models/providers/aiand.md +1 -3
  49. package/.docs/models/providers/berget.md +2 -1
  50. package/.docs/models/providers/hyper.md +7 -7
  51. package/.docs/models/providers/modal.md +73 -0
  52. package/.docs/models/providers/xpersona.md +12 -2
  53. package/.docs/models/providers.md +1 -0
  54. package/.docs/reference/acp/acp-agent.md +3 -3
  55. package/.docs/reference/acp/create-acp-tool.md +2 -2
  56. package/.docs/reference/agent-controller/agent-controller-class.md +36 -36
  57. package/.docs/reference/agent-controller/session.md +6 -6
  58. package/.docs/reference/agents/agent.md +7 -7
  59. package/.docs/reference/agents/channels.md +3 -3
  60. package/.docs/reference/agents/durable-agent.md +3 -3
  61. package/.docs/reference/agents/generate.md +3 -3
  62. package/.docs/reference/agents/getDefaultOptions.md +1 -1
  63. package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
  64. package/.docs/reference/agents/listScorers.md +1 -1
  65. package/.docs/reference/agents/listSkills.md +1 -1
  66. package/.docs/reference/agents/listSuspendedRuns.md +2 -2
  67. package/.docs/reference/ai-sdk/chat-route.md +1 -1
  68. package/.docs/reference/ai-sdk/network-route.md +1 -1
  69. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
  70. package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +1 -1
  71. package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +1 -1
  72. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  73. package/.docs/reference/ai-sdk/workflow-snapshot-to-stream.md +2 -2
  74. package/.docs/reference/auth/auth0.md +1 -1
  75. package/.docs/reference/auth/fga.md +2 -2
  76. package/.docs/reference/auth/google.md +2 -2
  77. package/.docs/reference/auth/okta.md +1 -1
  78. package/.docs/reference/auth/workos.md +2 -2
  79. package/.docs/reference/browser/agent-browser.md +2 -2
  80. package/.docs/reference/browser/browser-viewer.md +3 -3
  81. package/.docs/reference/browser/mastra-browser.md +3 -3
  82. package/.docs/reference/browser/stagehand-browser.md +4 -4
  83. package/.docs/reference/channels/slack-provider.md +2 -2
  84. package/.docs/reference/cli/create-mastra.md +1 -1
  85. package/.docs/reference/cli/mastra.md +23 -23
  86. package/.docs/reference/client-js/agents.md +9 -9
  87. package/.docs/reference/client-js/memory.md +2 -2
  88. package/.docs/reference/client-js/workflows.md +1 -1
  89. package/.docs/reference/coding-agent/build-base-prompt.md +2 -2
  90. package/.docs/reference/coding-agent/create-coding-agent.md +2 -2
  91. package/.docs/reference/configuration.md +6 -6
  92. package/.docs/reference/core/getMCPServer.md +1 -1
  93. package/.docs/reference/core/getScorer.md +1 -1
  94. package/.docs/reference/datasets/addItem.md +1 -1
  95. package/.docs/reference/datasets/listItems.md +1 -1
  96. package/.docs/reference/deployer/netlify.md +4 -4
  97. package/.docs/reference/deployer/vercel.md +7 -7
  98. package/.docs/reference/editor/agent-builder/agent-builder-options.md +4 -4
  99. package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +6 -6
  100. package/.docs/reference/editor/agent-builder/builder-models.md +3 -3
  101. package/.docs/reference/editor/blob-store-provider.md +1 -1
  102. package/.docs/reference/editor/browser-provider.md +3 -3
  103. package/.docs/reference/editor/filesystem-provider.md +4 -4
  104. package/.docs/reference/editor/mastra-editor.md +5 -5
  105. package/.docs/reference/editor/processor-provider.md +3 -3
  106. package/.docs/reference/editor/sandbox-provider.md +4 -4
  107. package/.docs/reference/editor/storage-browser-ref.md +6 -6
  108. package/.docs/reference/editor/storage-workspace-ref.md +4 -4
  109. package/.docs/reference/editor/tool-provider.md +1 -1
  110. package/.docs/reference/evals/answer-relevancy.md +4 -4
  111. package/.docs/reference/evals/bias.md +3 -3
  112. package/.docs/reference/evals/checks.md +3 -3
  113. package/.docs/reference/evals/completeness.md +5 -5
  114. package/.docs/reference/evals/content-similarity.md +5 -5
  115. package/.docs/reference/evals/context-precision.md +2 -2
  116. package/.docs/reference/evals/context-recall.md +8 -8
  117. package/.docs/reference/evals/context-relevance.md +4 -4
  118. package/.docs/reference/evals/create-scorer.md +1 -1
  119. package/.docs/reference/evals/faithfulness.md +3 -3
  120. package/.docs/reference/evals/filter-run.md +2 -2
  121. package/.docs/reference/evals/hallucination.md +6 -6
  122. package/.docs/reference/evals/keyword-coverage.md +6 -6
  123. package/.docs/reference/evals/mastra-scorer.md +9 -3
  124. package/.docs/reference/evals/noise-sensitivity.md +5 -5
  125. package/.docs/reference/evals/prompt-alignment.md +5 -5
  126. package/.docs/reference/evals/rubric.md +1 -1
  127. package/.docs/reference/evals/run-evals.md +3 -3
  128. package/.docs/reference/evals/scorer-utils.md +4 -4
  129. package/.docs/reference/evals/textual-difference.md +4 -4
  130. package/.docs/reference/evals/tool-call-accuracy.md +1 -1
  131. package/.docs/reference/evals/toxicity.md +4 -4
  132. package/.docs/reference/evals/trajectory-accuracy.md +10 -10
  133. package/.docs/reference/file-based-agents/instructions.md +2 -2
  134. package/.docs/reference/file-based-agents/logger.md +1 -1
  135. package/.docs/reference/file-based-agents/observability.md +1 -1
  136. package/.docs/reference/file-based-agents/processors.md +1 -1
  137. package/.docs/reference/file-based-agents/skills.md +1 -1
  138. package/.docs/reference/file-based-agents/storage.md +1 -1
  139. package/.docs/reference/file-based-agents/studio.md +1 -1
  140. package/.docs/reference/file-based-agents/subagents.md +1 -1
  141. package/.docs/reference/file-based-agents/tools.md +1 -1
  142. package/.docs/reference/file-based-agents/workspace.md +1 -1
  143. package/.docs/reference/logging/pino-logger.md +3 -3
  144. package/.docs/reference/memory/clone-utilities.md +1 -1
  145. package/.docs/reference/memory/cloneThread.md +3 -3
  146. package/.docs/reference/memory/listThreads.md +1 -1
  147. package/.docs/reference/memory/memory-class.md +1 -1
  148. package/.docs/reference/memory/observational-memory.md +11 -11
  149. package/.docs/reference/memory/recall.md +2 -2
  150. package/.docs/reference/memory/serialized-memory-config.md +4 -4
  151. package/.docs/reference/memory/summarizeConversation.md +3 -3
  152. package/.docs/reference/memory/summarizeThread.md +3 -3
  153. package/.docs/reference/observability/feedback.md +1 -1
  154. package/.docs/reference/observability/metrics/automatic-metrics.md +7 -7
  155. package/.docs/reference/observability/tracing/bridges/datadog.md +2 -2
  156. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +3 -3
  157. package/.docs/reference/observability/tracing/exporters/default-exporter.md +1 -1
  158. package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +4 -4
  159. package/.docs/reference/observability/tracing/exporters/mastra-storage-exporter.md +1 -1
  160. package/.docs/reference/observability/tracing/interfaces.md +1 -1
  161. package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +1 -1
  162. package/.docs/reference/observability/tracing/span-filtering.md +1 -1
  163. package/.docs/reference/processors/cost-guard-processor.md +1 -1
  164. package/.docs/reference/processors/pii-detector.md +1 -1
  165. package/.docs/reference/processors/processor-interface.md +12 -12
  166. package/.docs/reference/processors/prompt-injection-detector.md +1 -1
  167. package/.docs/reference/processors/provider-history-compat.md +1 -1
  168. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  169. package/.docs/reference/processors/response-cache.md +8 -8
  170. package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
  171. package/.docs/reference/processors/token-limiter-processor.md +1 -1
  172. package/.docs/reference/processors/tool-search-processor.md +7 -7
  173. package/.docs/reference/processors/unicode-normalizer.md +1 -1
  174. package/.docs/reference/project-structure.md +1 -1
  175. package/.docs/reference/pubsub/base.md +4 -4
  176. package/.docs/reference/pubsub/google-cloud-pubsub.md +2 -2
  177. package/.docs/reference/pubsub/lease-provider.md +4 -4
  178. package/.docs/reference/pubsub/redis-streams.md +1 -1
  179. package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
  180. package/.docs/reference/rag/chunk.md +5 -5
  181. package/.docs/reference/rag/database-config.md +2 -2
  182. package/.docs/reference/rag/metadata-filters.md +2 -2
  183. package/.docs/reference/schedules/overview.md +1 -1
  184. package/.docs/reference/server/register-api-route.md +1 -1
  185. package/.docs/reference/server/routes.md +1 -1
  186. package/.docs/reference/signals/signal-provider.md +8 -8
  187. package/.docs/reference/storage/clickhouse.md +4 -4
  188. package/.docs/reference/storage/cloudflare-d1.md +4 -4
  189. package/.docs/reference/storage/convex.md +4 -4
  190. package/.docs/reference/storage/dsql.md +2 -2
  191. package/.docs/reference/storage/dynamodb.md +7 -7
  192. package/.docs/reference/storage/lance.md +1 -1
  193. package/.docs/reference/storage/mongodb.md +1 -1
  194. package/.docs/reference/storage/mssql.md +1 -1
  195. package/.docs/reference/storage/postgresql.md +1 -1
  196. package/.docs/reference/storage/retention.md +33 -33
  197. package/.docs/reference/storage/spanner.md +8 -8
  198. package/.docs/reference/streaming/ChunkType.md +2 -2
  199. package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
  200. package/.docs/reference/streaming/agents/stream.md +1 -1
  201. package/.docs/reference/streaming/agents/streamUntilIdle.md +2 -2
  202. package/.docs/reference/streaming/workflows/observeStream.md +1 -1
  203. package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
  204. package/.docs/reference/streaming/workflows/stream.md +1 -1
  205. package/.docs/reference/streaming/workflows/timeTravelStream.md +2 -2
  206. package/.docs/reference/templates/overview.md +1 -1
  207. package/.docs/reference/tools/brightdata.md +1 -1
  208. package/.docs/reference/tools/create-tool.md +1 -1
  209. package/.docs/reference/tools/graph-rag-tool.md +1 -1
  210. package/.docs/reference/tools/mcp-client.md +13 -13
  211. package/.docs/reference/tools/mcp-server.md +20 -20
  212. package/.docs/reference/tools/submit-plan-tool.md +1 -1
  213. package/.docs/reference/tools/tavily.md +1 -1
  214. package/.docs/reference/tools/vector-query-tool.md +4 -4
  215. package/.docs/reference/vectors/astra.md +1 -1
  216. package/.docs/reference/vectors/chroma.md +2 -2
  217. package/.docs/reference/vectors/convex.md +2 -2
  218. package/.docs/reference/vectors/couchbase.md +4 -4
  219. package/.docs/reference/vectors/libsql.md +1 -1
  220. package/.docs/reference/vectors/mongodb.md +1 -1
  221. package/.docs/reference/vectors/pg.md +4 -4
  222. package/.docs/reference/vectors/qdrant.md +2 -2
  223. package/.docs/reference/vectors/s3vectors.md +4 -4
  224. package/.docs/reference/vectors/turbopuffer.md +1 -1
  225. package/.docs/reference/voice/aws-nova-sonic.md +1 -1
  226. package/.docs/reference/voice/azure.md +1 -1
  227. package/.docs/reference/voice/google-gemini-live.md +4 -4
  228. package/.docs/reference/voice/inworld-realtime.md +7 -7
  229. package/.docs/reference/voice/livekit.md +13 -13
  230. package/.docs/reference/voice/mistral.md +1 -1
  231. package/.docs/reference/voice/openai-realtime.md +1 -1
  232. package/.docs/reference/voice/sarvam.md +1 -1
  233. package/.docs/reference/voice/voice.addTools.md +1 -1
  234. package/.docs/reference/voice/voice.events.md +1 -1
  235. package/.docs/reference/voice/voice.getSpeakers.md +2 -2
  236. package/.docs/reference/voice/voice.on.md +2 -2
  237. package/.docs/reference/voice/xai-realtime.md +2 -2
  238. package/.docs/reference/workflows/run-methods/cancel.md +1 -1
  239. package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
  240. package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
  241. package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
  242. package/.docs/reference/workflows/workflow-methods/sleep.md +1 -1
  243. package/.docs/reference/workflows/workflow-state-reader.md +2 -2
  244. package/.docs/reference/workspace/apple-container-sandbox.md +2 -2
  245. package/.docs/reference/workspace/daytona-sandbox.md +3 -3
  246. package/.docs/reference/workspace/docker-sandbox.md +2 -2
  247. package/.docs/reference/workspace/e2b-sandbox.md +2 -2
  248. package/.docs/reference/workspace/files-sdk-filesystem.md +3 -3
  249. package/.docs/reference/workspace/google-drive-filesystem.md +4 -4
  250. package/.docs/reference/workspace/local-filesystem.md +2 -2
  251. package/.docs/reference/workspace/local-sandbox.md +2 -2
  252. package/.docs/reference/workspace/modal-sandbox.md +1 -1
  253. package/.docs/reference/workspace/platform-filesystem.md +3 -3
  254. package/.docs/reference/workspace/platform-sandbox.md +2 -2
  255. package/.docs/reference/workspace/process-manager.md +1 -1
  256. package/.docs/reference/workspace/railway-sandbox.md +4 -4
  257. package/.docs/reference/workspace/s3-filesystem.md +1 -1
  258. package/.docs/reference/workspace/sandbox.md +1 -1
  259. package/.docs/reference/workspace/vercel-sandbox.md +1 -1
  260. package/.docs/reference/workspace/workspace-class.md +10 -10
  261. package/CHANGELOG.md +14 -0
  262. package/package.json +6 -6
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Agent.getDefaultOptions()
4
4
 
5
- Agents can be configured with default options for memory usage, output format, and iteration steps. The `.getDefaultOptions()` method returns these defaults, resolving them if they're functions. These options apply to all `stream()` and `generate()` calls unless overridden and are useful for inspecting an agent’s unknown defaults.
5
+ Agents can be configured with default options for memory usage and output format. Iteration steps can also be configured. The `.getDefaultOptions()` method returns these defaults, resolving them if they're functions. These options apply to all `stream()` and `generate()` calls unless overridden and are useful for inspecting an agent’s unknown defaults.
6
6
 
7
7
  ## Usage example
8
8
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **Warning:** **Deprecated**: This method is deprecated and only works with V1 models. For V2 models, use the new [`.getDefaultOptions()`](https://mastra.ai/reference/agents/getDefaultOptions) method instead.
6
6
 
7
- Agents can be configured with default streaming options for memory usage, output format, and iteration steps. The `.getDefaultStreamOptionsLegacy()` method returns these defaults, resolving them if they're functions. These options apply to all `streamLegacy()` calls unless overridden and are useful for inspecting an agent’s unknown defaults.
7
+ Agents can be configured with default streaming options for memory usage and output format. Iteration steps can also be configured. The `.getDefaultStreamOptionsLegacy()` method returns these defaults, resolving them if they're functions. These options apply to all `streamLegacy()` calls unless overridden and are useful for inspecting an agent’s unknown defaults.
8
8
 
9
9
  ## Usage example
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Agent.listScorers()
4
4
 
5
- The `.listScorers()` method retrieves the scoring configuration configured for an agent, resolving it if it's a function. This method provides access to the scoring system used for evaluating agent responses and performance.
5
+ The `.listScorers()` method retrieves the scoring configuration configured for an agent, resolving it if it's a function. The method provides access to the scoring system used for evaluating agent responses and performance.
6
6
 
7
7
  ## Usage example
8
8
 
@@ -46,7 +46,7 @@ interface SkillMetadata {
46
46
 
47
47
  ## Merging behavior
48
48
 
49
- When both agent-level skills and workspace skills are configured, `.listSkills()` returns the merged set. Agent-level skills take precedence on name conflicts if both define a skill named `code-review`, only the agent-level version is returned.
49
+ When both agent-level skills and workspace skills are configured, `.listSkills()` returns the merged set. Agent-level skills take precedence on name conflicts. If both define a skill called `code-review`, only the agent-level version is returned.
50
50
 
51
51
  ## Related
52
52
 
@@ -12,7 +12,7 @@ The filter contract mirrors the workflow run listing APIs (`listWorkflowRuns`),
12
12
 
13
13
  ## Usage example
14
14
 
15
- Discover the pending run for a conversation and continue it. Check `requiresApproval` to pick the right continuation `approveToolCall()` / `declineToolCall()` for approval suspensions, `resumeStream()` with resume data for `suspend()`-based suspensions:
15
+ Discover the pending run for a conversation and continue it. Check `requiresApproval` to pick the right continuation: `approveToolCall()` / `declineToolCall()` for approval suspensions, `resumeStream()` with resume data for `suspend()`-based suspensions:
16
16
 
17
17
  ```typescript
18
18
  const { runs } = await agent.listSuspendedRuns({
@@ -83,7 +83,7 @@ interface AgentRunToolCall {
83
83
 
84
84
  ## Discovery scope
85
85
 
86
- Results are scoped to runs started by the agent you call `listSuspendedRuns()` on: snapshots persist the owning agent's id, so runs started by other agents on the same Mastra instance aren't returned. In [supervisor setups](https://mastra.ai/docs/agents/agent-approval) the supervisor sees its outer run the one to resume while a subagent's inner run is only visible from the subagent itself. Filter by `threadId` and `resourceId` to scope results to one conversation.
86
+ Results are scoped to runs started by the agent you call `listSuspendedRuns()` on: snapshots persist the owning agent's id, so runs started by other agents on the same Mastra instance aren't returned. In [supervisor setups](https://mastra.ai/docs/agents/agent-approval) the supervisor sees its outer run (the one to resume), while a subagent's inner run is only visible from the subagent itself. Filter by `threadId` and `resourceId` to scope results to one conversation.
87
87
 
88
88
  Run snapshots are only persisted while a run is waiting on input and are deleted when it finishes, so suspended runs are the only runs discoverable from storage. Suspended runs only survive restarts when the Mastra instance has a persistent [storage provider](https://mastra.ai/docs/storage/overview) configured. With the default in-memory store, snapshots are lost on restart.
89
89
 
@@ -32,7 +32,7 @@ export const mastra = new Mastra({
32
32
  })
33
33
  ```
34
34
 
35
- You can also use dynamic agent routing based on an `agentId`. The URL `/chat/weatherAgent` will resolve to the agent with the ID `weatherAgent`.
35
+ You can also use runtime-defined agent routing based on an `agentId`. The URL `/chat/weatherAgent` will resolve to the agent with the ID `weatherAgent`.
36
36
 
37
37
  ```typescript
38
38
  import { Mastra } from '@mastra/core'
@@ -30,7 +30,7 @@ export const mastra = new Mastra({
30
30
  })
31
31
  ```
32
32
 
33
- You can also use dynamic agent routing based on an `agentId`. The URL `/network/weatherAgent` will resolve to the agent with the ID `weatherAgent`.
33
+ You can also use runtime-defined agent routing based on an `agentId`. The URL `/network/weatherAgent` will resolve to the agent with the ID `weatherAgent`.
34
34
 
35
35
  ```typescript
36
36
  import { Mastra } from '@mastra/core'
@@ -2,7 +2,7 @@
2
2
 
3
3
  # toAISdkMessages()
4
4
 
5
- Converts messages from various input formats to AI SDK UI message format. `toAISdkMessages()` keeps the existing AI SDK v5/default behavior. If your app is typed against AI SDK v6, pass `version: 'v6'`.
5
+ Converts messages from input formats to AI SDK UI message format. `toAISdkMessages()` keeps the existing AI SDK v5/default behavior. If your app is typed against AI SDK v6, pass `version: 'v6'`.
6
6
 
7
7
  `version: 'v6'` uses the MessageList AI SDK v6 UI output path. MessageList input detection and ingestion remain unchanged.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # toAISdkV4Messages()
4
4
 
5
- Converts messages from various input formats to AI SDK V4 UI message format. This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V4 `UIMessage` format, which is suitable for use with AI SDK UI components like `useChat()`.
5
+ Converts messages from input formats to AI SDK V4 UI message format. This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V4 `UIMessage` format, which is suitable for use with AI SDK UI components like `useChat()`.
6
6
 
7
7
  ## Usage example
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # toAISdkV5Messages()
4
4
 
5
- Converts messages from various input formats to AI SDK V5 (and later) UI message format. This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V5+ `UIMessage` format, which is suitable for use with AI SDK UI components like `useChat()`.
5
+ Converts messages from input formats to AI SDK V5 (and later) UI message format. This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V5+ `UIMessage` format, which is suitable for use with AI SDK UI components like `useChat()`.
6
6
 
7
7
  ## Usage example
8
8
 
@@ -32,7 +32,7 @@ export const mastra = new Mastra({
32
32
  })
33
33
  ```
34
34
 
35
- You can also use dynamic workflow routing based on a `workflowId`. The URL `/workflow/weatherWorkflow` will resolve to the workflow with the ID `weatherWorkflow`.
35
+ You can also use runtime-defined workflow routing based on a `workflowId`. The URL `/workflow/weatherWorkflow` will resolve to the workflow with the ID `weatherWorkflow`.
36
36
 
37
37
  ```typescript
38
38
  import { Mastra } from '@mastra/core'
@@ -36,10 +36,10 @@ export async function GET(req: Request) {
36
36
 
37
37
  ## Returns
38
38
 
39
- `ReadableStream` A stream of AI SDK UIMessage data parts containing:
39
+ `ReadableStream`: A stream of AI SDK UIMessage data parts containing:
40
40
 
41
41
  - A `start` marker
42
- - A `WorkflowDataPart` with the overall workflow status and all step summaries
42
+ - A `WorkflowDataPart` with the workflow status and all step summaries
43
43
  - A `WorkflowStepDataPart` for each step with its full output
44
44
  - A `finish` marker
45
45
 
@@ -20,7 +20,7 @@ export const mastra = new Mastra({
20
20
  })
21
21
  ```
22
22
 
23
- > **Note:** You can omit the constructor parameters if you have the appropriately named environment variables (`AUTH0_DOMAIN` and `AUTH0_AUDIENCE`) set. In that case, use `new MastraAuthAuth0()` without any arguments.
23
+ > **Note:** You can omit the constructor parameters if the required environment variables (`AUTH0_DOMAIN` and `AUTH0_AUDIENCE`) are set. In that case, use `new MastraAuthAuth0()` without any arguments.
24
24
 
25
25
  ## Constructor parameters
26
26
 
@@ -61,7 +61,7 @@ Returns: `Promise<T[]>`
61
61
 
62
62
  Authorizes a non-user system actor, such as an autonomous or scheduled agent. Optional.
63
63
 
64
- System actors skip the user-centric `require()` path, so implement `requireActor` to enforce per-agent least privilege for them. Throw `FGADeniedError` to deny. When a provider doesn't implement `requireActor`, Mastra preserves the trusted-actor bypass (allow after the tenant-scope check), so adding it is backward compatible.
64
+ System actors skip the user-centric `require()` path, so implement `requireActor` to enforce per-agent least privilege for them. Throw `FGADeniedError` to deny. When a provider doesn't implement `requireActor`, Mastra preserves the trusted-actor bypass (allow after the tenant-scope check), so adding the method remains backward compatible.
65
65
 
66
66
  Treat `actor.permissions` as an untrusted claim. Resolve the agent's authoritative grants from a trusted source keyed by `actor.agentId`, rather than trusting the inline values. See [System actors](https://mastra.ai/docs/server/auth/fga).
67
67
 
@@ -110,7 +110,7 @@ The `params` argument passed to `check`, `require`, and `requireActor`.
110
110
 
111
111
  ## `ActorSignal`
112
112
 
113
- Identifies a call made by a trusted non-user actor rather than an authenticated end user. It is either `true` (the anonymous system shorthand) or an object that names the acting agent and carries the grants a provider can enforce.
113
+ Identifies a call made by a trusted non-user actor rather than an authenticated end user. It's either `true` (the anonymous system shorthand) or an object that names the acting agent and carries the grants a provider can enforce.
114
114
 
115
115
  **actorKind** (`'system'`): Marks the object form of the signal.
116
116
 
@@ -24,7 +24,7 @@ export const mastra = new Mastra({
24
24
  })
25
25
  ```
26
26
 
27
- > **Note:** You can omit the constructor parameters if you have the appropriately named environment variables set. In that case, use `new MastraAuthGoogle()` without any arguments.
27
+ > **Note:** You can omit the constructor parameters if the required environment variables are set. In that case, use `new MastraAuthGoogle()` without any arguments.
28
28
 
29
29
  ### Constructor parameters
30
30
 
@@ -72,7 +72,7 @@ The following environment variables are automatically used when constructor opti
72
72
 
73
73
  `MastraAuthGoogle` authenticates requests in the following order:
74
74
 
75
- 1. **Session cookie**: When SSO is enabled, reads the encrypted session cookie and decrypts it. If the session is valid and not expired, the user is authenticated.
75
+ 1. **Session cookie.** With SSO enabled, the provider reads and decrypts the encrypted session cookie. A valid, unexpired session authenticates the user.
76
76
  2. **Google ID token fallback**: If no valid session cookie is present, verifies the `Authorization` header token against Google's JWKS endpoint.
77
77
 
78
78
  After authentication, `authorizeUser` checks that the user has a valid Google user ID, the token-derived expiration hasn't passed, and the user's verified `hd` claim matches `allowedDomains` when domains are configured.
@@ -24,7 +24,7 @@ export const mastra = new Mastra({
24
24
  })
25
25
  ```
26
26
 
27
- > **Note:** You can omit the constructor parameters if you have the appropriately named environment variables set. In that case, use `new MastraAuthOkta()` without any arguments.
27
+ > **Note:** You can omit the constructor parameters if the required environment variables are set. In that case, use `new MastraAuthOkta()` without any arguments.
28
28
 
29
29
  ### Constructor parameters
30
30
 
@@ -20,7 +20,7 @@ export const mastra = new Mastra({
20
20
  })
21
21
  ```
22
22
 
23
- > **Note:** You can omit the constructor parameters if you have the appropriately named environment variables (`WORKOS_API_KEY` and `WORKOS_CLIENT_ID`) set. In that case, use `new MastraAuthWorkos()` without any arguments.
23
+ > **Note:** You can omit the constructor parameters if the required environment variables (`WORKOS_API_KEY` and `WORKOS_CLIENT_ID`) are set. In that case, use `new MastraAuthWorkos()` without any arguments.
24
24
 
25
25
  ## Constructor parameters
26
26
 
@@ -56,7 +56,7 @@ By default, `MastraAuthWorkos` authorizes any authenticated WorkOS user whose re
56
56
  2. **User Retrieval**: User information is extracted from the verified token
57
57
  3. **Authorization Decision**: Access is granted if the resolved user contains the required identifiers
58
58
 
59
- This means that by default, `MastraAuthWorkos` acts as an authentication provider rather than a role gate.
59
+ `MastraAuthWorkos` acts as an authentication provider rather than a role gate by default.
60
60
 
61
61
  ## FGA membership loading
62
62
 
@@ -107,7 +107,7 @@ Navigate to a URL.
107
107
 
108
108
  | Parameter | Type | Description |
109
109
  | ----------- | ----------------------------------------------- | ----------------------------------------------- |
110
- | `url` | `string` | URL to navigate to |
110
+ | `url` | `string` | URL to open |
111
111
  | `waitUntil` | `"load" \| "domcontentloaded" \| "networkidle"` | When to consider navigation complete (optional) |
112
112
  | `timeout` | `number` | Navigation timeout in ms (optional) |
113
113
 
@@ -358,7 +358,7 @@ Execute JavaScript in the page context. Use as an escape hatch when other tools
358
358
 
359
359
  ### `browser_screenshot`
360
360
 
361
- Capture a screenshot of the current page as PNG (viewport by default; set `fullPage: true` for full-page capture). Returns image content that vision-capable models can interpret directly. Use `browser_snapshot` when you only need text or structured data.
361
+ Capture a screenshot of the current page as PNG (viewport by default. Set `fullPage: true` for full-page capture). Returns image content that vision-capable models can interpret directly. Use `browser_snapshot` when you only need text or structured data.
362
362
 
363
363
  ```text
364
364
  // Viewport only (default)
@@ -227,6 +227,6 @@ browse skills install
227
227
 
228
228
  ## Related
229
229
 
230
- - [BrowserViewer guide](https://mastra.ai/docs/browser/browser-viewer) setup and usage walkthrough
231
- - [MastraBrowser](https://mastra.ai/reference/browser/mastra-browser) base class API reference
232
- - [Workspace overview](https://mastra.ai/docs/workspace/overview) workspace configuration
230
+ - [BrowserViewer guide](https://mastra.ai/docs/browser/browser-viewer): Setup and usage walkthrough
231
+ - [MastraBrowser](https://mastra.ai/reference/browser/mastra-browser): Base class API reference
232
+ - [Workspace overview](https://mastra.ai/docs/workspace/overview): Workspace configuration
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MastraBrowser class
4
4
 
5
- The `MastraBrowser` class is the abstract base class for browser automation providers. It defines the common interface for launching browsers, managing thread isolation, streaming screencasts, and handling input events.
5
+ The `MastraBrowser` class is the abstract base class for browser automation providers. Its common interface covers browser launch and thread isolation, plus screencast streaming and input events.
6
6
 
7
7
  You don't instantiate `MastraBrowser` directly. Instead, use a provider implementation:
8
8
 
@@ -135,7 +135,7 @@ const hasSession = browser.hasThreadSession('thread-123')
135
135
 
136
136
  #### `closeThreadSession(threadId)`
137
137
 
138
- Closes a specific thread's browser session. For 'thread' scope, this closes that thread's browser instance. For 'shared' scope, this clears the thread's state.
138
+ Closes a specific thread's browser session. With 'thread' scope, it closes that thread's browser instance. With 'shared' scope, it clears the thread state.
139
139
 
140
140
  ```typescript
141
141
  await browser.closeThreadSession('thread-123')
@@ -145,7 +145,7 @@ await browser.closeThreadSession('thread-123')
145
145
 
146
146
  #### `getTools()`
147
147
 
148
- Returns the browser tools for use with agents. Each provider returns different tools based on its paradigm.
148
+ Returns the browser tools for use with agents. Each provider returns different tools based on its model.
149
149
 
150
150
  ```typescript
151
151
  const tools = browser.getTools()
@@ -79,7 +79,7 @@ Core tools:
79
79
  | ---------------------- | ------------------------------------------------------------------------------------- |
80
80
  | `stagehand_act` | Perform actions using natural language instructions |
81
81
  | `stagehand_extract` | Extract structured data from pages |
82
- | `stagehand_observe` | Discover actionable elements on a page |
82
+ | `stagehand_observe` | Discover useful elements on a page |
83
83
  | `stagehand_navigate` | Navigate to a URL |
84
84
  | `stagehand_tabs` | Manage browser tabs |
85
85
  | `stagehand_screenshot` | Capture a screenshot as PNG (viewport by default; set `fullPage: true` for full page) |
@@ -171,7 +171,7 @@ interface ExtractResult<T = unknown> {
171
171
 
172
172
  ### `stagehand_observe`
173
173
 
174
- Discover actionable elements on a page. Returns a list of elements with their selectors and descriptions.
174
+ Discover useful elements on a page. Returns a list of elements with their selectors and descriptions.
175
175
 
176
176
  ```text
177
177
  // Find specific elements
@@ -222,7 +222,7 @@ Navigate to a URL.
222
222
 
223
223
  | Parameter | Type | Description |
224
224
  | ----------- | ----------------------------------------------- | ----------------------------------------------- |
225
- | `url` | `string` | URL to navigate to (required) |
225
+ | `url` | `string` | URL to open (required) |
226
226
  | `waitUntil` | `"load" \| "domcontentloaded" \| "networkidle"` | When to consider navigation complete (optional) |
227
227
 
228
228
  ### `stagehand_tabs`
@@ -245,7 +245,7 @@ Manage browser tabs.
245
245
 
246
246
  ### `stagehand_screenshot`
247
247
 
248
- Capture a screenshot of the current page as PNG (viewport by default; set `fullPage: true` for full-page capture). Returns image content that vision-capable models can interpret directly. Use `stagehand_observe` or `stagehand_extract` when you only need text or structured data.
248
+ Capture a screenshot of the current page as PNG (viewport by default. Set `fullPage: true` for full-page capture). Returns image content that vision-capable models can interpret directly. Use `stagehand_observe` or `stagehand_extract` when you only need text or structured data.
249
249
 
250
250
  ```text
251
251
  // Viewport only (default)
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## Usage example
8
8
 
9
- Register the provider on the `Mastra` constructor. The refresh token is single-use and rotates on startup; the resulting access tokens are persisted to `Mastra.storage`.
9
+ Register the provider on the `Mastra` constructor. The refresh token is single-use and rotates on startup. The resulting access tokens are persisted to `Mastra.storage`.
10
10
 
11
11
  ```typescript
12
12
  import { Mastra } from '@mastra/core/mastra'
@@ -171,7 +171,7 @@ slack.setBaseUrl('https://abc123.trycloudflare.com')
171
171
 
172
172
  #### `initialize()`
173
173
 
174
- Recreates a `SlackAdapter` for each active installation in storage and injects `AgentChannels` into the corresponding agent so it receives Slack events on startup. Doesn't auto-provision new apps; use `connect()` to create one. Mastra calls this automatically, so you rarely call it directly.
174
+ Recreates a `SlackAdapter` for each active installation in storage and injects `AgentChannels` into the corresponding agent so it receives Slack events on startup. Doesn't auto-provision new apps. Use `connect()` to create one. Mastra calls this automatically, so you rarely call it directly.
175
175
 
176
176
  ```typescript
177
177
  await slack.initialize()
@@ -60,7 +60,7 @@ yarn dlx create-mastra@latest my-mastra-project --llm anthropic
60
60
  bun x create-mastra@latest my-mastra-project --llm anthropic
61
61
  ```
62
62
 
63
- Omit `--llm` to select the provider and optionally enter its API key interactively. The interactive setup also offers to connect your project to the Mastra platform. If enabled, the command opens the browser authentication flow, creates a platform project with the same name as the local project, and writes `MASTRA_PLATFORM_ACCESS_TOKEN` and `MASTRA_PROJECT_ID` to `.env`.
63
+ Omit `--llm` to select the provider and optionally enter its API key interactively. The interactive setup also offers to connect your project to the Mastra platform. If enabled, the command opens the browser authentication flow and creates a platform project with the same name as the local project. It then writes `MASTRA_PLATFORM_ACCESS_TOKEN` and `MASTRA_PROJECT_ID` to `.env`.
64
64
 
65
65
  ### Template
66
66
 
@@ -32,7 +32,7 @@ Comma-separated list of custom arguments to pass to the Node.js process, e.g. `-
32
32
 
33
33
  #### `--request-context-presets`
34
34
 
35
- Path to a JSON file containing named [request context](https://mastra.ai/docs/server/request-context) presets. When provided, a dropdown displays in Studio's request context editor, letting you quickly switch between preset configurations.
35
+ Path to a JSON file containing [request context](https://mastra.ai/docs/server/request-context) presets. When provided, a dropdown displays in Studio's request context editor, letting you quickly switch between preset configurations.
36
36
 
37
37
  ```bash
38
38
  mastra dev --request-context-presets ./presets.json
@@ -49,7 +49,7 @@ The file must be a JSON object where each key is a preset name and each value is
49
49
 
50
50
  ### Configs
51
51
 
52
- You can set certain environment variables to modify the behavior of `mastra dev`.
52
+ You can set environment variables to modify the behavior of `mastra dev`.
53
53
 
54
54
  #### Skip peer dependency check
55
55
 
@@ -121,7 +121,7 @@ Under the hood Mastra's Rollup server locates your Mastra entry file and bundles
121
121
 
122
122
  The output in `.mastra` can be deployed to any cloud server using [`mastra start`](#mastra-start).
123
123
 
124
- If you're deploying to a [serverless platform](https://mastra.ai/docs/deployment/cloud-providers) you need to install the correct deployer in order to receive the correct output in `.mastra`.
124
+ If you're deploying to a [serverless platform](https://mastra.ai/docs/deployment/cloud-providers) you need to install the correct deployer to receive the correct output in `.mastra`.
125
125
 
126
126
  It accepts [common flags](#common-flags).
127
127
 
@@ -133,7 +133,7 @@ Bundle the Studio UI with the build.
133
133
 
134
134
  ### Configs
135
135
 
136
- You can set certain environment variables to modify the behavior of `mastra build`.
136
+ You can set environment variables to modify the behavior of `mastra build`.
137
137
 
138
138
  #### Skip peer dependency check
139
139
 
@@ -199,7 +199,7 @@ The API route prefix of the Mastra API server. Defaults to `/api`.
199
199
 
200
200
  #### `--request-context-presets`
201
201
 
202
- Path to a JSON file containing named [request context](https://mastra.ai/docs/server/request-context) presets. Works the same as the [`mastra dev` flag](#--request-context-presets).
202
+ Path to a JSON file containing [request context](https://mastra.ai/docs/server/request-context) presets. Works the same as the [`mastra dev` flag](#--request-context-presets).
203
203
 
204
204
  ```bash
205
205
  mastra studio --request-context-presets ./presets.json
@@ -207,7 +207,7 @@ mastra studio --request-context-presets ./presets.json
207
207
 
208
208
  ## `mastra deploy`
209
209
 
210
- Builds and deploys your project to a named environment on Mastra platform. This is the recommended command for all new deploys and replaces both [`mastra studio deploy`](#mastra-studio-deploy) and [`mastra server deploy`](#mastra-server-deploy), which continue to work but should no longer be used for new setups.
210
+ Builds and deploys your project to the Mastra platform environment selected by `--env`. This is the recommended command for all new deploys and replaces both [`mastra studio deploy`](#mastra-studio-deploy) and [`mastra server deploy`](#mastra-server-deploy), which continue to work but should no longer be used for new setups.
211
211
 
212
212
  Requires authentication via [`mastra auth login`](#mastra-auth-login) or a `MASTRA_API_TOKEN` environment variable.
213
213
 
@@ -217,7 +217,7 @@ mastra deploy --env staging
217
217
  mastra deploy --env production --region eu
218
218
  ```
219
219
 
220
- The command runs `mastra build`, zips the output, uploads it to the selected environment, and then polls the deploy status while streaming build logs until the deploy reaches a terminal state.
220
+ The command runs `mastra build` and zips the output before uploading it to the selected environment. It then polls the deploy status while streaming build logs until the deploy reaches a terminal state.
221
221
 
222
222
  Organization, project, and environment are resolved in order from: environment variable (`MASTRA_ORG_ID`, `MASTRA_PROJECT_ID`), CLI flag (`--org`, `--project`, `--env`), `.mastra-project.json` config file, current org from credentials, and lastly interactive prompt. On first deploy, the CLI saves the resolved org and project IDs to `.mastra-project.json` so subsequent deploys skip the prompts.
223
223
 
@@ -294,9 +294,9 @@ mastra deploy --env staging --yes
294
294
 
295
295
  ## `mastra env`
296
296
 
297
- Manages environments on Mastra platform. Environments are named deploy targets (for example `production`, `staging`, `preview-42`) that belong to a project. The current organization is resolved from stored credentials.
297
+ Manages environments on Mastra platform. Environments are deploy targets (for example `production`, `staging`, `preview-42`) that belong to a project. The current organization is resolved from stored credentials.
298
298
 
299
- Every subcommand resolves its project from, in order: the `MASTRA_PROJECT_ID` environment variable, the `--project <name|slug|id>` flag, or the `.mastra-project.json` file written by [`mastra deploy`](#mastra-deploy) in the current directory. Run from your project directory and you never need to name the project.
299
+ Every subcommand resolves its project in a fixed order. It first checks the `MASTRA_PROJECT_ID` environment variable and the `--project <name|slug|id>` flag. It then reads the `.mastra-project.json` file written by [`mastra deploy`](#mastra-deploy) in the current directory. Run from your project directory and you never need to name the project.
300
300
 
301
301
  ### `mastra env list`
302
302
 
@@ -356,7 +356,7 @@ mastra env restart <env>
356
356
 
357
357
  ### `mastra env vars pull`
358
358
 
359
- Pulls an environment's env vars into a local env file (default: `.env`). The file contains the merged set a deploy actually runs with: vars stored on the environment (for example, added in the dashboard's environment editor) plus project-level vars, with project values winning on conflict. Managed vars injected by attached databases are listed as comments (names only) since their values are platform-managed secrets.
359
+ Pulls an environment's env vars into a local env file (default: `.env`). The file contains the merged set used by a deploy. It combines vars stored on the environment (for example, added in the dashboard's environment editor) with project-level vars. Project values win on conflict. Managed vars injected by attached databases are listed as comments (names only) since their values are platform-managed secrets.
360
360
 
361
361
  ```bash
362
362
  mastra env vars pull
@@ -373,7 +373,7 @@ File to write. Defaults to `.env`.
373
373
 
374
374
  Manages databases attached to a project on Mastra platform. Databases are provisioned from a managed provider (for example Turso or Neon) and inject their connection env vars into deploys automatically.
375
375
 
376
- A database is either **environment-scoped** (its env vars only go to one environment) or **shared** (project-scoped: its env vars go to all environments). Environment-scoped is the default for `mastra env db create` pass an environment argument, or let the CLI pick or prompt for one. Pass `--shared` on create to attach a shared database instead. For other subcommands (`list`, `delete`, `keys`), pass the environment argument to work with environment-scoped databases and omit it for shared databases.
376
+ A database is either **environment-scoped** (its env vars only go to one environment) or **shared** (project-scoped: its env vars go to all environments). Environment-scoped is the default for `mastra env db create`: pass an environment argument, or let the CLI pick or prompt for one. Pass `--shared` on create to attach a shared database instead. For other subcommands (`list`, `delete`, `keys`), pass the environment argument to work with environment-scoped databases and omit it for shared databases.
377
377
 
378
378
  Creating and deleting databases requires the `admin` role in the organization.
379
379
 
@@ -392,7 +392,7 @@ Emit machine-readable JSON.
392
392
 
393
393
  ### `mastra env db create`
394
394
 
395
- Provisions a managed database, attaches it, and polls until it's ready. Provisioning errors are printed with the provider's error detail.
395
+ Provisions and attaches a managed database, then polls until it's ready. Provisioning errors are printed with the provider's error detail.
396
396
 
397
397
  By default the database is scoped to a single environment: pass an environment argument to pick it, or omit the argument to have the CLI pick for you. When the project has one environment, that environment is used. When it has several, the CLI prompts you to select one interactively; in non-interactive contexts (CI, `--json`) an environment argument is required. Pass `--shared` to attach a project-scoped database that's shared by every environment instead.
398
398
 
@@ -419,7 +419,7 @@ Provider region ID for shared databases. Ignored for environment-scoped database
419
419
 
420
420
  #### `--shared`
421
421
 
422
- Attach as a project-scoped database that's shared by every environment. Cannot be combined with an environment argument.
422
+ Attach as a project-scoped database that's shared by every environment. Can't be combined with an environment argument.
423
423
 
424
424
  #### `--no-wait`
425
425
 
@@ -475,7 +475,7 @@ Emit machine-readable JSON.
475
475
 
476
476
  ## `mastra studio deploy`
477
477
 
478
- > **Info:** `mastra studio deploy` continues to work but is superseded by [`mastra deploy`](#mastra-deploy), which supports named environments (`--env staging`, `--env production`) on a single project. New setups should use `mastra deploy`.
478
+ > **Info:** `mastra studio deploy` continues to work but is superseded by [`mastra deploy`](#mastra-deploy), which supports environments (`--env staging`, `--env production`) on a single project. New setups should use `mastra deploy`.
479
479
 
480
480
  Builds and deploys your project to Mastra platform. Requires authentication via [`mastra auth login`](#mastra-auth-login) or a `MASTRA_API_TOKEN` environment variable.
481
481
 
@@ -483,11 +483,11 @@ Builds and deploys your project to Mastra platform. Requires authentication via
483
483
  mastra studio deploy
484
484
  ```
485
485
 
486
- The command runs `mastra build`, zips the output, reads an env file from the project directory, and uploads everything to the platform. After uploading, it polls the deploy status and streams build logs until the deploy reaches a terminal state.
486
+ The command runs `mastra build` and zips the output. It reads an env file from the project directory before uploading everything to the platform. After uploading, it polls the deploy status and streams build logs until the deploy reaches a terminal state.
487
487
 
488
488
  The deploy command auto-loads the project's `.env` file. If `MASTRA_PROJECT_ID` points to a project that was provisioned for Observability, the deploy links to that project instead of creating a new one. Deploying Studio to an observability-only project converts it into a Studio project on the platform side.
489
489
 
490
- The CLI requires at least one `.env` or `.env.*` file (excluding `.env.example`) in the project directory and fails with `Error: No env file found for deploy.` if none exists. When multiple env files are present, the CLI prompts you to pick one (defaulting to `.env.production`); pass `--env-file` to choose explicitly. With `--yes` and multiple env files, you must pass `--env-file` or the deploy errors.
490
+ The CLI requires at least one `.env` or `.env.*` file (excluding `.env.example`) in the project directory and fails with `Error: No env file found for deploy.` if none exists. When multiple env files are present, the CLI prompts you to pick one (defaulting to `.env.production`). Pass `--env-file` to choose explicitly. With `--yes` and multiple env files, you must pass `--env-file` or the deploy errors.
491
491
 
492
492
  Organization and project are resolved in order from: Environment variable flag, `.mastra-project.json` config file, current org from credentials, and lastly interactive prompt. On first deploy, the CLI saves the resolved IDs to `.mastra-project.json` so subsequent deploys skip the prompts.
493
493
 
@@ -581,7 +581,7 @@ Shows diagnosis results and suggested fixes for a failed Studio deploy.
581
581
  mastra studio deploy suggestions [deploy-id]
582
582
  ```
583
583
 
584
- If you omit `deploy-id`, the command uses the latest deploy for the linked project. If a diagnosis doesn't exist yet, the command starts one and polls until results are ready. If the deploy is healthy, no suggestions are shown.
584
+ If you omit `deploy-id`, the command uses the latest deploy for the linked project. If a diagnosis doesn't exist yet, the command starts one and polls until results are ready. Suggestions appear only when the diagnosis finds a problem.
585
585
 
586
586
  ### `mastra studio projects`
587
587
 
@@ -593,7 +593,7 @@ Creates a new project through an interactive prompt. This command doesn't accept
593
593
 
594
594
  ## `mastra server deploy`
595
595
 
596
- > **Info:** `mastra server deploy` continues to work but is superseded by [`mastra deploy`](#mastra-deploy), which deploys a single project to multiple named environments instead of separate Studio and Server commands. New setups should use `mastra deploy`.
596
+ > **Info:** `mastra server deploy` continues to work but is superseded by [`mastra deploy`](#mastra-deploy), which deploys a single project to multiple environments instead of separate Studio and Server commands. New setups should use `mastra deploy`.
597
597
 
598
598
  Builds and deploys your project to Server on Mastra platform. Works the same as [`mastra studio deploy`](#mastra-studio-deploy) with the same flags, arguments, and resolution logic.
599
599
 
@@ -611,7 +611,7 @@ Shows diagnosis results and suggested fixes for a failed Server deploy.
611
611
  mastra server deploy suggestions [deploy-id]
612
612
  ```
613
613
 
614
- If you omit `deploy-id`, the command uses the latest deploy for the linked project. If a diagnosis doesn't exist yet, the command starts one and polls until results are ready. If the deploy is healthy, no suggestions are shown.
614
+ If you omit `deploy-id`, the command uses the latest deploy for the linked project. If a diagnosis doesn't exist yet, the command starts one and polls until results are ready. Suggestions appear only when the diagnosis finds a problem.
615
615
 
616
616
  ## `mastra server pause`
617
617
 
@@ -649,7 +649,7 @@ Same flags as [`mastra server pause`](#mastra-server-pause): **`--org`**, **`--p
649
649
  mastra server restart
650
650
  ```
651
651
 
652
- Fails if a deployment is still active for this project (running, building, deploying, etc.); that's a platform restriction so you can't restart while another deploy is in progress.
652
+ Fails if a deployment is still active for this project (running, building, deploying, etc.). That's a platform restriction so you can't restart while another deploy is in progress.
653
653
 
654
654
  ## `mastra server env`
655
655
 
@@ -892,7 +892,7 @@ Configure your code editor with Mastra's MCP server. Choose from: `"cursor" | "c
892
892
 
893
893
  #### `--observability`
894
894
 
895
- Enable Observability on the Mastra platform. The CLI prompts you to select an existing platform project or create a new one, writes the required environment variables, and configures the observability exporters.
895
+ Enable Observability on the Mastra platform. The CLI prompts you to select an existing platform project or create a new one. It then writes the required environment variables and configures the observability exporters.
896
896
 
897
897
  #### `--no-observability`
898
898
 
@@ -906,7 +906,7 @@ Set the platform project name to use when Mastra Observability is enabled.
906
906
 
907
907
  Runs database migrations to update your storage schema. This command is useful when upgrading Mastra versions that include storage schema changes.
908
908
 
909
- The command bundles your project, connects to your configured storage backend, and executes any pending migrations. Currently supports:
909
+ The command bundles your project and connects to your configured storage backend. It then executes any pending migrations. Currently supports:
910
910
 
911
911
  - **Duplicate spans migration**: Removes duplicate `(traceId, spanId)` entries and adds a unique constraint to ensure data integrity.
912
912
  - **ClickHouse legacy-to-vNext span migration**: Copies historical spans from the legacy `mastra_ai_spans` table to the vNext `mastra_span_events` schema. Runs in batches to stay within memory limits. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for details.
@@ -1417,7 +1417,7 @@ curl -sS "https://observability.mastra.ai/api/observability/traces/<trace-id>/sp
1417
1417
 
1418
1418
  #### `mastra api score create`
1419
1419
 
1420
- Creates an observability score. The input uses the server score body shape; inspect it with `--schema`.
1420
+ Creates an observability score. The input uses the server score body shape. Inspect it with `--schema`.
1421
1421
 
1422
1422
  ```bash
1423
1423
  mastra api score create <input>
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Agents API
4
4
 
5
- The Agents API provides methods to interact with Mastra AI agents, including generating responses, streaming interactions, and managing agent tools.
5
+ The Agents API provides methods to interact with Mastra AI agents, including generating responses and streaming interactions. It also provides methods for managing agent tools.
6
6
 
7
7
  ## Getting all agents
8
8
 
@@ -155,7 +155,7 @@ for await (const part of uiMessageStream) {
155
155
 
156
156
  ### `sendMessage()`
157
157
 
158
- Send user-authored input to an active agent run or idle memory thread. Use this with `subscribeToThread()` so the client can render the stream that wakes from, or receives, the message.
158
+ Send user-authored input to an active agent run or idle memory thread. Use this with `subscribeToThread()` so the client can render the stream that wakes from, or receives the message.
159
159
 
160
160
  ```typescript
161
161
  const agent = mastraClient.getAgent('support-agent')
@@ -285,7 +285,7 @@ await subscription.processDataStream({
285
285
 
286
286
  ### `streamUntilIdle()`
287
287
 
288
- Stream a response and keep the stream open until every [background task](https://mastra.ai/docs/long-running-agents/background-tasks) dispatched during the run completes. The server re-enters the agentic loop on each task completion so the LLM can react to results in the same call. Requires background tasks to be [enabled on the Mastra instance](https://mastra.ai/reference/configuration) and a memory thread; otherwise the call falls through to a plain `stream()`.
288
+ Stream a response and keep the stream open until every [background task](https://mastra.ai/docs/long-running-agents/background-tasks) dispatched during the run completes. The server re-enters the agentic loop on each task completion so the LLM can react to results in the same call. Requires background tasks to be [enabled on the Mastra instance](https://mastra.ai/reference/configuration) and a memory thread; otherwise the call uses a plain `stream()`.
289
289
 
290
290
  ```typescript
291
291
  const response = await agent.streamUntilIdle('Research solana for me', {
@@ -307,7 +307,7 @@ response.processDataStream({
307
307
 
308
308
  ### `resumeStreamUntilIdle()`
309
309
 
310
- Resume a suspended agent stream with custom data and keep the stream open until every [background task](https://mastra.ai/docs/long-running-agents/background-tasks) dispatched during the run completes. Use this to continue execution after a suspension point, such as a workflow suspend within an agent. Requires background tasks to be [enabled on the Mastra instance](https://mastra.ai/reference/configuration) and a memory thread; otherwise the call falls through to a plain `resumeStream()`:
310
+ Resume a suspended agent stream with custom data and keep the stream open until every [background task](https://mastra.ai/docs/long-running-agents/background-tasks) dispatched during the run completes. Use this to continue execution after a suspension point, such as a workflow suspend within an agent. Requires background tasks to be [enabled on the Mastra instance](https://mastra.ai/reference/configuration) and a memory thread; otherwise the call uses a plain `resumeStream()`:
311
311
 
312
312
  ```typescript
313
313
  const response = await agent.resumeStreamUntilIdle(
@@ -366,7 +366,7 @@ response.processDataStream({
366
366
 
367
367
  ### `listSuspendedRuns()`
368
368
 
369
- List suspended runs for the agent from storage runs waiting on a tool-call approval or on a tool that suspended. Discovery is backed by storage, so it works after a server restart and across server instances. Pass the returned `runId` to `approveToolCall()`, `declineToolCall()`, or `resumeStream()`.
369
+ List suspended runs for the agent from storage: runs waiting on a tool-call approval or on a tool that suspended. Discovery is backed by storage, so it works after a server restart and across server instances. Pass the returned `runId` to `approveToolCall()`, `declineToolCall()`, or `resumeStream()`.
370
370
 
371
371
  ```typescript
372
372
  const { runs, total } = await agent.listSuspendedRuns({
@@ -655,9 +655,9 @@ const screenshotTool = createTool({
655
655
 
656
656
  ### Tracing client tools
657
657
 
658
- When `@mastra/observability` is installed and configured on the server, a client-side tool records a `CLIENT_TOOL_CALL` span as a child of the current `AGENT_RUN` span. The server creates that span when the model emits the client tool call, injects a W3C trace carrier into the outgoing tool-call chunk, and ends the span once the tool arguments are available. Without server-side observability configured, client tool tracing is a no-op.
658
+ When `@mastra/observability` is installed and configured on the server, a client-side tool records a `CLIENT_TOOL_CALL` span as a child of the current `AGENT_RUN` span. The server creates that span when the model emits the client tool call and injects a W3C trace carrier into the outgoing tool-call chunk. It ends the span once the tool arguments are available. Without server-side observability configured, client tool tracing is a no-op.
659
659
 
660
- The client SDK also measures the wall-clock duration of each client tool's `execute` function and ships it back to the server, where it's emitted as a `mastra_tool_duration_ms` metric with `toolType: "client"`.
660
+ The client SDK also measures the wall-clock duration of each client tool's `execute` function and sends it back to the server, where it's emitted as a `mastra_tool_duration_ms` metric with `toolType: "client"`.
661
661
 
662
662
  For richer telemetry from inside your tool's `execute` function, use the `observe` helper on the execution context to add child spans and structured logs:
663
663
 
@@ -680,9 +680,9 @@ const fetchUserTool = createTool({
680
680
  })
681
681
  ```
682
682
 
683
- `observe` is always available when no tracing context is active (e.g. running outside a traced agent), `span` runs the function directly and `log` is a no-op. No null-checking needed.
683
+ `observe` is always available: when no tracing context is active (e.g. running outside a traced agent), `span` runs the function directly and `log` is a no-op. No null-checking needed.
684
684
 
685
- The SDK serializes everything the collector buffered as OTLP/JSON and ships it back in the next request body. The server's `@mastra/observability` package validates that the spans belong to the correct trace (preventing cross-trace injection) and forwards each span/log into the same observability bus that server-side telemetry uses. Your existing exporters pick them up automatically after observability is configured.
685
+ The SDK serializes everything the collector buffered as OTLP/JSON and sends it back in the next request body. The server's `@mastra/observability` package validates that the spans belong to the correct trace (preventing cross-trace injection) and forwards each span/log into the same observability bus that server-side telemetry uses. Your existing exporters pick them up automatically after observability is configured.
686
686
 
687
687
  ## Stored agents
688
688