@mastra/mcp-docs-server 1.2.17-alpha.9 → 1.2.18-alpha.1

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 (258) hide show
  1. package/.docs/course/02-agent-tools-mcp/32-conclusion.md +1 -1
  2. package/.docs/docs/agents/code-mode.md +3 -3
  3. package/.docs/docs/agents/guardrails.md +1 -1
  4. package/.docs/docs/agents/{agent-approval.md → human-in-the-loop.md} +5 -5
  5. package/.docs/docs/agents/networks.md +3 -3
  6. package/.docs/docs/agents/overview.md +7 -7
  7. package/.docs/docs/agents/processors.md +3 -3
  8. package/.docs/docs/agents/{using-tools.md → tools.md} +7 -7
  9. package/.docs/docs/{server/auth → auth}/custom-auth-provider.md +1 -1
  10. package/.docs/docs/{server/auth → auth}/fga.md +27 -1
  11. package/.docs/docs/{server/auth.md → auth/overview.md} +4 -4
  12. package/.docs/docs/{server/auth → auth}/simple-auth.md +1 -1
  13. package/.docs/docs/{server/auth → auth}/workers.md +2 -2
  14. package/.docs/docs/{capabilities/channels.md → channels.md} +2 -2
  15. package/.docs/docs/{agents → connections}/a2a.md +2 -2
  16. package/.docs/docs/{agents → connections}/acp.md +18 -6
  17. package/.docs/docs/{mcp/overview.md → connections/mcp.md} +1 -1
  18. package/.docs/docs/connections/overview.md +5 -5
  19. package/.docs/docs/{agents → connections}/sdk-agents.md +3 -1
  20. package/.docs/docs/deployment/cloud-providers.md +1 -0
  21. package/.docs/docs/deployment/mastra-server.md +2 -2
  22. package/.docs/docs/deployment/overview.md +2 -1
  23. package/.docs/docs/deployment/sandbox.md +3 -3
  24. package/.docs/docs/deployment/workers.md +4 -4
  25. package/.docs/docs/guides/context-engineering.md +297 -0
  26. package/.docs/docs/guides/multi-agent-systems.md +7 -7
  27. package/.docs/docs/guides/streaming.md +1 -1
  28. package/.docs/docs/harness/agent-controller.md +5 -3
  29. package/.docs/docs/{long-running-agents → harness}/background-tasks.md +5 -5
  30. package/.docs/docs/{long-running-agents → harness}/durable-agents.md +18 -2
  31. package/.docs/docs/{long-running-agents → harness}/goals.md +6 -6
  32. package/.docs/docs/harness/overview.md +11 -10
  33. package/.docs/docs/{long-running-agents → harness}/schedules.md +5 -5
  34. package/.docs/docs/{long-running-agents → harness}/signal-providers.md +4 -4
  35. package/.docs/docs/mastra-platform/deploy.md +1 -1
  36. package/.docs/docs/mastra-platform/overview.md +1 -1
  37. package/.docs/docs/mastra-platform/server.md +1 -1
  38. package/.docs/docs/memory/message-history.md +1 -1
  39. package/.docs/docs/memory/overview.md +4 -4
  40. package/.docs/docs/memory/working-memory.md +1 -1
  41. package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
  42. package/.docs/docs/{workspace → sandbox}/filesystem.md +2 -2
  43. package/.docs/docs/{workspace → sandbox}/lsp.md +3 -3
  44. package/.docs/docs/{workspace/sandbox.md → sandbox/overview.md} +4 -3
  45. package/.docs/docs/{workspace → sandbox}/search.md +2 -2
  46. package/.docs/docs/{workspace → sandbox}/skills.md +5 -5
  47. package/.docs/docs/server/custom-api-routes.md +2 -2
  48. package/.docs/docs/server/mastra-client.md +2 -2
  49. package/.docs/docs/server/{mastra-server.md → overview.md} +3 -3
  50. package/.docs/docs/server/pubsub.md +2 -2
  51. package/.docs/docs/server/server-adapters.md +4 -4
  52. package/.docs/docs/{agents/skills.md → skills.md} +4 -4
  53. package/.docs/docs/{storage/overview.md → storage.md} +2 -1
  54. package/.docs/docs/studio/auth.md +4 -4
  55. package/.docs/docs/studio/overview.md +2 -2
  56. package/.docs/docs/{capabilities/subagents.md → subagents.md} +35 -5
  57. package/.docs/docs/workflows/agents-and-tools.md +1 -1
  58. package/.docs/docs/workflows/control-flow.md +0 -4
  59. package/.docs/docs/workflows/human-in-the-loop.md +0 -4
  60. package/.docs/docs/workflows/overview.md +1 -1
  61. package/.docs/docs/workflows/scheduled-workflows.md +2 -2
  62. package/.docs/docs/workflows/snapshots.md +1 -1
  63. package/.docs/docs/workflows/suspend-and-resume.md +0 -4
  64. package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
  65. package/.docs/integrations/agentic-ui/copilotkit.md +1 -1
  66. package/.docs/integrations/auth/google.md +2 -2
  67. package/.docs/integrations/auth/workos.md +1 -1
  68. package/.docs/integrations/browsers/agent-browser.md +2 -2
  69. package/.docs/integrations/browsers/browser-viewer.md +6 -6
  70. package/.docs/integrations/browsers/firecrawl.md +1 -1
  71. package/.docs/integrations/browsers/stagehand.md +2 -2
  72. package/.docs/integrations/channels/discord.md +2 -2
  73. package/.docs/integrations/channels/github.md +1 -1
  74. package/.docs/integrations/channels/imessage.md +4 -4
  75. package/.docs/integrations/channels/slack.md +5 -5
  76. package/.docs/integrations/channels/teams.md +2 -2
  77. package/.docs/integrations/channels/telegram.md +2 -2
  78. package/.docs/integrations/channels/whatsapp.md +2 -2
  79. package/.docs/integrations/databases/postgresql.md +1 -0
  80. package/.docs/integrations/deploy/amazon-ec2.md +2 -2
  81. package/.docs/integrations/deploy/aws-lambda.md +3 -3
  82. package/.docs/integrations/deploy/azure-app-services.md +2 -2
  83. package/.docs/integrations/deploy/cloudflare.md +2 -2
  84. package/.docs/integrations/deploy/digital-ocean.md +3 -3
  85. package/.docs/integrations/deploy/kubernetes.md +11 -11
  86. package/.docs/integrations/deploy/netlify.md +3 -3
  87. package/.docs/integrations/deploy/render.md +389 -0
  88. package/.docs/integrations/deploy/vercel.md +2 -2
  89. package/.docs/integrations/file-storage/amazon-s3.md +1 -1
  90. package/.docs/integrations/file-storage/azure-blob.md +1 -1
  91. package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
  92. package/.docs/integrations/file-storage/mesa.md +2 -2
  93. package/.docs/integrations/file-storage/vercel-files.md +1 -1
  94. package/.docs/integrations/frameworks/astro.md +6 -2
  95. package/.docs/integrations/frameworks/electron.md +1 -1
  96. package/.docs/integrations/frameworks/express.md +1 -1
  97. package/.docs/integrations/frameworks/hono.md +1 -1
  98. package/.docs/integrations/frameworks/nestjs.md +1 -1
  99. package/.docs/integrations/frameworks/next-js.md +6 -2
  100. package/.docs/integrations/frameworks/nuxt.md +1 -1
  101. package/.docs/integrations/frameworks/sveltekit.md +1 -1
  102. package/.docs/integrations/frameworks/vite-react.md +6 -2
  103. package/.docs/integrations/sandboxes/agentcore.md +1 -1
  104. package/.docs/integrations/sandboxes/apple-container.md +1 -1
  105. package/.docs/integrations/sandboxes/cloudflare-sandbox.md +118 -0
  106. package/.docs/integrations/sandboxes/daytona.md +1 -1
  107. package/.docs/integrations/sandboxes/docker.md +4 -3
  108. package/.docs/integrations/sandboxes/e2b.md +1 -1
  109. package/.docs/integrations/sandboxes/modal.md +1 -1
  110. package/.docs/integrations/sandboxes/railway.md +11 -0
  111. package/.docs/integrations.md +4 -0
  112. package/.docs/models/environment-variables.md +9 -2
  113. package/.docs/models/gateways/merge-gateway.md +212 -0
  114. package/.docs/models/gateways/openrouter.md +3 -1
  115. package/.docs/models/gateways/vercel.md +22 -1
  116. package/.docs/models/gateways.md +1 -0
  117. package/.docs/models/index.md +1 -1
  118. package/.docs/models/providers/alibaba-token-plan-cn.md +2 -1
  119. package/.docs/models/providers/alibaba-token-plan.md +2 -1
  120. package/.docs/models/providers/ambient.md +2 -2
  121. package/.docs/models/providers/amd.md +73 -0
  122. package/.docs/models/providers/arcee.md +79 -0
  123. package/.docs/models/providers/baseten.md +1 -1
  124. package/.docs/models/providers/cerebras.md +2 -3
  125. package/.docs/models/providers/chutes.md +2 -1
  126. package/.docs/models/providers/cloudflare-workers-ai.md +3 -2
  127. package/.docs/models/providers/cortecs.md +2 -1
  128. package/.docs/models/providers/crof.md +1 -1
  129. package/.docs/models/providers/crossmodel.md +3 -2
  130. package/.docs/models/providers/deepinfra.md +5 -1
  131. package/.docs/models/providers/digitalocean.md +3 -2
  132. package/.docs/models/providers/echo.md +73 -0
  133. package/.docs/models/providers/edenai.md +26 -11
  134. package/.docs/models/providers/empiriolabs.md +11 -1
  135. package/.docs/models/providers/hetzner.md +6 -8
  136. package/.docs/models/providers/huggingface.md +4 -1
  137. package/.docs/models/providers/hyper.md +8 -7
  138. package/.docs/models/providers/inferx.md +19 -13
  139. package/.docs/models/providers/jalapeno.md +89 -0
  140. package/.docs/models/providers/kilo.md +12 -11
  141. package/.docs/models/providers/kosmik.md +73 -0
  142. package/.docs/models/providers/llmgateway.md +3 -3
  143. package/.docs/models/providers/llmtr.md +35 -10
  144. package/.docs/models/providers/nano-gpt.md +13 -17
  145. package/.docs/models/providers/ofox.md +8 -4
  146. package/.docs/models/providers/opencode-go.md +23 -22
  147. package/.docs/models/providers/requesty.md +143 -53
  148. package/.docs/models/providers/runinfra.md +76 -0
  149. package/.docs/models/providers/sakana.md +3 -2
  150. package/.docs/models/providers/scnet-token-plan.md +85 -0
  151. package/.docs/models/providers/scx-ai.md +76 -0
  152. package/.docs/models/providers/togetherai.md +2 -1
  153. package/.docs/models/providers/umans-ai-coding-plan.md +2 -1
  154. package/.docs/models/providers/umans-ai.md +2 -1
  155. package/.docs/models/providers/vivgrid.md +2 -1
  156. package/.docs/models/providers/wandb.md +2 -1
  157. package/.docs/models/providers/xai.md +2 -1
  158. package/.docs/models/providers.md +8 -2
  159. package/.docs/reference/acp/acp-agent.md +2 -2
  160. package/.docs/reference/acp/create-acp-tool.md +1 -1
  161. package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
  162. package/.docs/reference/agents/agent.md +2 -2
  163. package/.docs/reference/agents/channels.md +2 -2
  164. package/.docs/reference/agents/createSkill.md +2 -2
  165. package/.docs/reference/agents/durable-agent.md +1 -1
  166. package/.docs/reference/agents/generate.md +3 -1
  167. package/.docs/reference/agents/getSkill.md +1 -1
  168. package/.docs/reference/agents/listSkills.md +1 -1
  169. package/.docs/reference/agents/listSuspendedRuns.md +6 -6
  170. package/.docs/reference/agents/listTools.md +2 -2
  171. package/.docs/reference/agents/network.md +3 -1
  172. package/.docs/reference/ai-sdk/chat-route.md +1 -1
  173. package/.docs/reference/ai-sdk/handle-chat-stream.md +1 -1
  174. package/.docs/reference/ai-sdk/handle-network-stream.md +2 -2
  175. package/.docs/reference/ai-sdk/handle-workflow-stream.md +1 -1
  176. package/.docs/reference/ai-sdk/network-route.md +2 -2
  177. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
  178. package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
  179. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  180. package/.docs/reference/auth/fga.md +7 -5
  181. package/.docs/reference/auth/jwt.md +1 -1
  182. package/.docs/reference/browser/agent-browser.md +2 -2
  183. package/.docs/reference/browser/browser-viewer.md +2 -2
  184. package/.docs/reference/browser/firecrawl-browser.md +1 -1
  185. package/.docs/reference/browser/mastra-browser.md +1 -1
  186. package/.docs/reference/browser/stagehand-browser.md +2 -2
  187. package/.docs/reference/build-with-ai.md +2 -2
  188. package/.docs/reference/channels/channel-provider.md +1 -1
  189. package/.docs/reference/channels/slack-provider.md +1 -1
  190. package/.docs/reference/cli/mastra.md +2 -0
  191. package/.docs/reference/client-js/agents.md +24 -4
  192. package/.docs/reference/coding-agent/create-coding-agent.md +142 -13
  193. package/.docs/reference/configuration.md +6 -6
  194. package/.docs/reference/core/getEditor.md +1 -1
  195. package/.docs/reference/core/getMCPServer.md +1 -1
  196. package/.docs/reference/core/getMCPServerById.md +1 -1
  197. package/.docs/reference/core/getTool.md +1 -1
  198. package/.docs/reference/core/getToolById.md +1 -1
  199. package/.docs/reference/core/listMCPServers.md +1 -1
  200. package/.docs/reference/core/listTools.md +1 -1
  201. package/.docs/reference/core/removeWorkspace.md +1 -1
  202. package/.docs/reference/editor/mastra-editor.md +2 -2
  203. package/.docs/reference/editor/prompt-blocks.md +2 -2
  204. package/.docs/reference/editor/tool-provider.md +108 -1
  205. package/.docs/reference/editor/tools.md +1 -1
  206. package/.docs/reference/editor/versioning.md +3 -3
  207. package/.docs/reference/evals/prompt-alignment.md +18 -0
  208. package/.docs/reference/evals/rubric.md +1 -1
  209. package/.docs/reference/file-based-agents/memory.md +2 -2
  210. package/.docs/reference/file-based-agents/server.md +3 -3
  211. package/.docs/reference/file-based-agents/skills.md +1 -1
  212. package/.docs/reference/file-based-agents/storage.md +3 -3
  213. package/.docs/reference/file-based-agents/subagents.md +1 -1
  214. package/.docs/reference/file-based-agents/workspace.md +3 -3
  215. package/.docs/reference/index.md +1 -0
  216. package/.docs/reference/manual-install.md +3 -3
  217. package/.docs/reference/memory/memory-class.md +1 -0
  218. package/.docs/reference/memory/settled.md +57 -0
  219. package/.docs/reference/migrations/network-to-supervisor.md +2 -2
  220. package/.docs/reference/processors/provider-history-compat.md +6 -5
  221. package/.docs/reference/processors/skill-search-processor.md +3 -1
  222. package/.docs/reference/processors/token-limiter-processor.md +4 -0
  223. package/.docs/reference/processors/tool-call-filter.md +7 -7
  224. package/.docs/reference/processors/tool-search-processor.md +1 -1
  225. package/.docs/reference/project-structure.md +1 -1
  226. package/.docs/reference/pubsub/lease-provider.md +3 -3
  227. package/.docs/reference/pubsub/redis-streams.md +1 -1
  228. package/.docs/reference/rag/graph-rag.md +71 -8
  229. package/.docs/reference/rag/retrieval.md +26 -18
  230. package/.docs/reference/schedules/overview.md +1 -1
  231. package/.docs/reference/streaming/ChunkType.md +2 -2
  232. package/.docs/reference/streaming/agents/stream.md +29 -4
  233. package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
  234. package/.docs/reference/tools/ask-user-tool.md +1 -1
  235. package/.docs/reference/tools/create-code-mode.md +1 -1
  236. package/.docs/reference/tools/create-tool.md +4 -4
  237. package/.docs/reference/tools/mcp-client.md +2 -0
  238. package/.docs/reference/tools/mcp-server.md +97 -4
  239. package/.docs/reference/tools/submit-plan-tool.md +1 -1
  240. package/.docs/reference/tools/task-tools.md +2 -2
  241. package/.docs/reference/vectors/vectorize.md +12 -2
  242. package/.docs/reference/workers/overview.md +2 -2
  243. package/.docs/reference/workflows/run-methods/resume.md +21 -0
  244. package/.docs/reference/workspace/local-filesystem.md +1 -1
  245. package/.docs/reference/workspace/local-sandbox.md +4 -3
  246. package/.docs/reference/workspace/platform-sandbox.md +11 -0
  247. package/.docs/reference/workspace/process-manager.md +20 -4
  248. package/.docs/reference/workspace/sandbox.md +1 -1
  249. package/.docs/reference/workspace/workspace-class.md +5 -5
  250. package/CHANGELOG.md +81 -0
  251. package/package.json +6 -6
  252. package/.docs/models/providers/merge-gateway.md +0 -265
  253. /package/.docs/docs/{server/auth → auth}/composite-auth.md +0 -0
  254. /package/.docs/docs/{server/auth → auth}/jwt.md +0 -0
  255. /package/.docs/docs/{browser/overview.md → browser.md} +0 -0
  256. /package/.docs/docs/{getting-started/develop.md → develop.md} +0 -0
  257. /package/.docs/docs/{long-running-agents → harness}/signals.md +0 -0
  258. /package/.docs/docs/{editor/overview.md → studio/editor.md} +0 -0
