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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/.docs/docs/agents/code-mode.md +2 -2
  2. package/.docs/docs/agents/guardrails.md +5 -2
  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 +8 -7
  6. package/.docs/docs/agents/processors.md +72 -21
  7. package/.docs/docs/agents/structured-output.md +6 -6
  8. package/.docs/docs/agents/tools.md +10 -10
  9. package/.docs/docs/auth/composite-auth.md +4 -2
  10. package/.docs/docs/auth/custom-auth-provider.md +1 -1
  11. package/.docs/docs/auth/overview.md +3 -1
  12. package/.docs/docs/browser.md +13 -1
  13. package/.docs/docs/channels.md +33 -6
  14. package/.docs/docs/connections/a2a.md +1 -1
  15. package/.docs/docs/connections/acp.md +2 -2
  16. package/.docs/docs/connections/mcp.md +159 -50
  17. package/.docs/docs/connections/overview.md +1 -1
  18. package/.docs/docs/connections/sdk-agents.md +26 -15
  19. package/.docs/docs/develop.md +1 -1
  20. package/.docs/docs/evals/custom-scorers.md +5 -5
  21. package/.docs/docs/evals/experiments.md +29 -4
  22. package/.docs/docs/evals/multi-turn.md +2 -2
  23. package/.docs/docs/evals/overview.md +4 -4
  24. package/.docs/docs/evals/quick-checks.md +2 -2
  25. package/.docs/docs/guides/build-an-eval-loop.md +3 -3
  26. package/.docs/docs/guides/context-engineering.md +13 -6
  27. package/.docs/docs/guides/mcp-authentication-authorization.md +4 -4
  28. package/.docs/docs/guides/streaming.md +1 -1
  29. package/.docs/docs/harness/agent-controller.md +18 -21
  30. package/.docs/docs/harness/background-tasks.md +14 -3
  31. package/.docs/docs/harness/durable-agents.md +15 -9
  32. package/.docs/docs/harness/goals.md +5 -5
  33. package/.docs/docs/harness/overview.md +2 -2
  34. package/.docs/docs/harness/schedules.md +13 -11
  35. package/.docs/docs/index.md +7 -6
  36. package/.docs/docs/mastra-platform/connect/channels.md +1 -1
  37. package/.docs/docs/mastra-platform/connect/tools.md +4 -4
  38. package/.docs/docs/mastra-platform/environments.md +1 -1
  39. package/.docs/docs/mastra-platform/observability.md +1 -1
  40. package/.docs/docs/mastra-platform/server.md +1 -1
  41. package/.docs/docs/mastra-platform/studio.md +1 -1
  42. package/.docs/docs/memory/memory-processors.md +21 -15
  43. package/.docs/docs/memory/message-history.md +5 -5
  44. package/.docs/docs/memory/multi-user-threads.md +1 -1
  45. package/.docs/docs/memory/observational-memory.md +14 -14
  46. package/.docs/docs/memory/semantic-recall.md +22 -2
  47. package/.docs/docs/memory/working-memory.md +3 -3
  48. package/.docs/docs/observability/logging.md +5 -5
  49. package/.docs/docs/observability/tracing/overview.md +1 -0
  50. package/.docs/docs/sandbox/filesystem.md +26 -11
  51. package/.docs/docs/sandbox/overview.md +1 -1
  52. package/.docs/docs/server/mastra-client.md +1 -1
  53. package/.docs/docs/server/middleware.md +1 -1
  54. package/.docs/docs/server/overview.md +27 -0
  55. package/.docs/docs/server/request-context.md +3 -3
  56. package/.docs/docs/server/server-adapters.md +12 -204
  57. package/.docs/docs/signals/notifications.md +233 -0
  58. package/.docs/docs/signals/overview.md +94 -0
  59. package/.docs/docs/signals/running-across-processes.md +132 -0
  60. package/.docs/docs/signals/sending-signals.md +166 -0
  61. package/.docs/docs/signals/signal-providers.md +278 -0
  62. package/.docs/docs/signals/state-signals.md +103 -0
  63. package/.docs/docs/signals/thread-streams.md +94 -0
  64. package/.docs/docs/skills.md +4 -4
  65. package/.docs/docs/storage.md +1 -1
  66. package/.docs/docs/studio/auth.md +2 -2
  67. package/.docs/docs/studio/editor.md +39 -23
  68. package/.docs/docs/studio/observability.md +5 -1
  69. package/.docs/docs/subagents.md +6 -6
  70. package/.docs/docs/workflows/control-flow.md +14 -14
  71. package/.docs/docs/workflows/error-handling.md +1 -1
  72. package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
  73. package/.docs/integrations/agentic-ui/copilotkit.md +1 -1
  74. package/.docs/integrations/agentic-ui/openui.md +1 -1
  75. package/.docs/integrations/browsers/agent-browser.md +1 -1
  76. package/.docs/integrations/browsers/browser-viewer.md +1 -1
  77. package/.docs/integrations/browsers/firecrawl.md +1 -1
  78. package/.docs/integrations/browsers/stagehand.md +6 -6
  79. package/.docs/integrations/channels/discord.md +1 -1
  80. package/.docs/integrations/channels/github.md +2 -2
  81. package/.docs/integrations/channels/imessage.md +2 -50
  82. package/.docs/integrations/channels/slack.md +1 -1
  83. package/.docs/integrations/channels/teams.md +1 -1
  84. package/.docs/integrations/channels/telegram.md +1 -1
  85. package/.docs/integrations/channels/whatsapp.md +1 -1
  86. package/.docs/integrations/databases/aurora-dsql.md +1 -1
  87. package/.docs/integrations/databases/cloudflare-kv.md +4 -0
  88. package/.docs/integrations/databases/elasticsearch.md +1 -1
  89. package/.docs/integrations/databases/mongodb.md +1 -1
  90. package/.docs/integrations/databases/oracledb.md +1 -1
  91. package/.docs/integrations/databases/postgresql.md +1 -1
  92. package/.docs/integrations/databases/redis.md +1 -1
  93. package/.docs/integrations/databases/upstash.md +1 -1
  94. package/.docs/integrations/deploy/aws-bedrock-agentcore.md +1 -0
  95. package/.docs/integrations/deploy/kubernetes.md +1 -1
  96. package/.docs/integrations/deploy/neon.md +2 -1
  97. package/.docs/integrations/deploy/render.md +2 -2
  98. package/.docs/integrations/file-storage/agentfs.md +1 -1
  99. package/.docs/integrations/file-storage/amazon-s3.md +20 -3
  100. package/.docs/integrations/file-storage/archil.md +1 -1
  101. package/.docs/integrations/file-storage/azure-blob.md +1 -1
  102. package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
  103. package/.docs/integrations/file-storage/google-drive.md +1 -1
  104. package/.docs/integrations/file-storage/mesa.md +1 -1
  105. package/.docs/integrations/file-storage/neon.md +210 -0
  106. package/.docs/integrations/file-storage/vercel-files.md +5 -1
  107. package/.docs/integrations/frameworks/express.md +0 -64
  108. package/.docs/integrations/observability/langfuse.md +1 -1
  109. package/.docs/integrations/observability/langsmith.md +2 -2
  110. package/.docs/integrations/observability/opentelemetry.md +5 -5
  111. package/.docs/integrations/sandboxes/apple-container.md +1 -1
  112. package/.docs/integrations/sandboxes/blaxel.md +1 -1
  113. package/.docs/integrations/sandboxes/daytona.md +1 -1
  114. package/.docs/integrations/sandboxes/docker.md +1 -1
  115. package/.docs/integrations/sandboxes/e2b-desktop.md +1 -1
  116. package/.docs/integrations/sandboxes/e2b.md +6 -2
  117. package/.docs/integrations/sandboxes/modal.md +1 -1
  118. package/.docs/integrations/sandboxes/railway.md +1 -1
  119. package/.docs/integrations/sandboxes/sprites.md +1 -1
  120. package/.docs/integrations/sandboxes/vercel.md +2 -2
  121. package/.docs/integrations/tools/brightdata.md +1 -1
  122. package/.docs/integrations/tools/firecrawl.md +1 -1
  123. package/.docs/integrations/tools/parallel.md +1 -1
  124. package/.docs/integrations/tools/perplexity.md +1 -1
  125. package/.docs/integrations/tools/tavily.md +1 -1
  126. package/.docs/integrations/voice/livekit.md +2 -2
  127. package/.docs/integrations.md +1 -0
  128. package/.docs/models/embeddings.md +2 -1
  129. package/.docs/models/environment-variables.md +1 -3
  130. package/.docs/models/gateways/custom-gateways.md +3 -3
  131. package/.docs/models/gateways/merge-gateway.md +7 -13
  132. package/.docs/models/gateways/netlify.md +2 -1
  133. package/.docs/models/gateways/openrouter.md +3 -2
  134. package/.docs/models/gateways/vercel.md +8 -5
  135. package/.docs/models/index.md +14 -16
  136. package/.docs/models/providers/302ai.md +3 -3
  137. package/.docs/models/providers/abacus.md +70 -110
  138. package/.docs/models/providers/aimlapi.md +171 -171
  139. package/.docs/models/providers/aixy.md +3 -1
  140. package/.docs/models/providers/aki-io.md +5 -6
  141. package/.docs/models/providers/alibaba-cn.md +9 -57
  142. package/.docs/models/providers/alibaba-coding-plan-cn.md +8 -12
  143. package/.docs/models/providers/alibaba-coding-plan.md +8 -12
  144. package/.docs/models/providers/alibaba-token-plan-cn.md +0 -2
  145. package/.docs/models/providers/alibaba-token-plan.md +29 -30
  146. package/.docs/models/providers/alibaba.md +33 -62
  147. package/.docs/models/providers/ambient.md +1 -9
  148. package/.docs/models/providers/amd.md +13 -9
  149. package/.docs/models/providers/anthropic.md +4 -2
  150. package/.docs/models/providers/arcee.md +6 -4
  151. package/.docs/models/providers/auriko.md +2 -2
  152. package/.docs/models/providers/baseten.md +4 -14
  153. package/.docs/models/providers/berget.md +3 -4
  154. package/.docs/models/providers/bothub.md +4 -4
  155. package/.docs/models/providers/boundless.md +0 -4
  156. package/.docs/models/providers/cline-pass.md +2 -8
  157. package/.docs/models/providers/cloudflare-workers-ai.md +1 -1
  158. package/.docs/models/providers/commandcode.md +0 -1
  159. package/.docs/models/providers/coralbricks.md +1 -1
  160. package/.docs/models/providers/cortecs.md +1 -1
  161. package/.docs/models/providers/crossmodel.md +69 -73
  162. package/.docs/models/providers/crusoe.md +1 -7
  163. package/.docs/models/providers/daoxe.md +1 -1
  164. package/.docs/models/providers/databricks.md +5 -10
  165. package/.docs/models/providers/deepinfra.md +2 -2
  166. package/.docs/models/providers/digitalocean.md +8 -24
  167. package/.docs/models/providers/dinference.md +0 -3
  168. package/.docs/models/providers/edenai.md +29 -5
  169. package/.docs/models/providers/empiriolabs.md +1 -8
  170. package/.docs/models/providers/engy.md +2 -2
  171. package/.docs/models/providers/evroc.md +2 -2
  172. package/.docs/models/providers/fastrouter.md +41 -50
  173. package/.docs/models/providers/fireworks-ai.md +6 -5
  174. package/.docs/models/providers/friendli.md +4 -5
  175. package/.docs/models/providers/frogbot.md +2 -7
  176. package/.docs/models/providers/google.md +5 -5
  177. package/.docs/models/providers/greenpt.md +14 -20
  178. package/.docs/models/providers/groq.md +3 -8
  179. package/.docs/models/providers/huggingface.md +5 -6
  180. package/.docs/models/providers/iflowcn.md +2 -18
  181. package/.docs/models/providers/impossibl.md +2 -9
  182. package/.docs/models/providers/inception.md +3 -2
  183. package/.docs/models/providers/inceptron.md +8 -6
  184. package/.docs/models/providers/inco.md +1 -1
  185. package/.docs/models/providers/inference.md +5 -11
  186. package/.docs/models/providers/infomaniak.md +10 -12
  187. package/.docs/models/providers/io-net.md +11 -17
  188. package/.docs/models/providers/iteracompute.md +5 -5
  189. package/.docs/models/providers/jalapeno.md +14 -19
  190. package/.docs/models/providers/jiekou.md +53 -63
  191. package/.docs/models/providers/kenari.md +35 -54
  192. package/.docs/models/providers/kilo.md +19 -33
  193. package/.docs/models/providers/lilac.md +2 -8
  194. package/.docs/models/providers/liquid.md +77 -0
  195. package/.docs/models/providers/llama.md +2 -11
  196. package/.docs/models/providers/llmgateway-providers.md +10 -27
  197. package/.docs/models/providers/llmgateway.md +12 -21
  198. package/.docs/models/providers/llmtr.md +1 -6
  199. package/.docs/models/providers/longcat.md +6 -5
  200. package/.docs/models/providers/lowrouter.md +1 -1
  201. package/.docs/models/providers/lucidquery.md +2 -2
  202. package/.docs/models/providers/meganova.md +6 -7
  203. package/.docs/models/providers/melious.md +11 -15
  204. package/.docs/models/providers/minimax-cn-coding-plan.md +4 -11
  205. package/.docs/models/providers/minimax-cn.md +4 -10
  206. package/.docs/models/providers/minimax-coding-plan.md +4 -11
  207. package/.docs/models/providers/minimax.md +4 -10
  208. package/.docs/models/providers/mistral.md +7 -6
  209. package/.docs/models/providers/moark.md +0 -2
  210. package/.docs/models/providers/modal.md +11 -7
  211. package/.docs/models/providers/moonshotai-cn.md +2 -2
  212. package/.docs/models/providers/nan.md +1 -1
  213. package/.docs/models/providers/nano-gpt.md +28 -31
  214. package/.docs/models/providers/nearai.md +3 -2
  215. package/.docs/models/providers/neuralwatt.md +1 -4
  216. package/.docs/models/providers/novita-ai.md +2 -1
  217. package/.docs/models/providers/nvidia.md +15 -35
  218. package/.docs/models/providers/oci.md +0 -1
  219. package/.docs/models/providers/ofox.md +149 -157
  220. package/.docs/models/providers/ollama-cloud.md +7 -12
  221. package/.docs/models/providers/openai.md +4 -2
  222. package/.docs/models/providers/opencode-go.md +2 -3
  223. package/.docs/models/providers/opencode.md +85 -87
  224. package/.docs/models/providers/opper.md +1 -4
  225. package/.docs/models/providers/orcarouter.md +14 -16
  226. package/.docs/models/providers/pareto.md +1 -1
  227. package/.docs/models/providers/perplexity-agent.md +43 -29
  228. package/.docs/models/providers/perplexity.md +2 -8
  229. package/.docs/models/providers/pioneer.md +13 -118
  230. package/.docs/models/providers/poe.md +16 -70
  231. package/.docs/models/providers/prime.md +2 -1
  232. package/.docs/models/providers/qihang-ai.md +7 -11
  233. package/.docs/models/providers/qiniu-ai.md +9 -94
  234. package/.docs/models/providers/regolo-ai.md +5 -7
  235. package/.docs/models/providers/requesty.md +0 -4
  236. package/.docs/models/providers/runinfra.md +3 -5
  237. package/.docs/models/providers/sarvam.md +1 -2
  238. package/.docs/models/providers/scaleway.md +12 -13
  239. package/.docs/models/providers/siliconflow-cn.md +35 -41
  240. package/.docs/models/providers/siliconflow.md +3 -6
  241. package/.docs/models/providers/snowflake-cortex.md +22 -22
  242. package/.docs/models/providers/stackit.md +2 -4
  243. package/.docs/models/providers/stepfun-ai.md +5 -7
  244. package/.docs/models/providers/stepfun.md +8 -10
  245. package/.docs/models/providers/submodel.md +1 -1
  246. package/.docs/models/providers/synthetic.md +2 -5
  247. package/.docs/models/providers/tempr.md +1 -4
  248. package/.docs/models/providers/tencent-coding-plan.md +3 -10
  249. package/.docs/models/providers/tensorx.md +0 -13
  250. package/.docs/models/providers/the-grid-ai.md +2 -1
  251. package/.docs/models/providers/thinkingmachines.md +45 -9
  252. package/.docs/models/providers/togetherai.md +17 -23
  253. package/.docs/models/providers/tokengo.md +1 -1
  254. package/.docs/models/providers/umans-ai-coding-plan.md +12 -11
  255. package/.docs/models/providers/umans-ai.md +11 -10
  256. package/.docs/models/providers/unorouter.md +0 -13
  257. package/.docs/models/providers/vancine.md +0 -1
  258. package/.docs/models/providers/vivgrid.md +3 -3
  259. package/.docs/models/providers/volcengine-coding-plan.md +8 -12
  260. package/.docs/models/providers/volcengine.md +12 -18
  261. package/.docs/models/providers/vultr.md +0 -2
  262. package/.docs/models/providers/wafer.ai.md +3 -7
  263. package/.docs/models/providers/wandb.md +1 -1
  264. package/.docs/models/providers/xai.md +21 -4
  265. package/.docs/models/providers/xiaomi-token-plan-ams.md +4 -5
  266. package/.docs/models/providers/xiaomi-token-plan-cn.md +4 -5
  267. package/.docs/models/providers/xiaomi-token-plan-sgp.md +4 -5
  268. package/.docs/models/providers/xiaomi.md +4 -4
  269. package/.docs/models/providers/xpersona.md +0 -1
  270. package/.docs/models/providers/zai-coding-plan.md +0 -4
  271. package/.docs/models/providers/zenmux.md +105 -125
  272. package/.docs/models/providers/zhipuai-coding-plan.md +0 -1
  273. package/.docs/models/providers/zhipuai.md +12 -12
  274. package/.docs/models/providers.md +1 -3
  275. package/.docs/reference/acp/acp-agent.md +4 -4
  276. package/.docs/reference/acp/create-acp-tool.md +1 -1
  277. package/.docs/reference/agent-controller/agent-controller-class.md +18 -23
  278. package/.docs/reference/agent-controller/session.md +8 -8
  279. package/.docs/reference/agents/agent.md +22 -46
  280. package/.docs/reference/agents/channels.md +17 -9
  281. package/.docs/reference/agents/durable-agent.md +14 -10
  282. package/.docs/reference/agents/generate.md +57 -3
  283. package/.docs/reference/agents/generateLegacy.md +2 -2
  284. package/.docs/reference/agents/getLLM.md +2 -2
  285. package/.docs/reference/agents/getMetadata.md +2 -2
  286. package/.docs/reference/agents/getSkill.md +1 -1
  287. package/.docs/reference/agents/inngest-agent.md +1 -1
  288. package/.docs/reference/agents/listSkills.md +1 -4
  289. package/.docs/reference/agents/network.md +1 -1
  290. package/.docs/reference/browser/agent-browser.md +1 -1
  291. package/.docs/reference/browser/browser-viewer.md +1 -1
  292. package/.docs/reference/browser/firecrawl-browser.md +1 -1
  293. package/.docs/reference/browser/mastra-browser.md +2 -2
  294. package/.docs/reference/browser/stagehand-browser.md +4 -4
  295. package/.docs/reference/channels/slack-provider.md +3 -0
  296. package/.docs/reference/cli/mastra.md +26 -0
  297. package/.docs/reference/client-js/agent-controller.md +14 -4
  298. package/.docs/reference/client-js/agents.md +21 -1
  299. package/.docs/reference/client-js/mastra-client.md +1 -1
  300. package/.docs/reference/client-js/observability.md +29 -4
  301. package/.docs/reference/coding-agent/build-base-prompt.md +1 -1
  302. package/.docs/reference/coding-agent/create-coding-agent.md +8 -8
  303. package/.docs/reference/configuration.md +33 -3
  304. package/.docs/reference/connect/tools.md +2 -2
  305. package/.docs/reference/core/getAgentById.md +1 -1
  306. package/.docs/reference/core/mastra-class.md +2 -2
  307. package/.docs/reference/core/mastra-model-gateway.md +34 -5
  308. package/.docs/reference/datasets/delete.md +6 -0
  309. package/.docs/reference/editor/mastra-editor.md +11 -9
  310. package/.docs/reference/editor/tool-provider.md +2 -2
  311. package/.docs/reference/evals/answer-relevancy.md +1 -1
  312. package/.docs/reference/evals/answer-similarity.md +1 -1
  313. package/.docs/reference/evals/bias.md +1 -1
  314. package/.docs/reference/evals/checks.md +1 -1
  315. package/.docs/reference/evals/context-precision.md +3 -3
  316. package/.docs/reference/evals/context-recall.md +3 -3
  317. package/.docs/reference/evals/context-relevance.md +11 -11
  318. package/.docs/reference/evals/create-classifier-scorer.md +6 -2
  319. package/.docs/reference/evals/faithfulness.md +1 -1
  320. package/.docs/reference/evals/hallucination.md +5 -5
  321. package/.docs/reference/evals/multi-turn-judge.md +2 -2
  322. package/.docs/reference/evals/noise-sensitivity.md +12 -12
  323. package/.docs/reference/evals/not-scorable.md +1 -1
  324. package/.docs/reference/evals/prompt-alignment.md +16 -16
  325. package/.docs/reference/evals/rubric.md +5 -5
  326. package/.docs/reference/evals/summarization.md +4 -4
  327. package/.docs/reference/evals/tool-call-accuracy.md +4 -4
  328. package/.docs/reference/evals/toxicity.md +1 -1
  329. package/.docs/reference/file-based-agents/config.md +3 -3
  330. package/.docs/reference/file-based-agents/instructions.md +1 -1
  331. package/.docs/reference/file-based-agents/processors.md +2 -0
  332. package/.docs/reference/file-based-agents/schedules.md +2 -2
  333. package/.docs/reference/file-based-agents/skills.md +1 -1
  334. package/.docs/reference/file-based-agents/subagents.md +5 -5
  335. package/.docs/reference/file-based-agents/workspace.md +1 -1
  336. package/.docs/reference/index.md +2 -0
  337. package/.docs/reference/manual-install.md +3 -2
  338. package/.docs/reference/memory/cloneThread.md +1 -1
  339. package/.docs/reference/memory/copyThread.md +1 -1
  340. package/.docs/reference/memory/deleteMessages.md +4 -1
  341. package/.docs/reference/memory/memory-class.md +5 -3
  342. package/.docs/reference/memory/observational-memory.md +16 -16
  343. package/.docs/reference/memory/serialized-memory-config.md +1 -1
  344. package/.docs/reference/memory/summarizeConversation.md +3 -3
  345. package/.docs/reference/memory/summarizeThread.md +3 -3
  346. package/.docs/reference/migrations/agentnetwork.md +4 -4
  347. package/.docs/reference/migrations/mcp-v2.md +1 -1
  348. package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
  349. package/.docs/reference/migrations/vnext-to-standard-apis.md +2 -2
  350. package/.docs/reference/observability/tracing/advanced-queries.md +131 -41
  351. package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
  352. package/.docs/reference/observability/tracing/interfaces.md +2 -0
  353. package/.docs/reference/processors/batch-parts-processor.md +1 -1
  354. package/.docs/reference/processors/classifier-processor.md +2 -2
  355. package/.docs/reference/processors/cyber-refusal-handler.md +1 -1
  356. package/.docs/reference/processors/file-upload-processor.md +1 -1
  357. package/.docs/reference/processors/language-detector.md +1 -1
  358. package/.docs/reference/processors/message-history-processor.md +2 -2
  359. package/.docs/reference/processors/model-selection-processor.md +7 -7
  360. package/.docs/reference/processors/moderation-processor.md +2 -2
  361. package/.docs/reference/processors/pii-detector.md +2 -2
  362. package/.docs/reference/processors/prefill-error-handler.md +2 -2
  363. package/.docs/reference/processors/processor-interface.md +76 -12
  364. package/.docs/reference/processors/prompt-injection-detector.md +1 -1
  365. package/.docs/reference/processors/provider-history-compat.md +1 -1
  366. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  367. package/.docs/reference/processors/response-cache.md +1 -1
  368. package/.docs/reference/processors/semantic-recall-processor.md +2 -2
  369. package/.docs/reference/processors/skill-search-processor.md +1 -1
  370. package/.docs/reference/processors/stream-error-retry-processor.md +3 -3
  371. package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
  372. package/.docs/reference/processors/token-cost-control.md +1 -1
  373. package/.docs/reference/processors/token-limiter-processor.md +3 -3
  374. package/.docs/reference/processors/tool-call-filter.md +2 -2
  375. package/.docs/reference/processors/tool-search-processor.md +3 -3
  376. package/.docs/reference/processors/unicode-normalizer.md +1 -1
  377. package/.docs/reference/processors/working-memory-processor.md +2 -2
  378. package/.docs/reference/pubsub/lease-provider.md +2 -2
  379. package/.docs/reference/pubsub/redis-streams.md +1 -1
  380. package/.docs/reference/rag/chunking-and-embedding.md +1 -1
  381. package/.docs/reference/rag/graph-rag-guide.md +2 -2
  382. package/.docs/reference/rag/metadata-filters.md +1 -1
  383. package/.docs/reference/rag/rerank.md +1 -1
  384. package/.docs/reference/rag/retrieval.md +13 -13
  385. package/.docs/reference/server/nestjs-adapter.md +1 -1
  386. package/.docs/reference/server/routes.md +159 -0
  387. package/.docs/reference/signals/create-notification-inbox-tool.md +4 -4
  388. package/.docs/reference/signals/notifications.md +249 -0
  389. package/.docs/reference/signals/signal-provider.md +2 -0
  390. package/.docs/reference/signals/task-signal-provider.md +3 -3
  391. package/.docs/reference/signals/thread-events.md +69 -0
  392. package/.docs/reference/streaming/ChunkType.md +68 -0
  393. package/.docs/reference/streaming/agents/stream.md +3 -3
  394. package/.docs/reference/tools/create-code-mode.md +1 -1
  395. package/.docs/reference/tools/create-tool.md +17 -0
  396. package/.docs/reference/tools/mcp-client.md +430 -3
  397. package/.docs/reference/tools/mcp-server.md +173 -1
  398. package/.docs/reference/tools/task-tools.md +1 -1
  399. package/.docs/reference/tools/vector-query-tool.md +1 -1
  400. package/.docs/reference/vectors/libsql.md +1 -1
  401. package/.docs/reference/vectors/mongodb.md +2 -2
  402. package/.docs/reference/vectors/oracledb.md +2 -2
  403. package/.docs/reference/vectors/pg.md +1 -1
  404. package/.docs/reference/vectors/upstash.md +1 -1
  405. package/.docs/reference/voice/overview.md +24 -24
  406. package/.docs/reference/voice/speech-to-speech.md +6 -6
  407. package/.docs/reference/voice/speech-to-text.md +1 -1
  408. package/.docs/reference/voice/text-to-speech.md +1 -1
  409. package/.docs/reference/voice/voice.addInstructions.md +1 -1
  410. package/.docs/reference/workflows/workflow-methods/branch.md +1 -1
  411. package/.docs/reference/workspace/filesystem.md +17 -17
  412. package/.docs/reference/workspace/local-filesystem.md +52 -27
  413. package/.docs/reference/workspace/local-sandbox.md +1 -1
  414. package/.docs/reference/workspace/platform-filesystem.md +1 -1
  415. package/.docs/reference/workspace/platform-sandbox.md +23 -2
  416. package/.docs/reference/workspace/process-manager.md +13 -2
  417. package/.docs/reference/workspace/sandbox.md +16 -0
  418. package/.docs/reference/workspace/workspace-class.md +13 -12
  419. package/dist/index.js +1 -2
  420. package/dist/{src-Baf8l9Sp.js → src-DnH_jHt9.js} +2 -3
  421. package/dist/{src-Baf8l9Sp.js.map → src-DnH_jHt9.js.map} +1 -1
  422. package/dist/stdio.js +1 -1
  423. package/package.json +9 -9
  424. package/.docs/docs/harness/signal-providers.md +0 -212
  425. package/.docs/docs/harness/signals.md +0 -546
