@mastra/mcp-docs-server 1.3.9 → 1.3.10-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/.docs/docs/agents/code-mode.md +2 -2
  2. package/.docs/docs/agents/guardrails.md +5 -5
  3. package/.docs/docs/agents/human-in-the-loop.md +18 -5
  4. package/.docs/docs/agents/networks.md +1 -1
  5. package/.docs/docs/agents/overview.md +7 -7
  6. package/.docs/docs/agents/processors.md +66 -20
  7. package/.docs/docs/agents/structured-output.md +6 -6
  8. package/.docs/docs/agents/tools.md +10 -10
  9. package/.docs/docs/browser.md +13 -1
  10. package/.docs/docs/channels.md +33 -6
  11. package/.docs/docs/connections/a2a.md +1 -1
  12. package/.docs/docs/connections/acp.md +2 -2
  13. package/.docs/docs/connections/mcp.md +159 -50
  14. package/.docs/docs/connections/overview.md +1 -1
  15. package/.docs/docs/connections/sdk-agents.md +8 -8
  16. package/.docs/docs/develop.md +1 -1
  17. package/.docs/docs/evals/custom-scorers.md +5 -5
  18. package/.docs/docs/evals/experiments.md +2 -2
  19. package/.docs/docs/evals/multi-turn.md +2 -2
  20. package/.docs/docs/evals/overview.md +4 -4
  21. package/.docs/docs/evals/quick-checks.md +2 -2
  22. package/.docs/docs/guides/build-an-eval-loop.md +3 -3
  23. package/.docs/docs/guides/context-engineering.md +13 -6
  24. package/.docs/docs/guides/mcp-authentication-authorization.md +2 -2
  25. package/.docs/docs/guides/streaming.md +1 -1
  26. package/.docs/docs/harness/agent-controller.md +7 -7
  27. package/.docs/docs/harness/background-tasks.md +3 -3
  28. package/.docs/docs/harness/durable-agents.md +5 -5
  29. package/.docs/docs/harness/goals.md +5 -5
  30. package/.docs/docs/harness/overview.md +2 -2
  31. package/.docs/docs/harness/schedules.md +5 -5
  32. package/.docs/docs/index.md +6 -6
  33. package/.docs/docs/mastra-platform/connect/channels.md +1 -1
  34. package/.docs/docs/mastra-platform/connect/tools.md +4 -4
  35. package/.docs/docs/mastra-platform/observability.md +1 -1
  36. package/.docs/docs/memory/memory-processors.md +7 -7
  37. package/.docs/docs/memory/message-history.md +5 -5
  38. package/.docs/docs/memory/multi-user-threads.md +1 -1
  39. package/.docs/docs/memory/observational-memory.md +14 -14
  40. package/.docs/docs/memory/semantic-recall.md +2 -2
  41. package/.docs/docs/memory/working-memory.md +2 -2
  42. package/.docs/docs/observability/logging.md +5 -5
  43. package/.docs/docs/observability/tracing/overview.md +1 -0
  44. package/.docs/docs/sandbox/filesystem.md +1 -0
  45. package/.docs/docs/sandbox/overview.md +1 -1
  46. package/.docs/docs/server/mastra-client.md +1 -1
  47. package/.docs/docs/server/middleware.md +1 -1
  48. package/.docs/docs/server/request-context.md +3 -3
  49. package/.docs/docs/server/server-adapters.md +12 -204
  50. package/.docs/docs/signals/notifications.md +233 -0
  51. package/.docs/docs/signals/overview.md +94 -0
  52. package/.docs/docs/signals/running-across-processes.md +132 -0
  53. package/.docs/docs/signals/sending-signals.md +166 -0
  54. package/.docs/docs/signals/signal-providers.md +278 -0
  55. package/.docs/docs/signals/state-signals.md +103 -0
  56. package/.docs/docs/signals/thread-streams.md +94 -0
  57. package/.docs/docs/skills.md +4 -4
  58. package/.docs/docs/storage.md +1 -1
  59. package/.docs/docs/studio/editor.md +39 -23
  60. package/.docs/docs/subagents.md +6 -6
  61. package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
  62. package/.docs/integrations/agentic-ui/copilotkit.md +1 -1
  63. package/.docs/integrations/agentic-ui/openui.md +1 -1
  64. package/.docs/integrations/browsers/agent-browser.md +1 -1
  65. package/.docs/integrations/browsers/browser-viewer.md +1 -1
  66. package/.docs/integrations/browsers/firecrawl.md +1 -1
  67. package/.docs/integrations/browsers/stagehand.md +6 -6
  68. package/.docs/integrations/channels/discord.md +1 -1
  69. package/.docs/integrations/channels/github.md +2 -2
  70. package/.docs/integrations/channels/imessage.md +2 -50
  71. package/.docs/integrations/channels/slack.md +1 -1
  72. package/.docs/integrations/channels/teams.md +1 -1
  73. package/.docs/integrations/channels/telegram.md +1 -1
  74. package/.docs/integrations/channels/whatsapp.md +1 -1
  75. package/.docs/integrations/databases/aurora-dsql.md +1 -1
  76. package/.docs/integrations/databases/cloudflare-kv.md +4 -0
  77. package/.docs/integrations/databases/elasticsearch.md +1 -1
  78. package/.docs/integrations/databases/mongodb.md +1 -1
  79. package/.docs/integrations/databases/oracledb.md +1 -1
  80. package/.docs/integrations/databases/postgresql.md +1 -1
  81. package/.docs/integrations/databases/redis.md +1 -1
  82. package/.docs/integrations/databases/upstash.md +1 -1
  83. package/.docs/integrations/deploy/kubernetes.md +1 -1
  84. package/.docs/integrations/deploy/neon.md +2 -1
  85. package/.docs/integrations/deploy/render.md +2 -2
  86. package/.docs/integrations/file-storage/agentfs.md +1 -1
  87. package/.docs/integrations/file-storage/amazon-s3.md +20 -3
  88. package/.docs/integrations/file-storage/archil.md +1 -1
  89. package/.docs/integrations/file-storage/azure-blob.md +1 -1
  90. package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
  91. package/.docs/integrations/file-storage/google-drive.md +1 -1
  92. package/.docs/integrations/file-storage/mesa.md +1 -1
  93. package/.docs/integrations/file-storage/neon.md +210 -0
  94. package/.docs/integrations/file-storage/vercel-files.md +5 -1
  95. package/.docs/integrations/frameworks/express.md +0 -64
  96. package/.docs/integrations/observability/langfuse.md +1 -1
  97. package/.docs/integrations/observability/langsmith.md +2 -2
  98. package/.docs/integrations/observability/opentelemetry.md +5 -5
  99. package/.docs/integrations/sandboxes/apple-container.md +1 -1
  100. package/.docs/integrations/sandboxes/blaxel.md +1 -1
  101. package/.docs/integrations/sandboxes/daytona.md +1 -1
  102. package/.docs/integrations/sandboxes/docker.md +1 -1
  103. package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
  104. package/.docs/integrations/sandboxes/e2b.md +4 -2
  105. package/.docs/integrations/sandboxes/modal.md +1 -1
  106. package/.docs/integrations/sandboxes/railway.md +1 -1
  107. package/.docs/integrations/sandboxes/sprites.md +1 -1
  108. package/.docs/integrations/sandboxes/vercel.md +2 -2
  109. package/.docs/integrations/tools/brightdata.md +1 -1
  110. package/.docs/integrations/tools/firecrawl.md +1 -1
  111. package/.docs/integrations/tools/parallel.md +1 -1
  112. package/.docs/integrations/tools/perplexity.md +1 -1
  113. package/.docs/integrations/tools/tavily.md +1 -1
  114. package/.docs/integrations/voice/livekit.md +2 -2
  115. package/.docs/integrations.md +1 -0
  116. package/.docs/models/environment-variables.md +0 -2
  117. package/.docs/models/gateways/custom-gateways.md +3 -3
  118. package/.docs/models/gateways/merge-gateway.md +2 -14
  119. package/.docs/models/gateways/netlify.md +2 -1
  120. package/.docs/models/gateways/openrouter.md +3 -2
  121. package/.docs/models/gateways/vercel.md +3 -9
  122. package/.docs/models/index.md +13 -15
  123. package/.docs/models/providers/302ai.md +3 -3
  124. package/.docs/models/providers/abacus.md +70 -110
  125. package/.docs/models/providers/aimlapi.md +171 -171
  126. package/.docs/models/providers/aki-io.md +5 -6
  127. package/.docs/models/providers/alibaba-cn.md +2 -2
  128. package/.docs/models/providers/alibaba.md +2 -2
  129. package/.docs/models/providers/ambient.md +1 -1
  130. package/.docs/models/providers/auriko.md +2 -2
  131. package/.docs/models/providers/baseten.md +4 -4
  132. package/.docs/models/providers/berget.md +3 -4
  133. package/.docs/models/providers/bothub.md +4 -4
  134. package/.docs/models/providers/boundless.md +0 -4
  135. package/.docs/models/providers/cline-pass.md +2 -8
  136. package/.docs/models/providers/commandcode.md +0 -1
  137. package/.docs/models/providers/coralbricks.md +1 -1
  138. package/.docs/models/providers/cortecs.md +3 -3
  139. package/.docs/models/providers/crossmodel.md +1 -3
  140. package/.docs/models/providers/crusoe.md +1 -7
  141. package/.docs/models/providers/daoxe.md +1 -1
  142. package/.docs/models/providers/deepinfra.md +2 -2
  143. package/.docs/models/providers/digitalocean.md +6 -10
  144. package/.docs/models/providers/dinference.md +0 -3
  145. package/.docs/models/providers/edenai.md +12 -2
  146. package/.docs/models/providers/empiriolabs.md +0 -1
  147. package/.docs/models/providers/engy.md +2 -2
  148. package/.docs/models/providers/evroc.md +2 -2
  149. package/.docs/models/providers/fastrouter.md +41 -50
  150. package/.docs/models/providers/fireworks-ai.md +28 -23
  151. package/.docs/models/providers/friendli.md +4 -5
  152. package/.docs/models/providers/frogbot.md +2 -7
  153. package/.docs/models/providers/google.md +2 -5
  154. package/.docs/models/providers/greenpt.md +14 -20
  155. package/.docs/models/providers/groq.md +1 -1
  156. package/.docs/models/providers/huggingface.md +3 -1
  157. package/.docs/models/providers/iflowcn.md +2 -18
  158. package/.docs/models/providers/impossibl.md +2 -9
  159. package/.docs/models/providers/inceptron.md +8 -6
  160. package/.docs/models/providers/inco.md +1 -1
  161. package/.docs/models/providers/inference.md +5 -11
  162. package/.docs/models/providers/infomaniak.md +10 -12
  163. package/.docs/models/providers/io-net.md +11 -17
  164. package/.docs/models/providers/iteracompute.md +3 -3
  165. package/.docs/models/providers/jalapeno.md +14 -19
  166. package/.docs/models/providers/jiekou.md +53 -63
  167. package/.docs/models/providers/kenari.md +34 -53
  168. package/.docs/models/providers/kilo.md +12 -11
  169. package/.docs/models/providers/lilac.md +2 -8
  170. package/.docs/models/providers/llama.md +2 -11
  171. package/.docs/models/providers/llmgateway-providers.md +8 -16
  172. package/.docs/models/providers/llmgateway.md +9 -8
  173. package/.docs/models/providers/llmtr.md +1 -6
  174. package/.docs/models/providers/lowrouter.md +1 -1
  175. package/.docs/models/providers/lucidquery.md +2 -2
  176. package/.docs/models/providers/meganova.md +6 -7
  177. package/.docs/models/providers/melious.md +2 -7
  178. package/.docs/models/providers/mistral.md +4 -3
  179. package/.docs/models/providers/moark.md +0 -2
  180. package/.docs/models/providers/nan.md +1 -1
  181. package/.docs/models/providers/nano-gpt.md +16 -8
  182. package/.docs/models/providers/nearai.md +2 -1
  183. package/.docs/models/providers/neuralwatt.md +1 -4
  184. package/.docs/models/providers/novita-ai.md +2 -1
  185. package/.docs/models/providers/nvidia.md +15 -35
  186. package/.docs/models/providers/oci.md +0 -1
  187. package/.docs/models/providers/ofox.md +1 -1
  188. package/.docs/models/providers/ollama-cloud.md +2 -2
  189. package/.docs/models/providers/opencode-go.md +2 -3
  190. package/.docs/models/providers/opencode.md +85 -88
  191. package/.docs/models/providers/opper.md +1 -4
  192. package/.docs/models/providers/orcarouter.md +14 -16
  193. package/.docs/models/providers/pareto.md +1 -1
  194. package/.docs/models/providers/perplexity-agent.md +2 -12
  195. package/.docs/models/providers/pioneer.md +7 -7
  196. package/.docs/models/providers/poe.md +16 -70
  197. package/.docs/models/providers/prime.md +2 -1
  198. package/.docs/models/providers/qihang-ai.md +7 -11
  199. package/.docs/models/providers/qiniu-ai.md +9 -94
  200. package/.docs/models/providers/regolo-ai.md +5 -7
  201. package/.docs/models/providers/runinfra.md +1 -4
  202. package/.docs/models/providers/sarvam.md +1 -2
  203. package/.docs/models/providers/scaleway.md +12 -11
  204. package/.docs/models/providers/siliconflow-cn.md +35 -41
  205. package/.docs/models/providers/siliconflow.md +3 -6
  206. package/.docs/models/providers/stackit.md +2 -4
  207. package/.docs/models/providers/stepfun-ai.md +4 -4
  208. package/.docs/models/providers/stepfun.md +4 -4
  209. package/.docs/models/providers/submodel.md +1 -1
  210. package/.docs/models/providers/synthetic.md +0 -4
  211. package/.docs/models/providers/tempr.md +1 -4
  212. package/.docs/models/providers/tencent-coding-plan.md +3 -10
  213. package/.docs/models/providers/tensorx.md +0 -13
  214. package/.docs/models/providers/the-grid-ai.md +2 -1
  215. package/.docs/models/providers/tokengo.md +1 -1
  216. package/.docs/models/providers/umans-ai-coding-plan.md +12 -11
  217. package/.docs/models/providers/umans-ai.md +11 -10
  218. package/.docs/models/providers/unorouter.md +0 -13
  219. package/.docs/models/providers/vancine.md +0 -1
  220. package/.docs/models/providers/vivgrid.md +3 -3
  221. package/.docs/models/providers/volcengine-coding-plan.md +8 -12
  222. package/.docs/models/providers/volcengine.md +12 -18
  223. package/.docs/models/providers/vultr.md +0 -2
  224. package/.docs/models/providers/wafer.ai.md +3 -7
  225. package/.docs/models/providers/xai.md +19 -3
  226. package/.docs/models/providers/xiaomi-token-plan-ams.md +4 -4
  227. package/.docs/models/providers/xiaomi-token-plan-cn.md +4 -4
  228. package/.docs/models/providers/xiaomi-token-plan-sgp.md +4 -4
  229. package/.docs/models/providers/xiaomi.md +4 -4
  230. package/.docs/models/providers/xpersona.md +0 -1
  231. package/.docs/models/providers/zenmux.md +105 -125
  232. package/.docs/models/providers.md +0 -2
  233. package/.docs/reference/acp/acp-agent.md +4 -4
  234. package/.docs/reference/acp/create-acp-tool.md +1 -1
  235. package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
  236. package/.docs/reference/agent-controller/session.md +10 -10
  237. package/.docs/reference/agents/agent.md +23 -47
  238. package/.docs/reference/agents/channels.md +13 -11
  239. package/.docs/reference/agents/durable-agent.md +13 -13
  240. package/.docs/reference/agents/generate.md +57 -3
  241. package/.docs/reference/agents/generateLegacy.md +2 -2
  242. package/.docs/reference/agents/getLLM.md +2 -2
  243. package/.docs/reference/agents/getMetadata.md +2 -2
  244. package/.docs/reference/agents/inngest-agent.md +1 -1
  245. package/.docs/reference/agents/network.md +1 -1
  246. package/.docs/reference/browser/agent-browser.md +1 -1
  247. package/.docs/reference/browser/browser-viewer.md +1 -1
  248. package/.docs/reference/browser/firecrawl-browser.md +1 -1
  249. package/.docs/reference/browser/mastra-browser.md +1 -1
  250. package/.docs/reference/browser/stagehand-browser.md +4 -4
  251. package/.docs/reference/channels/slack-provider.md +3 -0
  252. package/.docs/reference/cli/mastra.md +26 -0
  253. package/.docs/reference/client-js/agent-controller.md +2 -2
  254. package/.docs/reference/client-js/agents.md +18 -2
  255. package/.docs/reference/client-js/datasets.md +1 -1
  256. package/.docs/reference/client-js/observability.md +26 -1
  257. package/.docs/reference/coding-agent/build-base-prompt.md +1 -1
  258. package/.docs/reference/coding-agent/create-coding-agent.md +8 -8
  259. package/.docs/reference/configuration.md +4 -4
  260. package/.docs/reference/connect/channels.md +1 -1
  261. package/.docs/reference/connect/credential.md +1 -1
  262. package/.docs/reference/connect/tools.md +8 -10
  263. package/.docs/reference/core/getAgentById.md +1 -1
  264. package/.docs/reference/core/mastra-class.md +3 -3
  265. package/.docs/reference/core/mastra-model-gateway.md +1 -1
  266. package/.docs/reference/datasets/startExperiment.md +15 -0
  267. package/.docs/reference/editor/mastra-editor.md +2 -2
  268. package/.docs/reference/evals/answer-relevancy.md +1 -1
  269. package/.docs/reference/evals/answer-similarity.md +1 -1
  270. package/.docs/reference/evals/bias.md +1 -1
  271. package/.docs/reference/evals/checks.md +1 -1
  272. package/.docs/reference/evals/context-precision.md +3 -3
  273. package/.docs/reference/evals/context-recall.md +3 -3
  274. package/.docs/reference/evals/context-relevance.md +11 -11
  275. package/.docs/reference/evals/faithfulness.md +1 -1
  276. package/.docs/reference/evals/hallucination.md +5 -5
  277. package/.docs/reference/evals/multi-turn-judge.md +2 -2
  278. package/.docs/reference/evals/noise-sensitivity.md +12 -12
  279. package/.docs/reference/evals/not-scorable.md +1 -1
  280. package/.docs/reference/evals/prompt-alignment.md +16 -16
  281. package/.docs/reference/evals/rubric.md +6 -6
  282. package/.docs/reference/evals/run-evals.md +1 -1
  283. package/.docs/reference/evals/summarization.md +4 -4
  284. package/.docs/reference/evals/tool-call-accuracy.md +4 -4
  285. package/.docs/reference/evals/toxicity.md +1 -1
  286. package/.docs/reference/file-based-agents/config.md +3 -3
  287. package/.docs/reference/file-based-agents/schedules.md +1 -1
  288. package/.docs/reference/file-based-agents/subagents.md +4 -4
  289. package/.docs/reference/file-based-agents/workspace.md +1 -1
  290. package/.docs/reference/index.md +2 -1
  291. package/.docs/reference/manual-install.md +2 -2
  292. package/.docs/reference/memory/memory-class.md +3 -3
  293. package/.docs/reference/memory/observational-memory.md +16 -16
  294. package/.docs/reference/memory/summarizeConversation.md +3 -3
  295. package/.docs/reference/memory/summarizeThread.md +3 -3
  296. package/.docs/reference/migrations/agentnetwork.md +4 -4
  297. package/.docs/reference/migrations/mcp-v2.md +1 -1
  298. package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
  299. package/.docs/reference/migrations/vnext-to-standard-apis.md +2 -2
  300. package/.docs/reference/observability/tracing/advanced-queries.md +92 -11
  301. package/.docs/reference/observability/tracing/bridges/otel.md +1 -1
  302. package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
  303. package/.docs/reference/observability/tracing/interfaces.md +2 -0
  304. package/.docs/reference/processors/batch-parts-processor.md +1 -1
  305. package/.docs/reference/processors/classifier-processor.md +2 -2
  306. package/.docs/reference/processors/cyber-refusal-handler.md +1 -1
  307. package/.docs/reference/processors/file-upload-processor.md +5 -5
  308. package/.docs/reference/processors/language-detector.md +1 -1
  309. package/.docs/reference/processors/message-history-processor.md +2 -2
  310. package/.docs/reference/processors/model-selection-processor.md +7 -7
  311. package/.docs/reference/processors/moderation-processor.md +3 -3
  312. package/.docs/reference/processors/pii-detector.md +2 -2
  313. package/.docs/reference/processors/prefill-error-handler.md +2 -2
  314. package/.docs/reference/processors/processor-interface.md +66 -10
  315. package/.docs/reference/processors/prompt-injection-detector.md +1 -1
  316. package/.docs/reference/processors/provider-history-compat.md +2 -2
  317. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  318. package/.docs/reference/processors/response-cache.md +1 -1
  319. package/.docs/reference/processors/semantic-recall-processor.md +2 -2
  320. package/.docs/reference/processors/skill-search-processor.md +1 -1
  321. package/.docs/reference/processors/stream-error-retry-processor.md +3 -3
  322. package/.docs/reference/processors/system-prompt-scrubber.md +2 -2
  323. package/.docs/reference/processors/token-cost-control.md +1 -1
  324. package/.docs/reference/processors/token-limiter-processor.md +4 -4
  325. package/.docs/reference/processors/tool-call-filter.md +3 -3
  326. package/.docs/reference/processors/tool-search-processor.md +4 -4
  327. package/.docs/reference/processors/unicode-normalizer.md +1 -1
  328. package/.docs/reference/processors/working-memory-processor.md +2 -2
  329. package/.docs/reference/pubsub/lease-provider.md +2 -2
  330. package/.docs/reference/pubsub/redis-streams.md +11 -1
  331. package/.docs/reference/pubsub/unix-socket-pubsub.md +1 -1
  332. package/.docs/reference/rag/chunking-and-embedding.md +1 -1
  333. package/.docs/reference/rag/graph-rag-guide.md +2 -2
  334. package/.docs/reference/rag/metadata-filters.md +1 -1
  335. package/.docs/reference/rag/rerank.md +1 -1
  336. package/.docs/reference/rag/retrieval.md +13 -13
  337. package/.docs/reference/server/nestjs-adapter.md +1 -1
  338. package/.docs/reference/signals/create-notification-inbox-tool.md +4 -4
  339. package/.docs/reference/signals/notifications.md +249 -0
  340. package/.docs/reference/signals/task-signal-provider.md +2 -2
  341. package/.docs/reference/signals/thread-events.md +69 -0
  342. package/.docs/reference/storage/retention.md +1 -1
  343. package/.docs/reference/streaming/ChunkType.md +68 -0
  344. package/.docs/reference/streaming/agents/stream.md +4 -4
  345. package/.docs/reference/tools/create-code-mode.md +1 -1
  346. package/.docs/reference/tools/create-tool.md +19 -2
  347. package/.docs/reference/tools/mcp-client.md +202 -11
  348. package/.docs/reference/tools/mcp-server.md +7 -5
  349. package/.docs/reference/tools/task-tools.md +1 -1
  350. package/.docs/reference/tools/vector-query-tool.md +1 -1
  351. package/.docs/reference/vectors/libsql.md +1 -1
  352. package/.docs/reference/vectors/mongodb.md +2 -2
  353. package/.docs/reference/vectors/oracledb.md +2 -2
  354. package/.docs/reference/vectors/pg.md +1 -1
  355. package/.docs/reference/vectors/turbopuffer.md +1 -1
  356. package/.docs/reference/vectors/upstash.md +1 -1
  357. package/.docs/reference/voice/overview.md +24 -24
  358. package/.docs/reference/voice/speech-to-speech.md +6 -6
  359. package/.docs/reference/voice/speech-to-text.md +1 -1
  360. package/.docs/reference/voice/text-to-speech.md +1 -1
  361. package/.docs/reference/voice/voice.addInstructions.md +1 -1
  362. package/.docs/reference/workflows/run-methods/timeTravel.md +1 -1
  363. package/.docs/reference/workspace/local-filesystem.md +1 -1
  364. package/.docs/reference/workspace/local-sandbox.md +1 -1
  365. package/.docs/reference/workspace/platform-filesystem.md +1 -1
  366. package/.docs/reference/workspace/platform-sandbox.md +21 -2
  367. package/.docs/reference/workspace/process-manager.md +13 -2
  368. package/.docs/reference/workspace/sandbox.md +1 -1
  369. package/.docs/reference/workspace/workspace-class.md +12 -12
  370. package/package.json +11 -11
  371. package/.docs/docs/guides/mcp-events.md +0 -306
  372. package/.docs/docs/harness/signal-providers.md +0 -212
  373. package/.docs/docs/harness/signals.md +0 -546
  374. package/.docs/docs/mastra-platform/connect/end-user-connections.md +0 -116
  375. package/.docs/reference/connect/user-connect-routes.md +0 -68