@@ -9,10 +9,7 @@ The `GraphRAG` class implements a graph-based approach to retrieval augmented ge
9
9
  ```typescript
10
10
  import { GraphRAG } from '@mastra/rag'
11
11
 
12
- const graphRag = new GraphRAG({
13
- dimension: 1536,
14
- threshold: 0.7,
15
- })
12
+ const graphRag = new GraphRAG(1536, 0.7)
16
13
 
17
14
  // Create the graph from chunks and embeddings
18
15
  graphRag.createGraph(documentChunks, embeddings)
@@ -88,13 +85,79 @@ Returns an array of `RankedNode` objects, where each node contains:
88
85
 
89
86
  **score** (`number`): Combined relevance score from graph traversal
90
87
 
88
+ ### `serialize`
89
+
90
+ Returns a JSON-safe snapshot of the graph so it can be persisted and restored later instead of rebuilt with `createGraph`.
91
+
92
+ ```typescript
93
+ serialize(): GraphRAGSnapshot
94
+ ```
95
+
96
+ #### Returns
97
+
98
+ Returns a `GraphRAGSnapshot` object containing:
99
+
100
+ **version** (`number`): Snapshot format version, used to reject snapshots this version of the class can't load
101
+
102
+ **dimension** (`number`): Dimension of the embedding vectors the graph was built with
103
+
104
+ **threshold** (`number`): Similarity threshold the graph was built with
105
+
106
+ **nodes** (`GraphNode[]`): All nodes in the graph, each including its full embedding
107
+
108
+ **edges** (`GraphEdge[]`): All edges in the graph
109
+
110
+ The snapshot is a deep copy, so mutating it doesn't affect the graph it came from. Every node carries its full embedding, so snapshots are large: a 1,000-node graph built with 1536-dimension embeddings serializes to about 20 MB of JSON. Size your storage column accordingly.
111
+
112
+ ### `deserialize`
113
+
114
+ Rebuilds a `GraphRAG` instance from a snapshot produced by `serialize`.
115
+
116
+ ```typescript
117
+ static deserialize(snapshot: GraphRAGSnapshot): GraphRAG
118
+ ```
119
+
120
+ #### Parameters
121
+
122
+ **snapshot** (`GraphRAGSnapshot`): A snapshot previously returned by serialize
123
+
124
+ Throws if the snapshot version is unsupported, if a node embedding doesn't match the snapshot dimension, or if an edge references a node that isn't in the snapshot. A bad snapshot therefore fails at load time instead of during a later query.
125
+
126
+ ## Persisting a graph
127
+
128
+ Building a graph is O(n²) in the number of chunks, so rebuilding it on every process start is wasteful. Serialize the graph once and store the snapshot wherever you already keep state. A snapshot is plain JSON, so any store works (a file, a blob column, a key-value cache), and `GraphRAG` doesn't depend on a storage backend.
129
+
130
+ ```typescript
131
+ import { readFile, writeFile } from 'node:fs/promises'
132
+ import { GraphRAG } from '@mastra/rag'
133
+ import type { GraphRAGSnapshot } from '@mastra/rag'
134
+
135
+ const SNAPSHOT_PATH = './docs-graph.json'
136
+
137
+ async function loadOrBuildGraph() {
138
+ try {
139
+ const snapshot = JSON.parse(await readFile(SNAPSHOT_PATH, 'utf8')) as GraphRAGSnapshot
140
+ return GraphRAG.deserialize(snapshot)
141
+ } catch {
142
+ // No usable snapshot yet, so build the graph from scratch
143
+ }
144
+
145
+ const graphRag = new GraphRAG(1536, 0.7)
146
+ graphRag.createGraph(documentChunks, embeddings)
147
+
148
+ await writeFile(SNAPSHOT_PATH, JSON.stringify(graphRag.serialize()))
149
+
150
+ return graphRag
151
+ }
152
+ ```
153
+
154
+ A snapshot reflects the chunks it was built from and isn't updated incrementally. When the underlying documents change, build the graph again and store a new snapshot.
155
+
91
156
  ## Advanced example
92
157
 
93
158
  ```typescript