@@ -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
 
@@ -21,18 +22,21 @@ For hosted traces, see [Query observability data on Mastra Platform](https://mas
21
22
 
22
23
  The configured observability store must support each API. Call `getObservabilityCapabilities()` or `GET /api/observability/capabilities` and check these flags before showing a feature:
23
24
 
24
- | Capability | Store feature | Enables |
25
- | ---------------------------- | --------------------------------- | -------------------------------------------------------------------------------------- |
26
- | `traceQuery` | `trace-query` | `queryTraces()` |
27
- | `traceAggregate` | `trace-aggregate` | `aggregateTraces()` |
28
- | `traceQueryRootDuration` | `trace-query-root-duration` | Trace-scope `durationMs` predicates |
29
- | `traceQueryTimeToFirstChunk` | `trace-query-time-to-first-chunk` | `timeToFirstChunkMs` predicates and results |
30
- | `traceQueryContextIds` | `trace-query-context-ids` | `runId`, `sessionId`, `userId`, and `organizationId` predicates |
31
- | `traceQueryRootSpanFields` | `trace-query-root-span-fields` | Trace-scope `name` and `spanType` predicates, dimensions, and `countDistinct` measures |
32
- | `traceQueryDiscovery` | `trace-query-discovery` | [Field and value discovery](#discover-fields-and-values) |
33
- | `traceQueryTenantScope` | `trace-query-tenant-scope` | [Trusted tenant scope](#trusted-tenant-scope) |
34
-
35
- 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` and `spanType` are the exception and return `422` with a `field_not_allowed` issue.
25
+ | Capability | Store feature | Enables |
26
+ | -------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------- |
27
+ | `traceQuery` | `trace-query` | `queryTraces()` |
28
+ | `traceAggregate` | `trace-aggregate` | `aggregateTraces()` |
29
+ | `spanAggregate` | `span-aggregate` | `aggregateSpans()` |
30
+ | `traceQueryRootDuration` | `trace-query-root-duration` | Trace-scope `durationMs` predicates |
31
+ | `traceQueryTimeToFirstChunk` | `trace-query-time-to-first-chunk` | `timeToFirstChunkMs` predicates and results |
32
+ | `traceQueryTimeToFirstChunkSort` | `trace-query-time-to-first-chunk-sort` | `orderBy` on `timeToFirstChunkMs` |
33
+ | `traceQueryContextIds` | `trace-query-context-ids` | `runId`, `sessionId`, `userId`, and `organizationId` predicates |
34
+ | `traceQueryRootSpanFields` | `trace-query-root-span-fields` | Trace-scope `name` and `spanType` predicates, dimensions, and `countDistinct` measures |
35
+ | `traceQueryRootEntityId` | `trace-query-root-entity-id` | Trace-scope `entityId` predicates, dimensions, and `countDistinct` measures |
36
+ | `traceQueryDiscovery` | `trace-query-discovery` | [Field and value discovery](#discover-fields-and-values) |
37
+ | `traceQueryTenantScope` | `trace-query-tenant-scope` | [Trusted tenant scope](#trusted-tenant-scope) |
38
+
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.
36
40
 
37
41
  ## Select traces
38
42
 
@@ -75,7 +79,7 @@ Span clauses examine the current root span and current child spans. The root `ti
75
79
 
76
80
  | Predicate context | Fields | Operators |
77
81
  | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
78
- | Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
82
+ | Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `entityId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
79
83
  | Trace metadata | `metadata.<key>` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
80
84
  | Trace | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
81
85
  | Trace | `tags` | `includes`, `notIncludes`, `exists`, `notExists` |
@@ -84,7 +88,7 @@ Span clauses examine the current root span and current child spans. The root `ti
84
88
  | Span | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
85
89
  | Span | `error` | `exists`, `notExists` |
86
90
 
87
- Trace-scope `name` and `spanType` read the current root span, so `{ op: 'eq', left: { path: 'spanType' }, right: { literal: 'workflow_run' } }` selects traces started by a workflow run. Inside `spans.some` or `spans.none`, the same fields match any span in the trace.
91
+ Trace-scope `name`, `spanType`, and `entityId` read the current root span, so `{ op: 'eq', left: { path: 'spanType' }, right: { literal: 'workflow_run' } }` selects traces started by a workflow run. Inside `spans.some` or `spans.none`, the same fields match any span in the trace.
88
92
 
89
93
  Compose predicates with `{ op: 'and', args: [...] }`, `{ op: 'or', args: [...] }`, and `{ op: 'not', arg: ... }`. Comparison predicates place a field reference on the left and a literal on the right. Membership predicates use a field reference in `value` and a homogeneous literal array in `set`. Tag predicates name the stored tag collection in `path`. `includes` and `notIncludes` also take one tag in `value`, while `exists` and `notExists` take only `op` and `path`. See [Filter by tags](#filter-by-tags). Text predicates use the comparison shape with a string literal. See [Filter by text](#filter-by-text).
90
94
 
@@ -128,7 +132,13 @@ const slowFirstChunk = {
128
132
 
129
133
  The value is `null` when the span didn't stream a chunk, for example a tool call or a workflow run. A `null` value counts as missing, so it matches `notExists` and never matches ordered predicates. A value of `0` isn't missing. It means the first chunk arrived in the same millisecond the span started.
130
134
 
131
- Trace query results include the root span's `timeToFirstChunkMs`, and `querySpans()` results include each span's value. Sorting by this field isn't supported. Stores advertise support through the `trace-query-time-to-first-chunk` feature, and the server reports it as the `traceQueryTimeToFirstChunk` capability. Against an older store, results omit the field, a predicate on it returns `501` before storage runs, and field discovery omits it.
135
+ Trace query results include the root span's `timeToFirstChunkMs`, and `querySpans()` results include each span's value. Stores advertise support through the `trace-query-time-to-first-chunk` feature, and the server reports it as the `traceQueryTimeToFirstChunk` capability. Against an older store, results omit the field, a predicate on it returns `501` before storage runs, and field discovery omits it.
136
+
137
+ #### Sort by time to first chunk
138
+
139
+ Pass `orderBy: [{ field: 'timeToFirstChunkMs', direction: 'desc' }]` to list the slowest first chunks first. Traces sort by the root span's value. Missing values sort last in both directions, and `0` sorts as a value. Ties break by `traceId` for traces and by span identity for `querySpans()`.
140
+
141
+ Stores advertise the sort through the `trace-query-time-to-first-chunk-sort` feature, and the server reports it as the `traceQueryTimeToFirstChunkSort` capability. Against an older store, the sort returns `501` before storage runs.
132
142
 
133
143
  #### Filter by context identifiers
134
144
 
@@ -204,7 +214,7 @@ const selectedModel = {
204
214
  {
205
215
  op: 'eq',
206
216
  left: { path: 'model' },
207
- right: { literal: 'claude-sonnet-4-6' },
217
+ right: { literal: 'claude-sonnet-5-5' },
208
218
  },
209
219
  { op: 'eq', left: { path: 'provider' }, right: { literal: 'anthropic' } },
210
220
  ],
@@ -437,16 +447,16 @@ curl --request POST \
437
447
 
438
448
  ### Request fields
439
449
 
440
- | Field | Required | Description |
441
- | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
442
- | `timeRange` | Yes | Trace start-time boundary. `from` is inclusive and `to` is exclusive. Both values must be ISO timestamps, and `from` must be earlier than `to`. |
443
- | `where` | No | Recursive trace predicate. Supports scalar conditions and `spans.some` or `spans.none` clauses. |
444
- | `orderBy` | No | One item ordering results by `startedAt` or `endedAt`, in `asc` or `desc` order. Defaults to `startedAt desc`. Not accepted in delta mode. |
445
- | `page` | No | `{ limit, after }`. `limit` defaults to 100 and has a maximum of 1000. Pass the opaque `page.next` value as `after`. |
446
- | `pagination` | No | Numbered pages: `{ page, perPage }`. Defaults to page 0 and 10 results. `perPage` has a maximum of 100. |
447
- | `mode` | No | Set to `'delta'` to poll using a delta cursor instead of `page` or `pagination`. |
448
- | `after` | No | Delta mode only. Opaque `deltaCursor` from a numbered page or previous poll. Omit to establish the current watermark. |
449
- | `limit` | No | Delta mode only. Maximum results per batch. Defaults to 10 and has a maximum of 100. |
450
+ | Field | Required | Description |
451
+ | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
452
+ | `timeRange` | Yes | Trace start-time boundary. `from` is inclusive and `to` is exclusive. Both values must be ISO timestamps, and `from` must be earlier than `to`. |
453
+ | `where` | No | Recursive trace predicate. Supports scalar conditions and `spans.some` or `spans.none` clauses. |
454
+ | `orderBy` | No | One item ordering results by `startedAt`, `endedAt`, or `timeToFirstChunkMs`, in `asc` or `desc` order. Defaults to `startedAt desc`. Not accepted in delta mode. |
455
+ | `page` | No | `{ limit, after }`. `limit` defaults to 100 and has a maximum of 1000. Pass the opaque `page.next` value as `after`. |
456
+ | `pagination` | No | Numbered pages: `{ page, perPage }`. Defaults to page 0 and 10 results. `perPage` has a maximum of 100. |
457
+ | `mode` | No | Set to `'delta'` to poll using a delta cursor instead of `page` or `pagination`. |
458
+ | `after` | No | Delta mode only. Opaque `deltaCursor` from a numbered page or previous poll. Omit to establish the current watermark. |
459
+ | `limit` | No | Delta mode only. Maximum results per batch. Defaults to 10 and has a maximum of 100. |
450
460
 
451
461
  Unknown fields are rejected. Requests can't select a projection, declare joins, request counts or measures, or control authorization. Use [`aggregateTraces()`](#aggregate-traces) for counts and measures. Request bodies are limited to 256 KiB.
452
462
 
@@ -657,12 +667,13 @@ Unknown fields are rejected. Aggregation isn't paginated. Narrow the selection,
657
667
 
658
668
  Dimensions read the current root span of each selected trace:
659
669
 
660
- | Dimension | Notes |
661
- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
662
- | `entityType`, `entityName`, `environment`, `status`, `serviceName`, `executionSource` | Root span attributes. |
663
- | `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the root span. |
664
- | `name`, `spanType` | Root span name and type. Requires the `traceQueryRootSpanFields` capability. |
665
- | `metadata.<key>` | One non-empty top-level metadata key. Values are trimmed. Missing, empty, and non-string values group as `null`. |
670
+ | Dimension | Notes |
671
+ | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
672
+ | `entityType`, `entityName`, `environment`, `status`, `serviceName`, `executionSource` | Root span attributes. |
673
+ | `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the root span. |
674
+ | `name`, `spanType` | Root span name and type. Requires the `traceQueryRootSpanFields` capability. |
675
+ | `entityId` | Root span entity ID. Groups traces that have no `entityName`, such as scorer runs. Requires the `traceQueryRootEntityId` capability. |
676
+ | `metadata.<key>` | One non-empty top-level metadata key. Values are trimmed. Missing, empty, and non-string values group as `null`. |
666
677
 
667
678
  Every dimension except `serviceName`, `executionSource`, and `experimentId` is also a trace-scope `where` field, so you can drill into a group by adding its values to the predicate. `traceId`, `spanId`, `runId`, and `requestId` aren't groupable. Traces with no value for a dimension form their own group with a `null` value.
668
679
 
@@ -691,14 +702,14 @@ Token and cost measures read the model usage metrics recorded for each trace, so
691
702
 
692
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.
693
704
 
694
- 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.
695
706
 
696
707
  When you request any `cost.*` measure, every row also includes a `cost` object:
697
708
 
698
- | Field | Description |
699
- | ---------- | ------------------------------------------------------------------------------------------------------------------------------ |
700
- | `coverage` | Fraction of usage-bearing traces whose usage was fully priced, from 0 to 1. `null` when the group has no usage-bearing traces. |
701
- | `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. |
702
713
 
703
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.
704
715
 
@@ -794,11 +805,90 @@ PostgreSQL and ClickHouse stop aggregations after the same `traceQueryTimeoutMs`
794
805
  | `501` | The installed Core or configured observability store doesn't support aggregation or a requested field. Returns `TRACE_AGGREGATE_UNSUPPORTED`. |
795
806
  | `504` | A PostgreSQL or ClickHouse aggregation exceeded its execution timeout. Returns `TRACE_QUERY_EXECUTION_TIMEOUT` without partial results. |
796
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
+
797
887
  ## Trusted tenant scope
798
888
 
799
- 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.
800
890
 
801
- 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()`:
802
892
 
803
893
  ```typescript
804
894
  const plan = planTraceQuery(parseTraceQueryRequest(request), {
@@ -929,7 +1019,7 @@ Both routes require `observability:read` and use the configured observability st
929
1019
 
930
1020
  ## Limitations
931
1021
 
932
- 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.
933
1023
 
934
1024
  ## Related
935
1025
 
@@ -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({
@@ -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,
@@ -18,18 +18,18 @@ import { typeSafeAi } from '@ai-sdk/typesafe-ai'
18
18
  export const agent = new Agent({
19
19
  name: 'support-agent',
20
20
  instructions: 'Answer the user concisely.',
21
- model: 'openai/gpt-5.6-sol',
21
+ model: 'openai/gpt-6.1-sol',
22
22
  inputProcessors: [
23
23
  new ModelSelectionProcessor({
24
24
  model: typeSafeAi.decisionModel('jev-latest'),
25
25
  choices: [
26
26
  {
27
- model: 'openai/gpt-5-mini',
27
+ model: 'openai/gpt-6-luna',
28
28
  criteria:
29
29
  'Answerable in one or two sentences from general knowledge, with no reasoning steps',
30
30
  },
31
31
  {
32
- model: 'openai/gpt-5.6-sol',
32
+ model: 'openai/gpt-6.1-sol',
33
33
  criteria:
34
34
  'Requires multi-step reasoning, planning, weighing trade-offs, or careful judgment',
35
35
  },
@@ -87,8 +87,8 @@ const logger = new PinoLogger({ name: 'model-selection' })
87
87
  new ModelSelectionProcessor({
88
88
  model: typeSafeAi.decisionModel('jev-latest'),
89
89
  choices: [
90
- { model: 'openai/gpt-5-mini', criteria: 'Simple lookups' },
91
- { model: 'openai/gpt-5.6-sol', criteria: 'Multi-step reasoning' },
90
+ { model: 'openai/gpt-6-luna', criteria: 'Simple lookups' },
91
+ { model: 'openai/gpt-6.1-sol', criteria: 'Multi-step reasoning' },
92
92
  ],
93
93
  onDecision: decision => {
94
94
  logger.info('model routing', decision)
@@ -131,7 +131,7 @@ const triage = new Classifier({
131
131
  new ModelSelectionProcessor({
132
132
  classifier: triage,
133
133
  select: ({ complexity }) =>
134
- complexity.choice === 'trivial' ? 'openai/gpt-5-mini' : undefined,
134
+ complexity.choice === 'trivial' ? 'openai/gpt-6-luna' : undefined,
135
135
  })
136
136
  ```
137
137
 
@@ -182,7 +182,7 @@ new ModelSelectionProcessor({
182
182
  select: ({ complexity, sensitive }) => {
183
183
  // Never downgrade a sensitive request, however simple it looks.
184
184
  if (sensitive.probability >= 0.3) return undefined
185
- return complexity.choice === 'trivial' ? 'openai/gpt-5-mini' : undefined
185
+ return complexity.choice === 'trivial' ? 'openai/gpt-6-luna' : undefined
186
186
  },
187
187
  })
188
188
  ```
@@ -68,7 +68,7 @@ export const agent = new Agent({
68
68
  id: 'moderated-agent',
69
69
  name: 'moderated-agent',
70
70
  instructions: 'You are a helpful assistant',
71
- model: 'openai/gpt-5.6-sol',
71
+ model: 'openai/gpt-6.1-sol',
72
72
  inputProcessors: [
73
73
  new ModerationProcessor({
74
74
  model: 'openrouter/openai/gpt-oss-safeguard-20b',
@@ -96,7 +96,7 @@ export const agent = new Agent({
96
96
  id: 'output-moderated-agent',
97
97
  name: 'output-moderated-agent',
98
98
  instructions: 'You are a helpful assistant',
99
- model: 'openai/gpt-5.6-sol',
99
+ model: 'openai/gpt-6.1-sol',
100
100
  outputProcessors: [
101
101
  // Batch stream parts first to reduce LLM calls
102
102
  new BatchPartsProcessor({
@@ -70,7 +70,7 @@ export const agent = new Agent({
70
70
  id: 'private-agent',
71
71
  name: 'private-agent',
72
72
  instructions: 'You are a helpful assistant',
73
- model: 'openai/gpt-5.6-sol',
73
+ model: 'openai/gpt-6.1-sol',
74
74
  inputProcessors: [
75
75
  new PIIDetector({
76
76
  model: 'openrouter/openai/gpt-oss-safeguard-20b',
@@ -99,7 +99,7 @@ export const agent = new Agent({
99
99
  id: 'output-pii-agent',
100
100
  name: 'output-pii-agent',
101
101
  instructions: 'You are a helpful assistant',
102
- model: 'openai/gpt-5.6-sol',
102
+ model: 'openai/gpt-6.1-sol',
103
103
  outputProcessors: [
104
104
  // Batch stream parts first to reduce LLM calls
105
105
  new BatchPartsProcessor({
@@ -31,7 +31,7 @@ export const agent = new Agent({
31
31
  id: 'my-agent',
32
32
  name: 'my-agent',
33
33
  instructions: 'You are a helpful assistant.',
34
- model: 'anthropic/claude-opus-4-7',
34
+ model: 'anthropic/claude-opus-5-5',
35
35
  errorProcessors: [new PrefillErrorHandler()],
36
36
  })
37
37
  ```
@@ -53,7 +53,7 @@ export const agent = new Agent({
53
53
  id: 'my-agent',
54
54
  name: 'my-agent',
55
55
  instructions: 'You are a helpful assistant.',
56
- model: 'anthropic/claude-opus-4-7',
56
+ model: 'anthropic/claude-opus-5-5',
57
57
  errorProcessors: [customErrorHandler],
58
58
  })
59
59
  ```