@@ -168,7 +168,7 @@ If you prefer not to use our automatic CLI tool, you can set up your project you
168
168
  mkdir -p src/mastra/agents && touch src/mastra/agents/weather-agent.ts
169
169
  ```
170
170
 
171
- Use `import { Agent } from "@mastra/core/agent"`. Constructor takes `{ id, name, instructions, model: 'openai/gpt-5.6-sol' }`. The model string uses Mastra's model router format, 'provider/model', with / rather than : between the provider and model. Don't install any AI SDK packages.
171
+ Use `import { Agent } from "@mastra/core/agent"`. Constructor takes `{ id, name, instructions, model: 'openai/gpt-6.1-sol' }`. The model string uses Mastra's model router format, 'provider/model', with / rather than : between the provider and model. Don't install any AI SDK packages.
172
172
 
173
173
  Add the following code:
174
174
 
@@ -191,7 +191,7 @@ If you prefer not to use our automatic CLI tool, you can set up your project you
191
191
 
192
192
  Use the weatherTool to fetch current weather data.
193
193
  `,
194
- model: 'google/gemini-2.5-pro',
194
+ model: 'google/gemini-3.8-flash',
195
195
  tools: { weatherTool },
196
196
  })
197
197
  ```
@@ -16,7 +16,7 @@ export const agent = new Agent({
16
16
  id: 'test-agent',
17
17
  name: 'test-agent',
18
18
  instructions: 'You are an agent with memory.',
19
- model: 'openai/gpt-5.6-sol',
19
+ model: 'openai/gpt-6.1-sol',
20
20
  memory: new Memory({
21
21
  options: {
22
22
  workingMemory: {
@@ -71,7 +71,7 @@ import { LibSQLStore, LibSQLVector } from '@mastra/libsql'
71
71
  export const agent = new Agent({
72
72
  name: 'test-agent',
73
73
  instructions: 'You are an agent with memory.',
74
- model: 'openai/gpt-5.6-sol',
74
+ model: 'openai/gpt-6.1-sol',
75
75
  memory: new Memory({
76
76
  storage: new LibSQLStore({
77
77
  id: 'test-agent-storage',
@@ -108,7 +108,7 @@ import { PostgresStore, PgVector } from '@mastra/pg'
108
108
  export const agent = new Agent({
109
109
  name: 'pg-agent',
110
110
  instructions: 'You are an agent with optimized PostgreSQL memory.',
111
- model: 'openai/gpt-5.6-sol',
111
+ model: 'openai/gpt-6.1-sol',
112
112
  memory: new Memory({
113
113
  storage: new PostgresStore({
114
114
  id: 'pg-agent-storage',
@@ -18,7 +18,7 @@ export const agent = new Agent({
18
18
  id: 'my-agent',
19
19
  name: 'my-agent',
20
20
  instructions: 'You are a helpful assistant.',
21
- model: 'openai/gpt-5-mini',
21
+ model: 'openai/gpt-6-luna',
22
22
  memory: new Memory({
23
23
  options: {
24
24
  observationalMemory: true,
@@ -39,7 +39,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
39
39
 
40
40
  **model** (`'auto' | string | LanguageModel | DynamicModel | ModelByInputTokens | ModelWithRetries[]`): Model for both the Observer and Reflector agents. Cannot be used together with observation.model or reflection.model. When all model fields are omitted, each role defaults to "auto". Automatic selection prefers google/gemini-2.5-flash when GOOGLE\_GENERATIVE\_AI\_API\_KEY is configured, then a low-cost model for the active provider, then the active main model. Use "default" for the legacy fixed default. (Default: `'auto'`)
41
41
 
42
- **autoModels** (`Record<string, string>`): Overrides the model automatic selection picks for a provider, keyed by provider ID. For example, { openai: "\_\_GATEWAY\_OPENAI\_MODEL\_NANO\_\_" }. Providers not listed use the built-in pick.
42
+ **autoModels** (`Record<string, string>`): Overrides the model automatic selection picks for a provider, keyed by provider ID. For example, { openai: "\_\_GATEWAY\_OPENAI\_MODEL\_LUNA\_\_" }. Providers not listed use the built-in pick.
43
43
 
44
44
  **resolveModel** (`(modelId: string, context: { requestContext?: RequestContext }) => MastraModelConfig | Promise<MastraModelConfig>`): Creates the model automatic selection picked, so it can use your credentials and routing. Receives only concrete model IDs, never "auto". When omitted, the picked ID goes through Mastra model routing.
45
45
 
@@ -158,7 +158,7 @@ import { z } from 'zod'
158
158
  const memory = new Memory({
159
159
  options: {
160
160
  observationalMemory: {
161
- model: 'openai/gpt-5-mini',
161
+ model: 'openai/gpt-6-luna',
162
162
  observation: {
163
163
  extract: [
164
164
  new Extractor({
@@ -240,7 +240,7 @@ export const agent = new Agent({
240
240
  id: 'my-agent',
241
241
  name: 'my-agent',
242
242
  instructions: 'You are a helpful assistant.',
243
- model: 'openai/gpt-5-mini',
243
+ model: 'openai/gpt-6-luna',
244
244
  memory: new Memory({
245
245
  options: {
246
246
  observationalMemory: {
@@ -269,7 +269,7 @@ export const agent = new Agent({
269
269
  id: 'my-agent',
270
270
  name: 'my-agent',
271
271
  instructions: 'You are a helpful assistant.',
272
- model: 'openai/gpt-5-mini',
272
+ model: 'openai/gpt-6-luna',
273
273
  memory: new Memory({
274
274
  options: {
275
275
  observationalMemory: {
@@ -299,11 +299,11 @@ export const agent = new Agent({
299
299
  id: 'my-agent',
300
300
  name: 'my-agent',
301
301
  instructions: 'You are a helpful assistant.',
302
- model: 'openai/gpt-5.6-sol',
302
+ model: 'openai/gpt-6.1-sol',
303
303
  memory: new Memory({
304
304
  options: {
305
305
  observationalMemory: {
306
- model: 'openai/gpt-5-mini',
306
+ model: 'openai/gpt-6-luna',
307
307
  },
308
308
  },
309
309
  }),
@@ -320,7 +320,7 @@ export const agent = new Agent({
320
320
  id: 'my-agent',
321
321
  name: 'my-agent',
322
322
  instructions: 'You are a helpful assistant.',
323
- model: 'openai/gpt-5.6-sol',
323
+ model: 'openai/gpt-6.1-sol',
324
324
  memory: new Memory({
325
325
  options: {
326
326
  observationalMemory: {
@@ -328,7 +328,7 @@ export const agent = new Agent({
328
328
  model: 'google/gemini-2.5-flash',
329
329
  },
330
330
  reflection: {
331
- model: 'openai/gpt-5-mini',
331
+ model: 'openai/gpt-6-luna',
332
332
  },
333
333
  },
334
334
  },
@@ -348,7 +348,7 @@ export const agent = new Agent({
348
348
  id: 'health-assistant',
349
349
  name: 'health-assistant',
350
350
  instructions: 'You are a health and wellness assistant.',
351
- model: 'openai/gpt-5.6-sol',
351
+ model: 'openai/gpt-6.1-sol',
352
352
  memory: new Memory({
353
353
  options: {
354
354
  observationalMemory: {
@@ -393,7 +393,7 @@ export const agent = new Agent({
393
393
  id: 'my-agent',
394
394
  name: 'my-agent',
395
395
  instructions: 'You are a helpful assistant.',
396
- model: 'openai/gpt-5-mini',
396
+ model: 'openai/gpt-6-luna',
397
397
  memory: new Memory({
398
398
  options: {
399
399
  observationalMemory: {
@@ -748,7 +748,7 @@ const memory = new Memory({ storage })
748
748
  const om = new ObservationalMemory({
749
749
  storage: storage.stores.memory!,
750
750
  memory,
751
- model: 'google/gemini-2.5-flash',
751
+ model: 'google/gemini-3.8-flash',
752
752
  observation: {
753
753
  messageTokens: 20_000,
754
754
  },
@@ -763,7 +763,7 @@ export const agent = new Agent({
763
763
  id: 'my-agent',
764
764
  name: 'my-agent',
765
765
  instructions: 'You are a helpful assistant.',
766
- model: 'openai/gpt-5-mini',
766
+ model: 'openai/gpt-6-luna',
767
767
  inputProcessors: [omProcessor],
768
768
  outputProcessors: [omProcessor],
769
769
  })
@@ -920,8 +920,8 @@ import { ModelByInputTokens } from '@mastra/memory'
920
920
  const selector = new ModelByInputTokens({
921
921
  upTo: {
922
922
  10_000: 'google/gemini-2.5-flash', // Fast for small inputs
923
- 40_000: 'openai/gpt-5-mini', // Stronger for medium inputs
924
- 1_000_000: 'openai/gpt-5.6-sol', // Most capable for large inputs
923
+ 40_000: 'openai/gpt-6-luna', // Stronger for medium inputs
924
+ 1_000_000: 'openai/gpt-6.1-sol', // Most capable for large inputs
925
925
  },
926
926
  })
927
927
  ```