94
- const graphRag = new GraphRAG({
95
- dimension: 1536,
96
- threshold: 0.8, // Stricter similarity threshold
97
- })
159
+ // Stricter similarity threshold
160
+ const graphRag = new GraphRAG(1536, 0.8)
98
161
 
99
162
  // Create graph from chunks and embeddings
100
163
  graphRag.createGraph(documentChunks, embeddings)
@@ -266,6 +266,23 @@ For detailed configuration options and advanced usage, see the [Vector Query Too
266
266
 
267
267
  Vector store prompts define query patterns and filtering capabilities for each vector database implementation. When implementing filtering, these prompts are required in the agent's instructions to specify valid operators and syntax for each vector store implementation.
268
268
 
269
+ **MongoDB**:
270
+
271
+ ```ts
272
+ import { MONGODB_PROMPT } from '@mastra/mongodb'
273
+
274
+ export const ragAgent = new Agent({
275
+ id: 'rag-agent',
276
+ name: 'RAG Agent',
277
+ model: 'openai/gpt-5.6-sol',
278
+ instructions: `
279
+ Process queries using the provided context. Structure responses to be concise and relevant.
280
+ ${MONGODB_PROMPT}
281
+ `,
282
+ tools: { vectorQueryTool },
283
+ })
284
+ ```
285
+
269
286
  **pgVector**:
270
287
 
271
288
  ```ts
@@ -402,23 +419,6 @@ export const ragAgent = new Agent({
402
419
  })
403
420
  ```
404
421
 
405
- **MongoDB**:
406
-
407
- ```ts
408
- import { MONGODB_PROMPT } from '@mastra/mongodb'
409
-
410
- export const ragAgent = new Agent({
411
- id: 'rag-agent',
412
- name: 'RAG Agent',
413
- model: 'openai/gpt-5.6-sol',
414
- instructions: `
415
- Process queries using the provided context. Structure responses to be concise and relevant.
416
- ${MONGODB_PROMPT}
417
- `,
418
- tools: { vectorQueryTool },
419
- })
420
- ```
421
-
422
422
  **OpenSearch**:
423
423
 
424
424
  ```ts
@@ -520,7 +520,13 @@ The weights control how different factors influence the final ranking:
520
520
 
521
521
  > **Note:** For semantic scoring to work properly during re-ranking, each result must include the text content in its `metadata.text` field.
522
522
 
523
- You can also use other relevance score providers like Cohere or ZeroEntropy:
523
+ You can also use other relevance score providers like Voyage AI, Cohere, or ZeroEntropy:
524
+
525
+ ```ts
526
+ import { VoyageRelevanceScorer } from '@mastra/voyageai'
527
+
528
+ const relevanceProvider = new VoyageRelevanceScorer({ model: 'rerank-2.5' })
529
+ ```
524
530
 
525
531
  ```ts
526
532
  const relevanceProvider = new CohereRelevanceScorer('rerank-v3.5')
@@ -530,6 +536,8 @@ const relevanceProvider = new CohereRelevanceScorer('rerank-v3.5')
530
536
  const relevanceProvider = new ZeroEntropyRelevanceScorer('zerank-1')
531
537
  ```
532
538
 
539
+ Voyage AI provides dedicated reranking models: `rerank-2.5` and `rerank-2.5-lite` both allow up to 32,000 tokens for the query and any single document combined, and up to 600,000 tokens across a request. `VoyageRelevanceScorer` reads `VOYAGE_API_KEY` from the environment, or accepts an `apiKey` in its config.
540
+
533
541
  The re-ranked results combine vector similarity with semantic understanding to improve retrieval quality.
534
542
 
535
543
  For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/rag/rerankWithScorer) method.
@@ -8,7 +8,7 @@
8
8
 
9
9
  `mastra.schedules` is the CRUD service for persisted cron schedules. Use it to create, list, update, pause, resume, manually run, and delete schedules for agents or workflows.
10
10
 
11
- For usage patterns and concepts, see [Schedules](https://mastra.ai/docs/long-running-agents/schedules).
11
+ For usage patterns and concepts, see [Schedules](https://mastra.ai/docs/harness/schedules).
12
12
 
13
13
  ## Usage example
14
14
 
@@ -402,7 +402,7 @@ Contains output from workflow step execution, used primarily for usage tracking
402
402
 
403
403
  ## Background task chunks
404
404
 
405
- Emitted when a tool call is dispatched as a [background task](https://mastra.ai/docs/long-running-agents/background-tasks) and `streamUntilIdle()` is used.
405
+ Emitted when a tool call is dispatched as a [background task](https://mastra.ai/docs/harness/background-tasks) and `streamUntilIdle()` is used.
406
406
 
407
407
  ### background-task-started
408
408
 
@@ -614,7 +614,7 @@ Contains monitoring and observability data from agent execution. Can include wor
614
614
 
615
615
  ### goal
616
616
 
617
- Emitted on every evaluation of an agent [goal](https://mastra.ai/docs/long-running-agents/goals). Consumers use this to render judge progress and the result mid-run. A goal that has no judge model configured produces no `goal` chunk.
617
+ Emitted on every evaluation of an agent [goal](https://mastra.ai/docs/harness/goals). Consumers use this to render judge progress and the result mid-run. A goal that has no judge model configured produces no `goal` chunk.
618
618
 
619
619
  **type** (`"goal"`): Chunk type identifier
620
620
 
@@ -80,7 +80,7 @@ const stream = await agent.stream('message for agent')
80
80
 
81
81
  **options.onError** (`({ error }: { error: Error | string }) => Promise<void> | void`): Callback function called when an error occurs during streaming.
82
82
 
83
- **options.onAbort** (`(event: any) => Promise<void> | void`): Callback function called when the stream is aborted.
83
+ **options.onAbort** (`(event: { steps: any[]; text?: string }) => Promise<void> | void`): Callback function called when the stream is aborted. steps contains the steps that completed before the abort, and text contains the assistant text streamed so far for the step that was in flight.
84
84
 
85
85
  **options.abortSignal** (`AbortSignal`): Signal object that allows you to abort the agent's execution. When the signal is aborted, all ongoing operations will be terminated, including any in-flight subagent runs the agent delegated to.
86
86
 
@@ -158,6 +158,8 @@ const stream = await agent.stream('message for agent')
158
158
 
159
159
  **options.modelSettings.frequencyPenalty** (`number`): Penalty for token frequency (-2 to 2). Reduces repetition of frequent tokens.
160
160
 
161
+ **options.modelSettings.timeout** (`object`): Time-based execution budget for the run. Accepts totalMs, the maximum duration of the entire agent run across every loop iteration, tool call and retry, and stepMs, the maximum duration of a single model call including the time spent consuming its stream. Exceeding either budget fails with a MastraTimeoutError. A totalMs timeout ends the run and does not try fallback models, because it is a hard deadline for the whole run. A stepMs timeout is not retried against the same model but does advance to the next entry in models when fallback models are configured.
162
+
161
163
  **options.modelSettings.stopSequences** (`string[]`): Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated.
162
164
 
163
165
  **options.toolChoice** (`'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }`): Controls how the agent uses tools during streaming.
@@ -178,6 +180,8 @@ const stream = await agent.stream('message for agent')
178
180
 
179
181
  **options.savePerStep** (`boolean`): Save messages incrementally after each stream step completes (default: false).
180
182
 
183
+ **options.persistPartialOnAbort** (`boolean`): Save the assistant text that was streamed before an abort to memory (default: false). Only text emitted before the abort is persisted; output a provider keeps producing after cancellation is discarded, and nothing is saved when no text was streamed.
184
+
181
185
  **options.requireToolApproval** (`boolean`): When true, all tool calls require explicit approval before execution. The stream will emit tool-call-approval chunks and pause until approveToolCall() or declineToolCall() is called.
182
186
 
183
187
  **options.autoResumeSuspendedTools** (`boolean`): When true, automatically resumes suspended tools when the user sends a new message on the same thread. The agent extracts resumeData from the user's message based on the tool's resumeSchema. Requires memory to be configured.
@@ -262,6 +266,26 @@ for await (const chunk of stream.fullStream) {
262
266
  const fullText = await stream.text
263
267
  ```
264
268
 
269
+ ### Limiting execution time
270
+
271
+ Use `modelSettings.timeout` to bound how long a run may take. `totalMs` limits the entire run, including every loop iteration, tool call and retry. `stepMs` limits a single model call, covering both establishing the stream and consuming it.
272
+
273
+ ```ts
274
+ const stream = await agent.stream('Tell me a story', {
275
+ modelSettings: {
276
+ timeout: {
277
+ totalMs: 30000, // fail the run if it takes longer than 30s
278
+ stepMs: 10000, // fail an individual model call after 10s
279
+ },
280
+ },
281
+ })
282
+ ```
283
+
284
+ Exceeding either budget fails with a `MastraTimeoutError`, which carries a `timeoutType` of `'total'` or `'step'`. Each budget behaves differently when the agent is configured with fallback [`models`](https://mastra.ai/reference/agents/agent):
285
+
286
+ - A `totalMs` timeout ends the run immediately and doesn't try the next model, because it's a hard deadline for the run as a whole.
287
+ - A `stepMs` timeout isn't retried against the same model, but does advance to the next model, which makes it a way to fail over from a slow provider.
288
+
265
289
  ### AI SDK v5+ Format
266
290
 
267
291
  To use the stream with AI SDK v5 (and later), you can convert it using our utility function `toAISdkStream`.
@@ -301,8 +325,9 @@ const stream = await agent.stream('Tell me a story', {
301
325
  onError: ({ error }) => {
302
326
  console.error('Streaming error:', error)
303
327
  },
304
- onAbort: event => {
305
- console.log('Stream aborted:', event)
328
+ onAbort: ({ steps, text }) => {
329
+ console.log('Stream aborted after', steps.length, 'steps')
330
+ console.log('Partial text:', text)
306
331
  },
307
332
  })
308
333
 
@@ -399,4 +424,4 @@ Responses WebSocket connections run one response at a time. Mastra rejects overl
399
424
 
400
425
  - [Generating responses](https://mastra.ai/docs/agents/overview)
401
426
  - [Streaming responses](https://mastra.ai/docs/agents/overview)
402
- - [Agent Approval](https://mastra.ai/docs/agents/agent-approval)
427
+ - [Agent Approval](https://mastra.ai/docs/agents/human-in-the-loop)
@@ -101,7 +101,7 @@ for await (const chunk of stream.fullStream) {
101
101
 
102
102
  ## Related
103
103
 
104
- - [Background tasks](https://mastra.ai/docs/long-running-agents/background-tasks)
104
+ - [Background tasks](https://mastra.ai/docs/harness/background-tasks)
105
105
  - [`Agent.stream()` reference](https://mastra.ai/reference/streaming/agents/stream)
106
106
  - [backgroundTasks configuration reference](https://mastra.ai/reference/configuration)
107
107
  - [Stream chunk types](https://mastra.ai/reference/streaming/ChunkType)
@@ -4,7 +4,7 @@
4
4
 
5
5
  A built-in, agent-agnostic tool that asks the user a question and waits for their response. The tool supports free-text questions, single-select prompts, and multi-select prompts.
6
6
 
7
- The tool pauses through the native [tool suspension](https://mastra.ai/docs/agents/agent-approval) primitive: it calls `suspend()` with the question payload, which makes the agent emit a `tool-call-suspended` event and persist run state. Resume the run with `agent.resumeStream(answer, { runId })`.
7
+ The tool pauses through the native [tool suspension](https://mastra.ai/docs/agents/human-in-the-loop) primitive: it calls `suspend()` with the question payload, which makes the agent emit a `tool-call-suspended` event and persist run state. Resume the run with `agent.resumeStream(answer, { runId })`.
8
8
 
9
9
  When executed outside an agent run (no `suspend` available), the tool returns a readable fallback string containing the question and choices.
10
10
 
@@ -126,4 +126,4 @@ export const codeModeTool = createCodeModeTool({
126
126
 
127
127
  - [Code mode](https://mastra.ai/docs/agents/code-mode)
128
128
  - [createTool()](https://mastra.ai/reference/tools/create-tool)
129
- - [Sandbox](https://mastra.ai/docs/workspace/sandbox)
129
+ - [Sandbox](https://mastra.ai/docs/sandbox/overview)
@@ -519,8 +519,8 @@ These annotations follow the [MCP specification](https://spec.modelcontextprotoc
519
519
 
520
520
  ## Related
521
521
 
522
- - [MCP Overview](https://mastra.ai/docs/mcp/overview)
523
- - [Using Tools with Agents](https://mastra.ai/docs/agents/using-tools)
524
- - [Agent Approval](https://mastra.ai/docs/agents/agent-approval)
525
- - [Tool Streaming](https://mastra.ai/docs/agents/using-tools)
522
+ - [MCP Overview](https://mastra.ai/docs/connections/mcp)
523
+ - [Using Tools with Agents](https://mastra.ai/docs/agents/tools)
524
+ - [Agent Approval](https://mastra.ai/docs/agents/human-in-the-loop)
525
+ - [Tool Streaming](https://mastra.ai/docs/agents/tools)
526
526
  - [Request Context](https://mastra.ai/docs/server/request-context)
@@ -65,6 +65,8 @@ Each server in the `servers` map is configured using the `MastraMCPServerDefinit
65
65
 
66
66
  **requireToolApproval** (`boolean | (params: RequireToolApprovalContext) => boolean | Promise<boolean>`): Require human approval before executing tools from this server. When set to true, all tools require approval. When set to a function, the function is called with the tool name, arguments, request context, and any tool annotations advertised by the server to dynamically decide whether approval is needed.
67
67
 
68
+ **protocolVersion** (`'auto' | '2026-07-28'`): Opt-in MCP protocol version negotiation. Omitted keeps the legacy (2025-era) connect sequence unchanged. 'auto' probes the server at connect time and uses the stateless '2026-07-28' revision when the server supports it, with a safe fallback to the legacy handshake. '2026-07-28' pins that revision exactly and fails with a typed error when the server does not offer it. Elicitation handlers work on both eras: on a '2026-07-28' connection, embedded elicitation requests from input\_required results are dispatched through the same registered handler and the originating call retries automatically.
69
+
68
70
  ## Tool approval
69
71
 
70
72
  Use `requireToolApproval` on a server definition to require human approval before any tool from that server is executed. This works with the existing [human-in-the-loop](https://mastra.ai/docs/workflows/human-in-the-loop) approval flow.
@@ -91,6 +91,35 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
91
91
 
92
92
  **appResources** (`AppResources`): A map of ui:// URIs to app resource configurations. Each entry defines an interactive HTML UI served via the MCP Apps extension (SEP-1865). See the MCP Apps section for details.
93
93
 
94
+ **protocolVersion** (`'2025-11-25' | '2026-07-28'`): Opt-in MCP protocol revision. Omitted (or '2025-11-25') keeps the legacy behavior exactly. Set to '2026-07-28' to serve the stateless MCP revision. See the Protocol versions section for details.
95
+
96
+ **cacheHints** (`MCPServerCacheHints`): Cache hints (ttlMs / cacheScope) advertised on cacheable results of the '2026-07-28' protocol revision, keyed by operation (e.g. 'tools/list'). Only applied when protocolVersion: '2026-07-28' is set.
97
+
98
+ ## Protocol versions
99
+
100
+ By default, `MCPServer` speaks the legacy (2025-era) MCP protocol: sessionful streamable HTTP with an `initialize` handshake. Set `protocolVersion: '2026-07-28'` to serve the stateless MCP revision instead:
101
+
102
+ - HTTP and serverless requests go through a dual-era handler: clients that speak `2026-07-28` are served natively (stateless, per-request envelope), and legacy clients are served through a built-in stateless fallback on the same endpoint.
103
+ - `startStdio()` serves both eras: the opening exchange selects the era for the connection.
104
+ - Tool list, prompt list, resource list, and resource update notifications also reach `2026-07-28` clients through `subscriptions/listen`.
105
+ - Tool log messages honor the caller's per-request `logLevel` opt-in instead of the session-level `logging/setLevel`.
106
+ - Configured `cacheHints` are advertised on cacheable results such as `tools/list`.
107
+ - Tool elicitation (`options.mcp.elicitation.sendRequest()`) works on both eras. On `2026-07-28` requests, it uses the protocol's multi round-trip mechanism. The tool call first returns an `input_required` result. After the client answers, the call retries with the answer attached. The `sendRequest()` promise API is unchanged, but the tool function re-executes from the top on each retry, so keep side effects idempotent (or place them after the last elicitation) and keep the order of `sendRequest()` calls deterministic for an input.
108
+
109
+ ```typescript
110
+ const server = new MCPServer({
111
+ name: 'My Server',
112
+ version: '1.0.0',
113
+ tools: { weatherTool },
114
+ protocolVersion: '2026-07-28',
115
+ cacheHints: {
116
+ 'tools/list': { ttlMs: 60_000, cacheScope: 'private' },
117
+ },
118
+ })
119
+ ```
120
+
121
+ Omitting `protocolVersion` keeps the current behavior unchanged.
122
+
94
123
  ## Exposing agents as tools
95
124
 
96
125
  A powerful feature of `MCPServer` is its ability to automatically expose your Mastra Agents as callable tools. When you provide agents in the `agents` property of the configuration:
@@ -168,6 +197,51 @@ const fetchUserData = createTool({
168
197
  })
169
198
  ```
170
199
 
200
+ #### Where `authInfo` comes from
201
+
202
+ When an MCP server is served by a Mastra server, `extra.authInfo` is populated from the principal resolved by `server.auth`. Nothing extra is required:
203
+
204
+ ```typescript
205
+ export const mastra = new Mastra({
206
+ mcpServers: { myServer },
207
+ server: {
208
+ auth: new MastraJwtAuth({ secret: process.env.JWT_SECRET! }),
209
+ },
210
+ })
211
+ ```
212
+
213
+ The authenticated user is mapped to `authInfo` as:
214
+
215
+ | `authInfo` field | Value |
216
+ | ---------------- | -------------------------------------------------------------------------- |
217
+ | `token` | The bearer token or session cookie value used for the request |
218
+ | `clientId` | The first present of `user.id`, `user.sub`, `user.userId`, `user.email` |
219
+ | `scopes` | `user.scopes`, `user.scope`, or `user.permissions`, normalized to an array |
220
+ | `extra.user` | The full user object returned by the auth provider |
221
+
222
+ If your own middleware performs the verification, set `server.mcpOptions.setRequestAuth` to build `authInfo` yourself. The hook replaces the default mapping and applies to both the streamable HTTP and SSE transports:
223
+
224
+ ```typescript
225
+ export const mastra = new Mastra({
226
+ mcpServers: { myServer },
227
+ server: {
228
+ middleware: [verifyBearerToken], // stores the payload on the request context
229
+ mcpOptions: {
230
+ setRequestAuth: (req, requestContext) => {
231
+ const payload = requestContext.get('bearerPayload')
232
+ req.auth = {
233
+ token: payload.token,
234
+ clientId: payload.sub,
235
+ scopes: payload.scope.split(' '),
236
+ }
237
+ },
238
+ },
239
+ },
240
+ })
241
+ ```
242
+
243
+ Leaving `req.auth` unset inside the hook opts the request out of auth info entirely.
244
+
171
245
  ## Methods
172
246
 
173
247
  These are the functions you can call on an `MCPServer` instance to control its behavior and get information.
@@ -194,6 +268,8 @@ await server.startStdio()
194
268
 
195
269
  ### `startSSE()`
196
270
 
271
+ > **Warning:** The HTTP+SSE transport is deprecated in the MCP specification. Use `startHTTP()` (streamable HTTP) instead.
272
+
197
273
  This method helps you integrate the MCP server with an existing web server to use Server-Sent Events (SSE) for communication. You'll call this from your web server's code when it receives a request for the SSE or message paths.
198
274
 
199
275
  ```typescript
@@ -246,6 +322,8 @@ Here are the details for the values needed by the `startSSE` method:
246
322
 
247
323
  ### `startHonoSSE()`
248
324
 
325
+ > **Warning:** The HTTP+SSE transport is deprecated in the MCP specification. Use `startHTTP()` (streamable HTTP) instead.
326
+
249
327
  This method helps you integrate the MCP server with an existing web server to use Server-Sent Events (SSE) for communication. You'll call this from your web server's code when it receives a request for the SSE or message paths.
250
328
 
251
329
  ```typescript
@@ -316,6 +394,21 @@ async startHTTP({
316
394
  }): Promise<void>
317
395
  ```
318
396
 
397
+ #### Options with `protocolVersion: '2026-07-28'`
398
+
399
+ The `2026-07-28` protocol uses one shared stateless handler instead of a transport configured for each request. `startHTTP()` handles legacy transport options as follows:
400
+
401
+ | Options | Behavior |
402
+ | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
403
+ | `serverless: true`, `serverlessStreaming: true`, `sessionIdGenerator: undefined` | Accepted because the modern handler already provides stateless requests and automatic request-scoped streaming. |
404
+ | `allowedHosts`, `allowedOrigins`, `enableDnsRebindingProtection` | Enforced before the request reaches the modern handler. Host and origin lists are active when `enableDnsRebindingProtection` is `true`. |
405
+ | `sessionIdGenerator` with a function, session callbacks, or `eventStore` | Rejected because the modern protocol doesn't create HTTP sessions. |
406
+ | `enableJsonResponse`, `retryInterval`, `keepAliveMs`, or `supportedProtocolVersions` | Rejected because these values configure a shared handler and can't vary between requests. |
407
+ | `serverless: false` or `serverlessStreaming: false` | Rejected because these values request behavior that differs from the modern handler. |
408
+ | Unknown options | Rejected instead of being ignored. |
409
+
410
+ Omit `options` when you don't need request guards or compatibility declarations.
411
+
319
412
  Here's an example of how you might use `startHTTP` within an HTTP server request handler. In this example an MCP client could connect to your MCP server at `http://localhost:1234/http`:
320
413
 
321
414
  ```typescript
@@ -338,7 +431,7 @@ httpServer.listen(PORT, () => {
338
431
  })
339
432
  ```
340
433
 
341
- For **serverless environments** (Supabase Edge Functions, Cloudflare Workers, Vercel Edge, etc.), use `serverless: true` to enable stateless operation:
434
+ For **serverless environments** (Supabase Edge Functions, Cloudflare Workers, Vercel Edge, etc.), use `serverless: true` to enable stateless operation on the legacy protocol path. Servers configured with `protocolVersion: '2026-07-28'` are already stateless and may omit this option.
342
435
 
343
436
  ```typescript
344
437
  // Supabase Edge Function example
@@ -412,7 +505,7 @@ serve(async req => {
412
505
  >
413
506
  > This is still stateless: no `mcp-session-id` is required or persisted. It only enables notifications scoped to the current request (such as progress). The session-dependent features below remain unavailable.
414
507
  >
415
- > The following MCP features require session state or persistent connections and **won't work** in serverless mode (including with `serverlessStreaming: true`):
508
+ > On the legacy protocol path, the following MCP features require session state or persistent connections and **won't work** in serverless mode (including with `serverlessStreaming: true`):
416
509
  >
417
510
  > - **Elicitation** - Interactive user input requests during tool execution require session management to route responses back to the correct client
418
511
  > - **Resource subscriptions** - `resources/subscribe` and `resources/unsubscribe` need persistent connections to maintain subscription state
@@ -929,7 +1022,7 @@ Notification methods (`resources.notifyListChanged()`, `prompts.notifyListChange
929
1022
 
930
1023
  ## Examples
931
1024
 
932
- For a practical example of packaging a stdio server, see [Publish a stdio server package](https://mastra.ai/docs/mcp/overview).
1025
+ For a practical example of packaging a stdio server, see [Publish a stdio server package](https://mastra.ai/docs/connections/mcp).
933
1026
 
934
1027
  The example at the beginning of this page also demonstrates how to instantiate `MCPServer` with both tools and agents.
935
1028
 
@@ -1663,7 +1756,7 @@ const server = new MCPServer({
1663
1756
  })
1664
1757
  ```
1665
1758
 
1666
- Link a tool to its app resource by setting `mcp._meta.ui.resourceUri` in `createTool()` to the matching `ui://` URI. The server normalizes this metadata for older hosts when listing tools. Visit [MCP Apps](https://mastra.ai/docs/mcp/overview) for the full app bridge API and usage patterns.
1759
+ Link a tool to its app resource by setting `mcp._meta.ui.resourceUri` in `createTool()` to the matching `ui://` URI. The server normalizes this metadata for older hosts when listing tools. Visit [MCP Apps](https://mastra.ai/docs/connections/mcp) for the full app bridge API and usage patterns.
1667
1760
 
1668
1761
  ## Related information
1669
1762
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  A built-in, agent-agnostic tool that submits an implementation plan for user review. The agent writes a plan to a markdown file and passes the file path to this tool. The tool suspends the run until the user approves or rejects the plan.
6
6
 
7
- The tool pauses through the native [tool suspension](https://mastra.ai/docs/agents/agent-approval) primitive: it calls `suspend({ path })`, which makes the agent emit a `tool-call-suspended` event. The host reads the plan file and presents it to the user. It then resumes with an approval or rejection.
7
+ The tool pauses through the native [tool suspension](https://mastra.ai/docs/agents/human-in-the-loop) primitive: it calls `suspend({ path })`, which makes the agent emit a `tool-call-suspended` event. The host reads the plan file and presents it to the user. It then resumes with an approval or rejection.
8
8
 
9
9
  When executed outside an agent run (no `suspend` available), the tool returns a readable fallback string containing the file path.
10
10
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  # Task tools
4
4
 
5
- Four built-in, agent-agnostic tools that manage a structured task list for an agent run. The task list is persisted in the thread-scoped `threadState` storage domain and projected onto the agent [state-signal](https://mastra.ai/docs/long-running-agents/signals) lane so it survives [observational-memory](https://mastra.ai/docs/memory/observational-memory) truncation.
5
+ Four built-in, agent-agnostic tools that manage a structured task list for an agent run. The task list is persisted in the thread-scoped `threadState` storage domain and projected onto the agent [state-signal](https://mastra.ai/docs/harness/signals) lane so it survives [observational-memory](https://mastra.ai/docs/memory/observational-memory) truncation.
6
6
 
7
7
  Task tracking requires a memory-backed thread (`threadId` + `resourceId`). Without memory the tools return an error explaining that task tracking requires agent memory.
8
8
 
9
- The recommended setup is [`TaskSignalProvider`](https://mastra.ai/reference/signals/task-signal-provider), which bundles all four tools and the `TaskStateProcessor` in a single registration. See [Built-in tools](https://mastra.ai/docs/agents/using-tools) for the conceptual guide.
9
+ The recommended setup is [`TaskSignalProvider`](https://mastra.ai/reference/signals/task-signal-provider), which bundles all four tools and the `TaskStateProcessor` in a single registration. See [Built-in tools](https://mastra.ai/docs/agents/tools) for the conceptual guide.
10
10
 
11
11
  ## Usage example
12
12
 
@@ -90,13 +90,13 @@ Lists all metadata field indexes for an index.
90
90
 
91
91
  ### `updateVector()`
92
92
 
93
- Updates a vector or metadata for a specific ID within an index.
93
+ Updates the vector and optionally the metadata for a specific ID within an index. Vectorize has no partial-update operation, so `update.vector` is required. Metadata-only updates aren't supported and throw an error.
94
94
 
95
95
  **indexName** (`string`): Name of the index containing the ID to update
96
96
 
97
97
  **id** (`string`): Unique identifier of the vector or metadata to update
98
98
 
99
- **update** (`{ vector?: number[]; metadata?: Record<string, any>; }`): Object containing the vector and/or metadata to update
99
+ **update** (`{ vector: number[]; metadata?: Record<string, any>; }`): Object containing the new vector values, and optionally the metadata to update. The vector values are required
100
100
 
101
101
  ### `deleteVector()`
102
102
 
@@ -106,6 +106,16 @@ Deletes a vector and its associated metadata for a specific ID within an index.
106
106
 
107
107
  **id** (`string`): Unique identifier of the vector and metadata to delete
108
108
 
109
+ ### `deleteVectors()`
110
+
111
+ Deletes multiple vectors and their associated metadata by ID. Vectorize has no filtered-delete operation, so deleting by metadata filter isn't supported and throws an error.
112
+
113
+ **indexName** (`string`): Name of the index containing the vectors to delete
114
+
115
+ **ids** (`string[]`): Unique identifiers of the vectors to delete. Must contain at least one ID, and cannot be combined with filter
116
+
117
+ **filter** (`Record<string, any>`): Not supported by Vectorize. Passing a filter throws an error
118
+
109
119
  ## Response types
110
120
 
111
121
  Query results are returned in this format:
@@ -31,7 +31,7 @@ The base URL of the API server, used by the orchestration worker to execute work
31
31
  MASTRA_STEP_EXECUTION_URL=http://api:4111/api
32
32
  ```
33
33
 
34
- Use HTTPS URLs in production. See [Security recommendations](https://mastra.ai/docs/server/auth/workers).
34
+ Use HTTPS URLs in production. See [Security recommendations](https://mastra.ai/docs/auth/workers).
35
35
 
36
36
  The orchestration worker sends step execution requests to:
37
37
 
@@ -41,7 +41,7 @@ ${MASTRA_STEP_EXECUTION_URL}/workflows/:workflowId/runs/:runId/steps/execute
41
41
 
42
42
  ### `MASTRA_WORKER_AUTH_TOKEN`
43
43
 
44
- A bearer token sent by the orchestration worker when calling the API's step execution endpoint. The API's configured auth provider must recognize this token. See [Worker authentication](https://mastra.ai/docs/server/auth/workers).
44
+ A bearer token sent by the orchestration worker when calling the API's step execution endpoint. The API's configured auth provider must recognize this token. See [Worker authentication](https://mastra.ai/docs/auth/workers).
45
45
 
46
46
  ```text
47
47
  MASTRA_WORKER_AUTH_TOKEN=sk-worker-secret-token
@@ -93,6 +93,27 @@ await run.resume({
93
93
 
94
94
  If `forEachIndex` is omitted, every suspended iteration of the step is resumed with the same `resumeData`.
95
95
 
96
+ ## Concurrent resume calls
97
+
98
+ Only one `resume()` call can continue a suspension. Before it runs anything, `resume()` atomically claims the run by moving its stored status from `suspended` to `running`. If another caller already claimed it, this call throws `WORKFLOW_RESUME_ALREADY_CLAIMED` and executes no steps, so downstream steps and their side effects run once per suspension.
99
+
100
+ This matters whenever a resume can be triggered more than once, such as an approval button pressed twice or a retried webhook. It also applies when several server instances react to the same event.
101
+
102
+ ```typescript
103
+ try {
104
+ await run.resume({ step: 'approval', resumeData: { approved: true } })
105
+ } catch (error) {
106
+ if (error.id === 'WORKFLOW_RESUME_ALREADY_CLAIMED') {
107
+ // Another caller is already continuing this run. Re-read the run state
108
+ // instead of resuming again.
109
+ }
110
+ }
111
+ ```
112
+
113
+ Over HTTP, a losing resume returns `409 Conflict`.
114
+
115
+ > **Note:** The claim is enforced atomically by storage adapters that report `supportsConcurrentUpdates()`. Adapters without atomic read-modify-write support (such as ClickHouse, Cloudflare D1, Cloudflare KV, Cloudflare Durable Objects, LanceDB, and Redis) can't enforce it, and the claim is also skipped when `shouldPersistSnapshot` excludes the `running` status.
116
+
96
117
  ## Related
97
118
 
98
119
  - [Workflows overview](https://mastra.ai/docs/workflows/overview)
@@ -356,4 +356,4 @@ Set `WORKSPACE_PATH` in your environment to an absolute path like `/home/user/my
356
356
 
357
357
  - [WorkspaceFilesystem interface](https://mastra.ai/reference/workspace/filesystem)
358
358
  - [Workspace class](https://mastra.ai/reference/workspace/workspace-class)
359
- - [Sandbox](https://mastra.ai/docs/workspace/sandbox)
359
+ - [Sandbox](https://mastra.ai/docs/sandbox/overview)
@@ -123,10 +123,11 @@ await sandbox.start()
123
123
  // Spawn a background process
124
124
  const handle = await sandbox.processes.spawn('node server.js')
125
125
 
126
- // Read output, send stdin, kill
126
+ // Read output, send stdin, signal EOF, and wait for completion
127
127
  console.log(handle.stdout)
128
128
  await handle.sendStdin('input\n')
129
- await handle.kill()
129
+ await handle.closeStdin()
130
+ await handle.wait()
130
131
  ```
131
132
 
132
133
  When native isolation is enabled (`seatbelt` or `bwrap`), spawned processes are also wrapped with the same isolation backend.
@@ -223,4 +224,4 @@ This separation prevents sandboxed processes from reading or modifying their own
223
224
  - [SandboxProcessManager reference](https://mastra.ai/reference/workspace/process-manager)
224
225
  - [WorkspaceSandbox Interface](https://mastra.ai/reference/workspace/sandbox)
225
226
  - [Workspace Class](https://mastra.ai/reference/workspace/workspace-class)
226
- - [Sandbox](https://mastra.ai/docs/workspace/sandbox)
227
+ - [Sandbox](https://mastra.ai/docs/sandbox/overview)