@@ -950,7 +950,7 @@ import { skillResultRedactor } from '@mastra/memory/hooks'
950
950
  const memory = new Memory({
951
951
  options: {
952
952
  observationalMemory: {
953
- model: 'google/gemini-2.5-flash',
953
+ model: 'google/gemini-3.8-flash',
954
954
  hooks: {
955
955
  beforeObservation: skillResultRedactor(),
956
956
  },
@@ -16,7 +16,7 @@ Use this when you already have the messages in hand and want explicit control ov
16
16
  import { summarizeConversation } from '@mastra/memory'
17
17
 
18
18
  const result = await summarizeConversation({
19
- model: 'openai/gpt-5-mini',
19
+ model: 'openai/gpt-6-luna',
20
20
  messages,
21
21
  instructions: 'Summarize this voicemail call for the business owner.',
22
22
  })
@@ -24,7 +24,7 @@ const result = await summarizeConversation({
24
24
 
25
25
  ## Parameters
26
26
 
27
- **model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model that runs the summarization, such as a router string like '\_\_GATEWAY\_OPENAI\_MODEL\_MINI\_\_'. Pass an array of { model, maxRetries } entries to fall back to the next model when one fails.
27
+ **model** (`string | LanguageModel | DynamicModel | ModelWithRetries[]`): Model that runs the summarization, such as a router string like '\_\_GATEWAY\_OPENAI\_MODEL\_LUNA\_\_'. Pass an array of { model, maxRetries } entries to fall back to the next model when one fails.
28
28
 
29
29
  **messages** (`MastraDBMessage[]`): The conversation to summarize. When empty, the function returns an empty result without calling the model.
30
30
 
@@ -80,7 +80,7 @@ const sessionSummary = new Extractor({
80
80
 
81
81
  export async function onSessionEnd(messages: MastraDBMessage[]) {
82
82
  const { summary, extracted, extractionFailures } = await summarizeConversation({
83
- model: 'openai/gpt-5-mini',
83
+ model: 'openai/gpt-6-luna',
84
84
  messages,
85
85
  instructions: 'Summarize this support session for the account manager.',
86
86
  extract: [sessionSummary],
@@ -16,7 +16,7 @@ Use this when a session ends and you want a summary or structured extraction of
16
16
 
17
17
  ```typescript
18
18
  const result = await memory.summarizeThread({
19
- model: 'openai/gpt-5-mini',
19
+ model: 'openai/gpt-6-luna',
20
20
  threadId: 'thread-123',
21
21
  instructions: 'Summarize this voicemail call for the business owner.',
22
22
  })
@@ -26,7 +26,7 @@ const result = await memory.summarizeThread({
26
26
 
27
27
  **threadId** (`string`): The unique identifier of the thread to summarize.
28
28
 
29
- **model** (`string | LanguageModel | DynamicModel`): Model that runs the summarization, such as a router string like '\_\_GATEWAY\_OPENAI\_MODEL\_MINI\_\_'.
29
+ **model** (`string | LanguageModel | DynamicModel`): Model that runs the summarization, such as a router string like '\_\_GATEWAY\_OPENAI\_MODEL\_LUNA\_\_'.
30
30
 
31
31
  **resourceId** (`string`): ID of the resource that owns the thread. If provided, validates thread ownership. Also passed to extractor contexts.
32
32
 
@@ -78,7 +78,7 @@ const callSummary = new Extractor({
78
78
 
79
79
  export async function onCallEnd(threadId: string, resourceId: string) {
80
80
  await memory.summarizeThread({
81
- model: 'openai/gpt-5-mini',
81
+ model: 'openai/gpt-6-luna',
82
82
  threadId,
83
83
  resourceId,
84
84
  instructions: 'Summarize this voicemail call for the business owner.',
@@ -31,7 +31,7 @@ const agent = new AgentNetwork({
31
31
  name: 'agent-network',
32
32
  agents: [agent1, agent2],
33
33
  tools: { tool1, tool2 },
34
- model: 'openai/gpt-5.6-sol',
34
+ model: 'openai/gpt-6.1-sol',
35
35
  instructions: 'You are a network agent that can help users with a variety of tasks.',
36
36
  })
37
37
 
@@ -51,7 +51,7 @@ const agent = new Agent({
51
51
  name: 'agent-network',
52
52
  agents: { agent1, agent2 },
53
53
  tools: { tool1, tool2 },
54
- model: 'openai/gpt-5.6-sol',
54
+ model: 'openai/gpt-6.1-sol',
55
55
  instructions: 'You are a network agent that can help users with a variety of tasks.',
56
56
  memory,
57
57
  })
@@ -72,7 +72,7 @@ const agent = new NewAgentNetwork({
72
72
  agents: { agent1, agent2 },
73
73
  workflows: { workflow1 },
74
74
  tools: { tool1, tool2 },
75
- model: 'openai/gpt-5.6-sol',
75
+ model: 'openai/gpt-6.1-sol',
76
76
  instructions: 'You are a network agent that can help users with a variety of tasks.',
77
77
  })
78
78
 
@@ -93,7 +93,7 @@ const agent = new Agent({
93
93
  agents: { agent1, agent2 },
94
94
  workflows: { workflow1 },
95
95
  tools: { tool1, tool2 },
96
- model: 'openai/gpt-5.6-sol',
96
+ model: 'openai/gpt-6.1-sol',
97
97
  instructions: 'You are a network agent that can help users with a variety of tasks.',
98
98
  memory,
99
99
  })
@@ -204,7 +204,7 @@ await server.startHTTP({
204
204
 
205
205
  ### Server `protocolVersion` option
206
206
 
207
- Servers accepted `protocolVersion` (`'2025-11-25'`, `'2026-07-28'` or `'auto'`). Only `2026-07-28` is served now, exposed as the `MCP_PROTOCOL_VERSION` constant. Remove the option; a client that doesn't offer `2026-07-28` fails with an explicit negotiation error instead of a downgrade.
207
+ Servers accepted `protocolVersion` (`'2025-11-25'`, `'2026-07-28'` or `'auto'`). Only `2026-07-28` is served now, exposed as the `MCP_PROTOCOL_VERSION` constant. Remove the option; a client that doesn't offer `2026-07-28` fails with an explicit negotiation error instead of a downgrade. To keep serving clients that still open with `initialize` over HTTP, set `legacy: 'stateless'` on the server. Each of their requests is then answered without a session.
208
208
 
209
209
  ```diff
210
210
  const server = new MCPServer({
@@ -231,7 +231,7 @@ const agent = new Agent({
231
231
  + id: 'my-agent',
232
232
  name: 'My Agent',
233
233
  instructions: 'You are a helpful assistant',
234
- model: 'openai/gpt-5.6-sol',
234
+ model: 'openai/gpt-6.1-sol',
235
235
  });
236
236
  ```
237
237
 
@@ -163,7 +163,7 @@ The following options are available in the standard `.stream()` and `generate()`
163
163
  name: z.string(),
164
164
  age: z.number(),
165
165
  }),
166
- model: 'openai/gpt-5.6-sol', // Optional model override for structuring
166
+ model: 'openai/gpt-6.1-sol', // Optional model override for structuring
167
167
  errorStrategy: 'fallback',
168
168
  fallbackValue: { name: 'unknown', age: 0 },
169
169
  instructions: 'Extract user information', // Override default structuring instructions
@@ -301,7 +301,7 @@ The following options are available in the standard `.stream()` and `generate()`
301
301
  schema: z.object({
302
302
  summary: z.string(),
303
303
  }),
304
- model: 'openai/gpt-5.6-sol',
304
+ model: 'openai/gpt-6.1-sol',
305
305
  },
306
306
  })
307
307
  ```
@@ -10,8 +10,9 @@ Advanced trace queries select completed traces with a structured time range and
10
10
  | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------------------------------------------ |
11
11
  | Query traces | List matching traces, paginate through them, and poll for new ones. | `queryTraces()` | `POST /api/observability/traces/query` |
12
12
  | Aggregate traces | Count matching traces and compute measures, such as error rate, latency percentiles, tokens, and cost, optionally grouped by dimensions and time buckets. | `aggregateTraces()` | `POST /api/observability/traces/aggregate` |
13
+ | Aggregate spans | Compute the same measures over individual spans, such as every agent run including nested ones, grouped by span dimensions. | `aggregateSpans()` | `POST /api/observability/spans/aggregate` |
13
14
 
14
- Both APIs accept the same [trace selection](#select-traces). The filters, operators, and limits on this page apply to each. Use the aggregate API to find the group that needs attention, such as an agent with a high error rate, then send the same predicate plus the group's dimensions to the query API to list the traces behind it. Each query result represents a trace. Use its `traceId` to [retrieve the full trace](https://mastra.ai/reference/client-js/observability).
15
+ The trace APIs accept the same [trace selection](#select-traces). The filters, operators, and limits on this page apply to each. Use the aggregate API to find the group that needs attention, such as an agent with a high error rate, then send the same predicate plus the group's dimensions to the query API to list the traces behind it. Each query result represents a trace. Use its `traceId` to [retrieve the full trace](https://mastra.ai/reference/client-js/observability).
15
16
 
16
17
  The endpoints use the same authentication as other observability routes and require the `observability:read` permission. Every request requires a time range.
17
18
 
@@ -25,6 +26,7 @@ The configured observability store must support each API. Call `getObservability
25
26
  | -------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------- |
26
27
  | `traceQuery` | `trace-query` | `queryTraces()` |
27
28
  | `traceAggregate` | `trace-aggregate` | `aggregateTraces()` |
29
+ | `spanAggregate` | `span-aggregate` | `aggregateSpans()` |
28
30
  | `traceQueryRootDuration` | `trace-query-root-duration` | Trace-scope `durationMs` predicates |
29
31
  | `traceQueryTimeToFirstChunk` | `trace-query-time-to-first-chunk` | `timeToFirstChunkMs` predicates and results |
30
32
  | `traceQueryTimeToFirstChunkSort` | `trace-query-time-to-first-chunk-sort` | `orderBy` on `timeToFirstChunkMs` |
@@ -34,7 +36,7 @@ The configured observability store must support each API. Call `getObservability
34
36
  | `traceQueryDiscovery` | `trace-query-discovery` | [Field and value discovery](#discover-fields-and-values) |
35
37
  | `traceQueryTenantScope` | `trace-query-tenant-scope` | [Trusted tenant scope](#trusted-tenant-scope) |
36
38
 
37
- A missing `traceAggregate` value means the server doesn't support aggregation. Servers without the aggregate route return `404`, and stores without the feature return `501 TRACE_AGGREGATE_UNSUPPORTED`. Against a store without a sub-feature, a request that uses a gated field returns `501` before storage runs. Root span `name`, `spanType`, and `entityId` are the exception and return `422` with a `field_not_allowed` issue.
39
+ A missing `traceAggregate` value means the server doesn't support aggregation. Servers without the aggregate route return `404`, and stores without the feature return `501 TRACE_AGGREGATE_UNSUPPORTED`. A missing `spanAggregate` value means the same for span aggregation, and stores without the feature return `501 SPAN_AGGREGATE_UNSUPPORTED`. Against a store without a sub-feature, a request that uses a gated field returns `501` before storage runs. Root span `name`, `spanType`, and `entityId` are the exception and return `422` with a `field_not_allowed` issue.
38
40
 
39
41
  ## Select traces
40
42
 
@@ -212,7 +214,7 @@ const selectedModel = {
212
214
  {
213
215
  op: 'eq',
214
216
  left: { path: 'model' },
215
- right: { literal: 'claude-sonnet-4-6' },
217
+ right: { literal: 'claude-sonnet-5-5' },
216
218
  },
217
219
  { op: 'eq', left: { path: 'provider' }, right: { literal: 'anthropic' } },
218
220
  ],
@@ -700,14 +702,14 @@ Token and cost measures read the model usage metrics recorded for each trace, so
700
702
 
701
703
  A trace that recorded at least one usage metric is usage-bearing. `tokens.<kind>.sum` adds the tokens of a group's usage-bearing traces, and `tokens.<kind>.avg` divides that sum by the number of usage-bearing traces, not by `count`. Both are `null` when the group has no usage-bearing traces.
702
704
 
703
- Cost comes from estimated cost recorded on total input and total output token metrics. `cost.sum` adds the cost of traces with at least one priced metric, and `cost.avg` divides by the number of those traces. A metric whose pricing failed, including a partial cost, isn't priced.
705
+ Cost comes from estimated cost recorded on total input and total output token metrics. `cost.sum` adds the cost of traces with at least one priced metric, and `cost.avg` divides by the number of those traces. A partly priced call, where Mastra could price some token types but not others, adds the cost of the priced token types. A metric with any other pricing failure adds no cost.
704
706
 
705
707
  When you request any `cost.*` measure, every row also includes a `cost` object:
706
708
 
707
- | Field | Description |
708
- | ---------- | ------------------------------------------------------------------------------------------------------------------------------ |
709
- | `coverage` | Fraction of usage-bearing traces whose usage was fully priced, from 0 to 1. `null` when the group has no usage-bearing traces. |
710
- | `unit` | Cost unit of the priced metrics, such as `USD`. `'mixed'` when they use more than one unit, and `null` when none are priced. |
709
+ | Field | Description |
710
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
711
+ | `coverage` | Fraction of usage-bearing traces whose usage was fully priced, from 0 to 1. A trace with a partly priced call isn't fully priced, so it lowers coverage even though its known cost is in `cost.sum`. `null` when the group has no usage-bearing traces. |
712
+ | `unit` | Cost unit of the priced metrics, such as `USD`. `'mixed'` when they use more than one unit, and `null` when none are priced. |
711
713
 
712
714
  `cost.sum` and `cost.avg` are `null` when the group has no priced traces or `unit` is `'mixed'`. A coverage below 1 means the cost understates the group's spend. The `cost` object isn't a measure, so `having` and `orderBy` can't reference it.
713
715
 
@@ -803,11 +805,90 @@ PostgreSQL and ClickHouse stop aggregations after the same `traceQueryTimeoutMs`
803
805
  | `501` | The installed Core or configured observability store doesn't support aggregation or a requested field. Returns `TRACE_AGGREGATE_UNSUPPORTED`. |
804
806
  | `504` | A PostgreSQL or ClickHouse aggregation exceeded its execution timeout. Returns `TRACE_QUERY_EXECUTION_TIMEOUT` without partial results. |
805
807
 
808
+ ## Aggregate spans
809
+
810
+ Use `aggregateSpans()` or `POST /api/observability/spans/aggregate` to compute measures over individual spans instead of traces. Trace aggregation only sees each trace's root span, so an agent run nested inside a workflow isn't counted. Span aggregation counts every span that matches, at any depth.
811
+
812
+ The request has the same shape as [`aggregateTraces()`](#aggregate-request-fields), with the same measures, `having`, `orderBy`, `interval`, limits, and errors. The differences are in which records are selected and which dimensions are available.
813
+
814
+ ### Aggregate spans with the client SDK
815
+
816
+ This request counts agent runs by status per day, including nested runs:
817
+
818
+ ```typescript
819
+ const { capabilities } = await mastraClient.getObservabilityCapabilities()
820
+
821
+ if (capabilities.spanAggregate) {
822
+ const { rows } = await mastraClient.aggregateSpans({
823
+ timeRange: {
824
+ from: '2026-08-01T00:00:00.000Z',
825
+ to: '2026-08-08T00:00:00.000Z',
826
+ },
827
+ where: { op: 'eq', left: { path: 'spanType' }, right: { literal: 'agent_run' } },
828
+ groupBy: ['status'],
829
+ interval: '1d',
830
+ measures: ['count', 'duration.p95'],
831
+ })
832
+ }
833
+ ```
834
+
835
+ Send the same body to `POST /api/observability/spans/aggregate` to use HTTP directly.
836
+
837
+ ### Span selection
838
+
839
+ Aggregation selects the spans that [`querySpans()`](https://mastra.ai/reference/client-js/observability) would return for the same `timeRange` and `where`:
840
+
841
+ - `timeRange` bounds each span's `startedAt`, and can span up to 365 days.
842
+ - `where` accepts the `querySpans()` fields and operators, such as `spanType`, `name`, `status`, `durationMs`, entity and parent/root entity fields, and context identifiers.
843
+ - Only completed spans count. When a span was exported more than once, only its latest copy counts.
844
+
845
+ `count` equals the number of spans `querySpans()` pages through for the same request. Buckets use each span's `startedAt`. `duration.*` measures read the span's own duration, and `errorCount` and `errorRate` read whether the span itself recorded an error.
846
+
847
+ On ClickHouse, a request whose `where` limits `spanType` to agent, workflow, processor, or scorer runs, RAG ingestion, or tool calls reads the smaller branch table instead of every span. That path can differ from `querySpans()`:
848
+
849
+ - Spans written before an upgrade from `@mastra/clickhouse` 1.4, 1.5, or 1.6 aren't in the branch table, so older windows can count fewer spans.
850
+ - After ClickHouse merges the copies of a span exported more than once, the branch table keeps the copy written last, not the one that ended last. Counts don't change, but the `status` and duration of a retried span can.
851
+
852
+ ### Span dimensions
853
+
854
+ | Dimension | Notes |
855
+ | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
856
+ | `name`, `spanType`, `status` | The span's own name, type, and status. `status` is `error` when the span recorded an error and `success` otherwise. |
857
+ | `entityType`, `entityId`, `entityName` | The entity that produced the span. |
858
+ | `parentEntityType`, `parentEntityName`, `rootEntityType`, `rootEntityName` | The calling entity and the trace's root entity, such as the agent that made a model call. |
859
+ | `environment`, `serviceName`, `executionSource` | Deployment attributes recorded on the span. |
860
+ | `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the span. |
861
+
862
+ `countDistinct.<field>` accepts these dimensions and `traceId`, so `countDistinct.traceId` counts the traces the selected spans belong to. Span aggregation can't group by `metadata.<key>`, identity fields such as `traceId`, `spanId`, or `runId`, or by model and provider.
863
+
864
+ ### Span tokens and cost
865
+
866
+ Token and cost measures use the usage metrics recorded by each span, matched by `traceId` and `spanId`. The [trace token rules](#token-and-cost-measures) apply per span: metrics from `timeRange.from` on count, retried exports count once, and averages divide by usage-bearing spans.
867
+
868
+ Usage isn't added up to parent spans. Model calls record usage on `model_generation` spans, so an `agent_run` span has no tokens of its own unless a model call under it wasn't exported. When a `model_generation` span isn't exported, its usage is recorded on the nearest exported ancestor instead. For token totals per agent, select `model_generation` spans and group by the calling agent:
869
+
870
+ ```typescript
871
+ const tokensByAgent = await mastraClient.aggregateSpans({
872
+ timeRange: {
873
+ from: '2026-08-01T00:00:00.000Z',
874
+ to: '2026-08-08T00:00:00.000Z',
875
+ },
876
+ where: { op: 'eq', left: { path: 'spanType' }, right: { literal: 'model_generation' } },
877
+ groupBy: ['parentEntityName'],
878
+ measures: ['tokens.total.sum', 'cost.sum'],
879
+ orderBy: { field: 'cost.sum', direction: 'desc' },
880
+ })
881
+ ```
882
+
883
+ ### List the spans behind a group
884
+
885
+ Aggregation never returns span records. To inspect a group, send the same `timeRange` and `where` to `querySpans()`, and add the group's dimension values as `eq` conditions. For example, add `{ op: 'eq', left: { path: 'status' }, right: { literal: 'error' } }` to list the failed agent runs from the first example.
886
+
806
887
  ## Trusted tenant scope
807
888
 
808
- Hosts that serve more than one tenant supply a trusted scope outside the query document. The server reads the reserved `organizationId` request-context key, which only server-side authentication can set, and passes `{ organizationId }` to the planner. The scope is carried on the trusted plan and ANDed into every scan: current roots, related spans, the usage metrics read by token and cost measures, and both discovery routes. A related record from another tenant that shares a `traceId` never qualifies a trace.
889
+ Hosts that serve more than one tenant supply a trusted scope outside the query document. The server reads the reserved `organizationId` request-context key, which only server-side authentication can set, and passes `{ organizationId }` to the planner. The scope is carried on the trusted plan and ANDed into every scan: current roots, related spans, the usage metrics read by token and cost measures, span aggregation, and both discovery routes. A related record from another tenant that shares a `traceId` never qualifies a trace.
809
890
 
810
- Hosts that call storage directly can pass a fuller scope to `planTraceQuery()`, `planTraceAggregate()`, `planTraceQueryObservedFields()`, and `planTraceQueryValues()`:
891
+ Hosts that call storage directly can pass a fuller scope to `planTraceQuery()`, `planTraceAggregate()`, `planSpanAggregate()`, `planTraceQueryObservedFields()`, and `planTraceQueryValues()`:
811
892
 
812
893
  ```typescript
813
894
  const plan = planTraceQuery(parseTraceQueryRequest(request), {
@@ -938,7 +1019,7 @@ Both routes require `observability:read` and use the configured observability st
938
1019
 
939
1020
  ## Limitations
940
1021
 
941
- Both APIs consider completed traces only and don't include running traces. Trace queries can't return custom projections, embedded evidence, or summaries, and numbered trace pages include a total count. Aggregation can't group by span fields, `traceId`, or `attributes.*`, compute numeric measures over metadata, paginate groups, or zero-fill empty buckets. The CLI doesn't expose a trace aggregation command, so use the SDK or the HTTP endpoint.
1022
+ The query and aggregate APIs consider completed traces and spans only, not running ones. Trace queries can't return custom projections, embedded evidence, or summaries, and numbered trace pages include a total count. Trace aggregation can't group by span fields other than the root span's `name`, `spanType`, and `entityId`, or by `traceId` or `attributes.*`. Aggregation can't compute numeric measures over metadata, paginate groups, or zero-fill empty buckets. Span aggregation can't group by `model` or `provider`, and it attributes tokens only to the span that recorded them. The CLI's `mastra api trace aggregate` covers trace aggregation, and `mastra api span query` and `mastra api span aggregate` cover span queries and span aggregation.
942
1023
 
943
1024
  ## Related
944
1025
 
@@ -56,7 +56,7 @@ If no `LoggerProvider` is registered globally, emission is a silent no-op.
56
56
  async flush(): Promise<void>
57
57
  ```
58
58
 
59
- Force flushes the tracer provider and logger provider if they support `forceFlush`. The global providers are resolved at flush time, so a `LoggerProvider` registered after the bridge was constructed is flushed too. Useful in serverless environments where you need to drain telemetry before the runtime terminates. Your OTEL SDK may still hold a batch it has already started exporting; call `sdk.shutdown()` as well before the process exits; the provider's own `forceFlush()` doesn't wait for that batch either.
59
+ Force flushes the tracer provider and logger provider if they support `forceFlush`. The global providers are resolved at flush time, so a `LoggerProvider` registered after the bridge was constructed is flushed too. Useful in serverless environments where you need to drain telemetry before the runtime terminates. Call `sdk.shutdown()` as well before the process exits to wait for any batch your OTEL SDK has already started exporting. Neither this method nor the provider's own `forceFlush()` waits for that batch.
60
60
 
61
61
  ### `shutdown`
62
62
 
@@ -111,7 +111,7 @@ const agent = new Agent({
111
111
  id: 'support-agent',
112
112
  name: 'support-agent',
113
113
  instructions: prompt.compile(),
114
- model: 'openai/gpt-5.6-sol',
114
+ model: 'openai/gpt-6.1-sol',
115
115
  defaultGenerateOptions: {
116
116
  tracingOptions: buildTracingOptions(
117
117
  withLangfusePrompt({ name: prompt.name, version: prompt.version }),
@@ -733,6 +733,8 @@ interface ToolCallAttributes {
733
733
  toolDescription?: string
734
734
  toolCallId?: string
735
735
  success?: boolean
736
+ /** True when a dataset experiment tool mock intercepted the call (served, mismatched, exhausted or denied) and the tool never ran */
737
+ mocked?: boolean
736
738
  }
737
739
  ```
738
740
 
@@ -48,7 +48,7 @@ export const agent = new Agent({
48
48
  id: 'batched-agent',
49
49
  name: 'batched-agent',
50
50
  instructions: 'You are a helpful assistant',
51
- model: 'openai/gpt-5.6-sol',
51
+ model: 'openai/gpt-6.1-sol',
52
52
  outputProcessors: [
53
53
  new BatchPartsProcessor({
54
54
  batchSize: 5,
@@ -117,7 +117,7 @@ export const agent = new Agent({
117
117
  id: 'support-agent',
118
118
  name: 'support-agent',
119
119
  instructions: 'You help customers with billing and account questions.',
120
- model: 'openai/gpt-5.6-sol',
120
+ model: 'openai/gpt-6.1-sol',
121
121
  inputProcessors: [
122
122
  new ClassifierProcessor({
123
123
  classifier: topic,
@@ -156,7 +156,7 @@ export const agent = new Agent({
156
156
  id: 'quality-gated-agent',
157
157
  name: 'quality-gated-agent',
158
158
  instructions: 'You are a helpful assistant',
159
- model: 'openai/gpt-5.6-sol',
159
+ model: 'openai/gpt-6.1-sol',
160
160
  outputProcessors: [
161
161
  new ClassifierProcessor({
162
162
  classifier: quality,
@@ -41,7 +41,7 @@ export const agent = new Agent({
41
41
  id: 'coding-agent',
42
42
  name: 'Coding Agent',
43
43
  instructions: 'You are a coding agent.',
44
- model: 'openai/gpt-5.6-sol',
44
+ model: 'openai/gpt-6.1-sol',
45
45
  errorProcessors: [new CyberRefusalHandler(), new StreamErrorRetryProcessor()],
46
46
  outputProcessors: [new CyberRefusalHandler()],
47
47
  maxProcessorRetries: 3,
@@ -27,7 +27,7 @@ export const agent = new Agent({
27
27
  id: 'file-agent',
28
28
  name: 'file-agent',
29
29
  instructions: 'Work on the files the user uploads to the sandbox.',
30
- model: 'openai/gpt-5-nano',
30
+ model: 'openai/gpt-6-luna',
31
31
  workspace,
32
32
  inputProcessors: [
33
33
  new FileUploadProcessor({
@@ -121,7 +121,7 @@ The processor looks at the files of every user message the model receives, the t
121
121
  Files sent inline, as binary, base64, or a data URL, are uploaded. The processor never downloads anything itself, so a request made by the server can't be pointed at an internal address:
122
122
 
123
123
  - A link the model fetches itself, or a provider file ID, stays in the prompt, and `filter` isn't called for it.
124
- - A link the model can't fetch is downloaded by Mastra before the model call. The model would receive those bytes, so the processor handles them like any other file.
124
+ - A link the model can't fetch is downloaded by Mastra before the model call. The processor handles the downloaded bytes like any other file the model would receive.
125
125
 
126
126
  ## Upload location
127
127
 
@@ -170,7 +170,7 @@ The constructor throws a `MastraError` with the ID `FILE_UPLOAD_PROCESSOR_NO_SAN
170
170
 
171
171
  The files of the current turn are checked as they were sent, before anything is written. A file that can't be uploaded stops the turn, and nothing is uploaded.
172
172
 
173
- A file of the thread history that is too large or can't be decoded doesn't stop the turn: a file stored in the thread would stop every turn after it. The processor replaces it with a note that says why, and the turn goes on:
173
+ For a file in thread history that's too large or can't be decoded, the processor substitutes a note explaining the problem and lets the turn continue. This prevents a stored file from blocking every subsequent turn:
174
174
 
175
175
  ```text
176
176
  [File not uploaded]
@@ -178,7 +178,7 @@ name: report.pdf
178
178
  reason: File "report.pdf" is 31457280 bytes, over the 10485760 byte limit.
179
179
  ```
180
180
 
181
- When the sandbox can't take the files, because there is no sandbox, it can't write, or a write fails, a file of the current turn stops the turn. A file of the thread history gets a note with the reason instead, and the turn goes on. A `filter` or `maxFileSize` that fails stops the turn, whichever file it affects. Nothing is changed in storage, so the thread works again once the setup is fixed. A turn without a file to upload checks nothing, so scorers, agent networks, and calls without a thread keep working.
181
+ When the sandbox can't take the files, because there is no sandbox, it can't write, or a write fails, a file of the current turn stops the turn. A file of the thread history gets a note with the reason instead, and the turn goes on. A `filter` or `maxFileSize` that fails stops the turn, whichever file it affects. Storage remains unchanged, allowing the thread to work again once the setup is fixed. A turn without a file to upload checks nothing, so scorers, agent networks, and calls without a thread keep working.
182
182
 
183
183
  The processor stops a turn by calling `abort()` with `retry: false`. The model isn't called. `agent.generate()` resolves with `result.tripwire` set instead of rejecting, and `agent.stream()` emits a `tripwire` chunk.
184
184
 
@@ -220,7 +220,7 @@ The processor handles files sent with `agent.sendMessage()` and `agent.sendSigna
220
220
 
221
221
  - A signal that wakes an idle agent is processed like the input of `agent.stream()`.
222
222
  - A signal delivered to an active run is checked and uploaded before the next model call of that run.
223
- - On a durable agent, a signal that arrives before the first model call of a run joins the prompt after the checks of the turn. Its files are uploaded like files of the thread history.
223
+ - Signals that arrive on a durable agent before a run's first model call join the prompt after the turn's checks. Their files are uploaded like files in thread history.
224
224
 
225
225
  ## Limitations
226
226
 
@@ -66,7 +66,7 @@ export const agent = new Agent({
66
66
  id: 'multilingual-agent',
67
67
  name: 'multilingual-agent',
68
68
  instructions: 'You are a helpful assistant',
69
- model: 'openai/gpt-5.6-sol',
69
+ model: 'openai/gpt-6.1-sol',
70
70
  inputProcessors: [
71
71
  new LanguageDetector({
72
72
  model: 'openrouter/openai/gpt-oss-safeguard-20b',
@@ -23,7 +23,7 @@ const processor = new MessageHistory({
23
23
 
24
24
  **options.storage** (`MemoryStorage`): Storage instance for retrieving and persisting messages
25
25
 
26
- **options.lastMessages** (`number`): Maximum number of historical messages to retrieve. If not specified, retrieves all messages
26
+ **options.lastMessages** (`number | false`): Maximum number of historical messages to retrieve. Set to false to retrieve all messages. If omitted, the storage adapter's default page size applies (40 messages for built-in adapters)
27
27
 
28
28
  ## Returns
29
29
 
@@ -51,7 +51,7 @@ export const agent = new Agent({
51
51
  id: 'memory-agent',
52
52
  name: 'memory-agent',
53
53
  instructions: 'You are a helpful assistant with conversation memory',
54
- model: 'openai/gpt-5.6-sol',
54
+ model: 'openai/gpt-6.1-sol',
55
55
  inputProcessors: [
56
56
  new MessageHistory({
57
57
  storage,