@mastra/mcp-docs-server 1.3.7-alpha.1 → 1.3.7-alpha.3

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 (123) hide show
  1. package/.docs/docs/agents/guardrails.md +2 -2
  2. package/.docs/docs/auth/fga.md +0 -1
  3. package/.docs/docs/deployment/workers.md +1 -1
  4. package/.docs/docs/evals/datasets.md +5 -6
  5. package/.docs/docs/evals/gates-and-verdicts.md +3 -3
  6. package/.docs/docs/mastra-platform/deploy.md +8 -1
  7. package/.docs/docs/mastra-platform/system-environment-variables.md +1 -1
  8. package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
  9. package/.docs/docs/mastra-platform/workspaces.md +2 -2
  10. package/.docs/docs/memory/multi-user-threads.md +1 -1
  11. package/.docs/docs/observability/metrics/overview.md +1 -1
  12. package/.docs/docs/observability/tracing/overview.md +6 -0
  13. package/.docs/docs/sandbox/computer.md +13 -13
  14. package/.docs/docs/sandbox/overview.md +5 -5
  15. package/.docs/docs/server/custom-adapters.md +1 -1
  16. package/.docs/docs/server/server-adapters.md +1 -1
  17. package/.docs/docs/studio/auth.md +1 -1
  18. package/.docs/docs/workflows/control-flow.md +28 -0
  19. package/.docs/docs/workflows/time-travel.md +1 -1
  20. package/.docs/integrations/databases/clickhouse.md +13 -0
  21. package/.docs/integrations/observability/langfuse.md +8 -0
  22. package/.docs/integrations/observability/opentelemetry.md +2 -0
  23. package/.docs/models/gateways/vercel.md +1 -8
  24. package/.docs/models/index.md +1 -1
  25. package/.docs/models/providers/kilo.md +8 -8
  26. package/.docs/models/providers/llmgateway-providers.md +1 -2
  27. package/.docs/models/providers/nano-gpt.md +24 -24
  28. package/.docs/reference/auth/better-auth.md +1 -1
  29. package/.docs/reference/auth/clerk.md +1 -1
  30. package/.docs/reference/auth/neon.md +2 -2
  31. package/.docs/reference/datasets/compareExperiments.md +18 -9
  32. package/.docs/reference/datasets/dataset.md +3 -1
  33. package/.docs/reference/datasets/finalizeExperiment.md +2 -2
  34. package/.docs/reference/datasets/listExperiments.md +2 -2
  35. package/.docs/reference/datasets/submitExperimentResult.md +1 -1
  36. package/.docs/reference/editor/tools.md +11 -3
  37. package/.docs/reference/evals/completeness.md +3 -3
  38. package/.docs/reference/evals/context-precision.md +1 -1
  39. package/.docs/reference/evals/create-scorer.md +3 -7
  40. package/.docs/reference/evals/faithfulness.md +6 -4
  41. package/.docs/reference/evals/filter-run.md +2 -2
  42. package/.docs/reference/evals/trajectory-accuracy.md +3 -2
  43. package/.docs/reference/index.md +0 -1
  44. package/.docs/reference/memory/listThreads.md +1 -1
  45. package/.docs/reference/migrations/mcp-v2.md +2 -2
  46. package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
  47. package/.docs/reference/migrations/vnext-to-standard-apis.md +1 -1
  48. package/.docs/reference/observability/feedback.md +1 -1
  49. package/.docs/reference/observability/metrics/automatic-metrics.md +11 -1
  50. package/.docs/reference/observability/tracing/interfaces.md +26 -0
  51. package/.docs/reference/observability/tracing/spans.md +2 -0
  52. package/.docs/reference/processors/moderation-processor.md +1 -1
  53. package/.docs/reference/processors/prompt-injection-detector.md +2 -2
  54. package/.docs/reference/processors/provider-history-compat.md +12 -8
  55. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  56. package/.docs/reference/processors/system-prompt-scrubber.md +3 -3
  57. package/.docs/reference/processors/token-limiter-processor.md +2 -2
  58. package/.docs/reference/rag/graph-rag.md +1 -1
  59. package/.docs/reference/server/create-route.md +1 -1
  60. package/.docs/reference/server/elysia-adapter.md +1 -1
  61. package/.docs/reference/server/express-adapter.md +1 -1
  62. package/.docs/reference/server/fastify-adapter.md +1 -1
  63. package/.docs/reference/server/hono-adapter.md +2 -2
  64. package/.docs/reference/server/koa-adapter.md +1 -1
  65. package/.docs/reference/server/nestjs-adapter.md +1 -1
  66. package/.docs/reference/server/routes.md +1 -1
  67. package/.docs/reference/storage/composite.md +34 -0
  68. package/.docs/reference/storage/overview.md +3 -3
  69. package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
  70. package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
  71. package/.docs/reference/streaming/workflows/timeTravelStream.md +6 -4
  72. package/.docs/reference/tools/document-chunker-tool.md +8 -8
  73. package/.docs/reference/tools/mcp-client.md +1 -1
  74. package/.docs/reference/tools/mcp-server.md +17 -0
  75. package/.docs/reference/tools/submit-plan-tool.md +2 -0
  76. package/.docs/reference/tools/vector-query-tool.md +4 -4
  77. package/.docs/reference/vectors/astra.md +1 -1
  78. package/.docs/reference/vectors/azure-ai-search.md +1 -0
  79. package/.docs/reference/vectors/chroma.md +9 -5
  80. package/.docs/reference/vectors/convex.md +1 -3
  81. package/.docs/reference/vectors/couchbase.md +4 -9
  82. package/.docs/reference/vectors/duckdb.md +1 -1
  83. package/.docs/reference/vectors/libsql.md +1 -1
  84. package/.docs/reference/vectors/mongodb.md +2 -1
  85. package/.docs/reference/vectors/pg.md +16 -11
  86. package/.docs/reference/vectors/pinecone.md +8 -4
  87. package/.docs/reference/vectors/qdrant.md +8 -4
  88. package/.docs/reference/vectors/s3vectors.md +8 -4
  89. package/.docs/reference/vectors/turbopuffer.md +12 -6
  90. package/.docs/reference/vectors/upstash.md +10 -4
  91. package/.docs/reference/vectors/vectorize.md +7 -3
  92. package/.docs/reference/vectors/weaviate.md +1 -1
  93. package/.docs/reference/voice/composite-voice.md +15 -15
  94. package/.docs/reference/voice/mastra-voice.md +15 -11
  95. package/.docs/reference/voice/voice.addInstructions.md +1 -1
  96. package/.docs/reference/voice/voice.addTools.md +1 -1
  97. package/.docs/reference/voice/voice.answer.md +1 -1
  98. package/.docs/reference/voice/voice.close.md +1 -1
  99. package/.docs/reference/voice/voice.events.md +2 -2
  100. package/.docs/reference/voice/voice.listen.md +1 -1
  101. package/.docs/reference/voice/voice.off.md +1 -1
  102. package/.docs/reference/voice/voice.on.md +1 -1
  103. package/.docs/reference/voice/voice.send.md +2 -2
  104. package/.docs/reference/voice/voice.updateConfig.md +1 -1
  105. package/.docs/reference/workflows/dynamic-workflow-definition.md +3 -2
  106. package/.docs/reference/workflows/run-methods/cancel.md +1 -2
  107. package/.docs/reference/workflows/run-methods/resume.md +2 -0
  108. package/.docs/reference/workflows/run-methods/timeTravel.md +27 -0
  109. package/.docs/reference/workflows/run.md +14 -0
  110. package/.docs/reference/workflows/workflow-methods/agent.md +1 -1
  111. package/.docs/reference/workflows/workflow-methods/branch.md +4 -4
  112. package/.docs/reference/workflows/workflow-methods/classifier.md +1 -1
  113. package/.docs/reference/workflows/workflow-methods/create-run.md +2 -2
  114. package/.docs/reference/workflows/workflow-methods/dountil.md +1 -1
  115. package/.docs/reference/workflows/workflow-methods/dowhile.md +1 -1
  116. package/.docs/reference/workflows/workflow-methods/sleepUntil.md +1 -1
  117. package/.docs/reference/workspace/filesystem.md +10 -13
  118. package/.docs/reference/workspace/local-filesystem.md +5 -5
  119. package/.docs/reference/workspace/local-sandbox.md +1 -1
  120. package/.docs/reference/workspace/process-manager.md +2 -2
  121. package/.docs/reference/workspace/workspace-class.md +4 -4
  122. package/package.json +5 -5
  123. package/.docs/reference/agents/getTools.md +0 -31
@@ -129,7 +129,7 @@ for await (const chunk of stream) {
129
129
  | `nano-gpt/deepseek-reasoner` | 64K | | | | | | $0.40 | $2 |
130
130
  | `nano-gpt/deepseek-reasoner-cheaper` | 128K | | | | | | $0.40 | $2 |
131
131
  | `nano-gpt/deepseek-v3-0324` | 128K | | | | | | $0.20 | $0.77 |
132
- | `nano-gpt/deepseek/deepseek-latest` | 1.0M | | | | | | $1 | $3 |
132
+ | `nano-gpt/deepseek/deepseek-latest` | 1.0M | | | | | | $0.37 | $3 |
133
133
  | `nano-gpt/deepseek/deepseek-v3.2` | 163K | | | | | | $0.28 | $0.42 |
134
134
  | `nano-gpt/deepseek/deepseek-v3.2:thinking` | 163K | | | | | | $0.28 | $0.42 |
135
135
  | `nano-gpt/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
@@ -141,8 +141,8 @@ for await (const chunk of stream) {
141
141
  | `nano-gpt/deepseek/deepseek-v4-flash-vision-exp` | 1.0M | | | | | | $0.22 | $0.66 |
142
142
  | `nano-gpt/deepseek/deepseek-v4-flash:thinking` | 1.0M | | | | | | $0.14 | $0.28 |
143
143
  | `nano-gpt/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $1 | $2 |
144
- | `nano-gpt/deepseek/deepseek-v4-pro-0813` | 1.0M | | | | | | $1 | $3 |
145
- | `nano-gpt/deepseek/deepseek-v4-pro-0813:thinking` | 1.0M | | | | | | $1 | $3 |
144
+ | `nano-gpt/deepseek/deepseek-v4-pro-0813` | 1.0M | | | | | | $0.37 | $3 |
145
+ | `nano-gpt/deepseek/deepseek-v4-pro-0813:thinking` | 1.0M | | | | | | $0.37 | $3 |
146
146
  | `nano-gpt/deepseek/deepseek-v4-pro:thinking` | 1.0M | | | | | | $1 | $2 |
147
147
  | `nano-gpt/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.13 | $0.52 |
148
148
  | `nano-gpt/deepseek/deepseek-v4.1-flash:thinking` | 1.0M | | | | | | $0.13 | $0.52 |
@@ -284,7 +284,7 @@ for await (const chunk of stream) {
284
284
  | `nano-gpt/meta-llama/llama-3.1-8b-instruct` | 131K | | | | | | $0.05 | $0.09 |
285
285
  | `nano-gpt/meta-llama/llama-3.2-3b-instruct` | 131K | | | | | | $0.03 | $0.05 |
286
286
  | `nano-gpt/meta-llama/llama-3.3-70b-instruct` | 131K | | | | | | $0.05 | $0.23 |
287
- | `nano-gpt/meta-llama/llama-4-maverick` | 1.0M | | | | | | $0.15 | $0.60 |
287
+ | `nano-gpt/meta-llama/llama-4-maverick` | 1.0M | | | | | | $0.19 | $0.65 |
288
288
  | `nano-gpt/meta-llama/llama-4-scout` | 328K | | | | | | $0.09 | $0.46 |
289
289
  | `nano-gpt/meta/muse-glimmer-30b` | 131K | | | | | | $0.35 | $2 |
290
290
  | `nano-gpt/meta/muse-spark-1.1` | 1.0M | | | | | | $1 | $4 |
@@ -333,11 +333,11 @@ for await (const chunk of stream) {
333
333
  | `nano-gpt/moonshotai/kimi-k2-instruct-0711` | 128K | | | | | | $0.40 | $2 |
334
334
  | `nano-gpt/moonshotai/Kimi-K2-Instruct-0905` | 262K | | | | | | $0.40 | $2 |
335
335
  | `nano-gpt/moonshotai/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
336
- | `nano-gpt/moonshotai/kimi-k2.5` | 262K | | | | | | $0.30 | $2 |
337
- | `nano-gpt/moonshotai/kimi-k2.5:thinking` | 262K | | | | | | $0.30 | $2 |
336
+ | `nano-gpt/moonshotai/kimi-k2.5` | 262K | | | | | | $0.38 | $2 |
337
+ | `nano-gpt/moonshotai/kimi-k2.5:thinking` | 262K | | | | | | $0.38 | $2 |
338
338
  | `nano-gpt/moonshotai/kimi-k2.6` | 262K | | | | | | $0.50 | $3 |
339
339
  | `nano-gpt/moonshotai/kimi-k2.6:thinking` | 262K | | | | | | $0.50 | $3 |
340
- | `nano-gpt/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
340
+ | `nano-gpt/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.67 | $3 |
341
341
  | `nano-gpt/moonshotai/kimi-k2.7-code-highspeed` | 262K | | | | | | $2 | $8 |
342
342
  | `nano-gpt/moonshotai/kimi-k3` | 1.0M | | | | | | $2 | $10 |
343
343
  | `nano-gpt/moonshotai/kimi-latest` | 1.0M | | | | | | $2 | $10 |
@@ -448,10 +448,9 @@ for await (const chunk of stream) {
448
448
  | `nano-gpt/qwen/qwen3-coder-30b-a3b-instruct` | 128K | | | | | | $0.10 | $0.40 |
449
449
  | `nano-gpt/qwen/qwen3-coder-flash` | 128K | | | | | | $0.30 | $2 |
450
450
  | `nano-gpt/qwen/qwen3-coder-next` | 262K | | | | | | $0.25 | $0.80 |
451
- | `nano-gpt/qwen/qwen3-coder-plus` | 128K | | | | | | $1 | $5 |
452
451
  | `nano-gpt/qwen/qwen3-max` | 256K | | | | | | $1 | $6 |
453
452
  | `nano-gpt/qwen/qwen3-max-2026-01-23` | 256K | | | | | | $1 | $6 |
454
- | `nano-gpt/qwen/qwen3-next-80b-a3b-instruct` | 262K | | | | | | $0.15 | $0.65 |
453
+ | `nano-gpt/qwen/qwen3-next-80b-a3b-instruct` | 262K | | | | | | $0.09 | $1 |
455
454
  | `nano-gpt/qwen/qwen3-next-80b-a3b-thinking` | 256K | | | | | | $0.15 | $0.65 |
456
455
  | `nano-gpt/qwen/qwen3-vl-235b-a22b-instruct` | 131K | | | | | | $0.30 | $2 |
457
456
  | `nano-gpt/qwen/qwen3-vl-235b-a22b-thinking` | 131K | | | | | | $0.50 | $6 |
@@ -498,8 +497,8 @@ for await (const chunk of stream) {
498
497
  | `nano-gpt/qwen/qwen3.8-27b-queen` | 524K | | | | | | $0.25 | $2 |
499
498
  | `nano-gpt/qwen/qwen3.8-27b-swift` | 262K | | | | | | $0.10 | $0.60 |
500
499
  | `nano-gpt/qwen/qwen3.8-27b-synthia` | 262K | | | | | | $0.10 | $0.60 |
501
- | `nano-gpt/qwen/qwen3.8-27b-uncensored` | 1.0M | | | | | | $0.75 | $3 |
502
- | `nano-gpt/qwen/qwen3.8-27b-uncensored:thinking` | 1.0M | | | | | | $0.75 | $3 |
500
+ | `nano-gpt/qwen/qwen3.8-27b-uncensored` | 1.0M | | | | | | $1 | $3 |
501
+ | `nano-gpt/qwen/qwen3.8-27b-uncensored:thinking` | 1.0M | | | | | | $1 | $3 |
503
502
  | `nano-gpt/qwen/qwen3.8-27b:thinking` | 1.0M | | | | | | $0.15 | $0.70 |
504
503
  | `nano-gpt/qwen/qwen3.8-flash` | 992K | | | | | | $0.14 | $0.42 |
505
504
  | `nano-gpt/qwen/qwen3.8-max` | 991K | | | | | | $2 | $6 |
@@ -539,8 +538,8 @@ for await (const chunk of stream) {
539
538
  | `nano-gpt/TEE/gemma-4-31b-it` | 262K | | | | | | $0.15 | $0.46 |
540
539
  | `nano-gpt/TEE/gemma4-31b` | 262K | | | | | | $0.40 | $1 |
541
540
  | `nano-gpt/TEE/gemma4-31b:thinking` | 262K | | | | | | $0.40 | $1 |
542
- | `nano-gpt/TEE/glm-5.1` | 203K | | | | | | $2 | $5 |
543
- | `nano-gpt/TEE/glm-5.1-thinking` | 203K | | | | | | $2 | $5 |
541
+ | `nano-gpt/TEE/glm-5.1` | 203K | | | | | | $0.70 | $3 |
542
+ | `nano-gpt/TEE/glm-5.1-thinking` | 203K | | | | | | $0.70 | $3 |
544
543
  | `nano-gpt/TEE/glm-5.2` | 1.0M | | | | | | $1 | $4 |
545
544
  | `nano-gpt/TEE/glm-5.2:thinking` | 1.0M | | | | | | $1 | $4 |
546
545
  | `nano-gpt/TEE/glm-5.3` | 1.0M | | | | | | $1 | $4 |
@@ -569,6 +568,7 @@ for await (const chunk of stream) {
569
568
  | `nano-gpt/TheDrummer/Cydonia-24B-v4.3` | 33K | | | | | | $0.12 | $0.15 |
570
569
  | `nano-gpt/TheDrummer/Magidonia-24B-v4.3` | 33K | | | | | | $0.10 | $0.12 |
571
570
  | `nano-gpt/TheDrummer/Rocinante-12B-v1.1` | 16K | | | | | | $0.41 | $0.59 |
571
+ | `nano-gpt/TheDrummer/Skyfall-31B-v4.2` | 16K | | | | | | $0.12 | $0.15 |
572
572
  | `nano-gpt/TheDrummer/skyfall-36b-v2` | 33K | | | | | | $0.55 | $0.80 |
573
573
  | `nano-gpt/TheDrummer/UnslopNemo-12B-v4.1` | 8K | | | | | | $0.49 | $0.49 |
574
574
  | `nano-gpt/thinkingmachines/inkling` | 1.0M | | | | | | $1 | $4 |
@@ -597,9 +597,9 @@ for await (const chunk of stream) {
597
597
  | `nano-gpt/x-ai/grok-4.3` | 1.0M | | | | | | $1 | $3 |
598
598
  | `nano-gpt/x-ai/grok-4.5` | 500K | | | | | | $2 | $6 |
599
599
  | `nano-gpt/x-ai/grok-4.6` | 500K | | | | | | $2 | $6 |
600
- | `nano-gpt/x-ai/grok-4.7` | 500K | | | | | | $2 | $5 |
600
+ | `nano-gpt/x-ai/grok-4.7` | 500K | | | | | | $2 | $6 |
601
601
  | `nano-gpt/x-ai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
602
- | `nano-gpt/x-ai/grok-latest` | 500K | | | | | | $2 | $5 |
602
+ | `nano-gpt/x-ai/grok-latest` | 500K | | | | | | $2 | $6 |
603
603
  | `nano-gpt/xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.14 | $0.28 |
604
604
  | `nano-gpt/xiaomi/mimo-v2.5-pro` | 1.0M | | | | | | $0.43 | $0.87 |
605
605
  | `nano-gpt/xiaomi/mimo-v2.5-pro:thinking` | 1.0M | | | | | | $0.43 | $0.87 |
@@ -616,11 +616,11 @@ for await (const chunk of stream) {
616
616
  | `nano-gpt/z-ai/GLM-4.5:thinking` | 128K | | | | | | $0.30 | $1 |
617
617
  | `nano-gpt/z-ai/glm-4.5v` | 66K | | | | | | $0.60 | $2 |
618
618
  | `nano-gpt/z-ai/glm-4.5v:thinking` | 66K | | | | | | $0.60 | $2 |
619
- | `nano-gpt/z-ai/glm-4.6` | 200K | | | | | | $0.35 | $1 |
620
- | `nano-gpt/z-ai/glm-4.6-original` | 256K | | | | | | $0.35 | $1 |
619
+ | `nano-gpt/z-ai/glm-4.6` | 200K | | | | | | $0.50 | $2 |
620
+ | `nano-gpt/z-ai/glm-4.6-original` | 256K | | | | | | $0.50 | $2 |
621
621
  | `nano-gpt/z-ai/GLM-4.6-turbo` | 205K | | | | | | $1 | $3 |
622
622
  | `nano-gpt/z-ai/GLM-4.6-turbo:thinking` | 205K | | | | | | $1 | $3 |
623
- | `nano-gpt/z-ai/glm-4.6:thinking` | 200K | | | | | | $0.35 | $1 |
623
+ | `nano-gpt/z-ai/glm-4.6:thinking` | 200K | | | | | | $0.50 | $2 |
624
624
  | `nano-gpt/z-ai/glm-4.6v` | 128K | | | | | | $0.30 | $0.90 |
625
625
  | `nano-gpt/z-ai/glm-4.6v-original` | 128K | | | | | | $0.60 | $0.90 |
626
626
  | `nano-gpt/z-ai/glm-4.7` | 200K | | | | | | $0.40 | $2 |
@@ -629,13 +629,13 @@ for await (const chunk of stream) {
629
629
  | `nano-gpt/z-ai/glm-4.7-original` | 200K | | | | | | $0.60 | $2 |
630
630
  | `nano-gpt/z-ai/glm-4.7-original:thinking` | 200K | | | | | | $0.60 | $2 |
631
631
  | `nano-gpt/z-ai/glm-4.7:thinking` | 200K | | | | | | $0.40 | $2 |
632
- | `nano-gpt/z-ai/glm-5` | 200K | | | | | | $0.50 | $3 |
633
- | `nano-gpt/z-ai/glm-5-original` | 200K | | | | | | $1 | $3 |
634
- | `nano-gpt/z-ai/glm-5-original:thinking` | 200K | | | | | | $1 | $3 |
632
+ | `nano-gpt/z-ai/glm-5` | 200K | | | | | | $0.60 | $2 |
633
+ | `nano-gpt/z-ai/glm-5-original` | 200K | | | | | | $0.60 | $2 |
634
+ | `nano-gpt/z-ai/glm-5-original:thinking` | 200K | | | | | | $0.60 | $2 |
635
635
  | `nano-gpt/z-ai/glm-5-turbo` | 203K | | | | | | $1 | $4 |
636
- | `nano-gpt/z-ai/glm-5:thinking` | 200K | | | | | | $0.50 | $3 |
637
- | `nano-gpt/z-ai/glm-5.1` | 200K | | | | | | $0.75 | $3 |
638
- | `nano-gpt/z-ai/glm-5.1:thinking` | 200K | | | | | | $0.75 | $3 |
636
+ | `nano-gpt/z-ai/glm-5:thinking` | 200K | | | | | | $0.60 | $2 |
637
+ | `nano-gpt/z-ai/glm-5.1` | 200K | | | | | | $0.70 | $3 |
638
+ | `nano-gpt/z-ai/glm-5.1:thinking` | 200K | | | | | | $0.70 | $3 |
639
639
  | `nano-gpt/z-ai/glm-5.2` | 1.0M | | | | | | $0.42 | $1 |
640
640
  | `nano-gpt/z-ai/glm-5.2:thinking` | 1.0M | | | | | | $0.42 | $1 |
641
641
  | `nano-gpt/z-ai/glm-5.3` | 1.0M | | | | | | $0.60 | $1 |
@@ -41,7 +41,7 @@ export const mastra = new Mastra({
41
41
 
42
42
  **name** (`string`): Custom name for the auth provider instance. (Default: `'better-auth'`)
43
43
 
44
- **authorizeUser** (`(user: BetterAuthUser, request: HonoRequest) => Promise<boolean> | boolean`): Custom authorization function to determine if a user should be granted access. Called after session verification. By default, allows all authenticated users with valid sessions.
44
+ **authorizeUser** (`(user: BetterAuthUser, request: MastraAuthRequest) => Promise<boolean> | boolean`): Custom authorization function to determine if a user should be granted access. Called after session verification. By default, allows all authenticated users with valid sessions.
45
45
 
46
46
  **public** (`Array<string | RegExp | [string, Methods | Methods[]]>`): Public routes that do not require authentication. Supports exact paths, wildcards, and path params.
47
47
 
@@ -57,7 +57,7 @@ export const mastra = new Mastra({
57
57
 
58
58
  **name** (`string`): Custom name for the auth provider instance.
59
59
 
60
- **authorizeUser** (`(user: User, request: HonoRequest) => Promise<boolean> | boolean`): Custom authorization function to determine if a user should be granted access. Called after token verification. By default, allows all authenticated users, unless organizationId or organizationSlug is set, in which case only members of that organization are allowed.
60
+ **authorizeUser** (`(user: User, request: MastraAuthRequest) => Promise<boolean> | boolean`): Custom authorization function to determine if a user should be granted access. Called after token verification. By default, allows all authenticated users, unless organizationId or organizationSlug is set, in which case only members of that organization are allowed.
61
61
 
62
62
  ## Related
63
63
 
@@ -154,9 +154,9 @@ The `MastraRBACNeon` constructor accepts a `MastraRBACNeonOptions` object.
154
154
 
155
155
  **organizationId** (`string`): Restricts membership lookup to one Neon Auth organization.
156
156
 
157
- **getUserRoles** (`(user: EEUser) => Promise<string[]> | string[]`): Custom function for extracting role names. When omitted, the provider fetches organization memberships from Neon Auth.
157
+ **getUserRoles** (`(user: NeonAuthUser) => Promise<string[]> | string[]`): Custom function for extracting role names. When omitted, the provider fetches organization memberships from Neon Auth.
158
158
 
159
- **cache** (`{ ttlMs?: number; maxSize?: number }`): Role lookup cache configuration. The defaults are 30,000 ms and 1,000 entries.
159
+ **cache** (`{ ttlMs?: number; maxSize?: number }`): Role lookup cache configuration. The defaults are 60,000 ms and 1,000 entries.
160
160
 
161
161
  ### Methods
162
162
 
@@ -16,7 +16,7 @@ import { Mastra } from '@mastra/core'
16
16
  const mastra = new Mastra({/* storage config */})
17
17
 
18
18
  const comparison = await mastra.datasets.compareExperiments({
19
- experimentIds: ['exp-baseline', 'exp-new'],
19
+ experimentIds: ['exp-baseline', 'exp-prompt-v2', 'exp-new-model'],
20
20
  baselineId: 'exp-baseline',
21
21
  })
22
22
 
@@ -27,24 +27,29 @@ for (const item of comparison.items) {
27
27
  console.log(` Input: ${JSON.stringify(item.input)}`)
28
28
 
29
29
  for (const [expId, result] of Object.entries(item.results)) {
30
- if (result) {
31
- console.log(
32
- ` ${expId}: output=${JSON.stringify(result.output)}, scores=${JSON.stringify(result.scores)}`,
33
- )
30
+ if (!result) {
31
+ console.log(` ${expId}: did not run this item`)
32
+ continue
34
33
  }
34
+ console.log(
35
+ ` ${expId}: output=${JSON.stringify(result.output)}, scores=${JSON.stringify(result.scores)}`,
36
+ )
35
37
  }
36
38
  }
37
39
  ```
38
40
 
39
41
  ## Parameters
40
42
 
41
- **experimentIds** (`string[]`): Array of experiment IDs to compare. Must contain at least 2.
43
+ **experimentIds** (`string[]`): Array of experiment IDs to compare. Duplicate IDs are removed before the 2-ID minimum is checked, so the list must contain at least 2 distinct IDs.
42
44
 
43
- **baselineId** (`string`): ID of the baseline experiment. Defaults to the first ID in experimentIds.
45
+ **baselineId** (`string`): ID of the baseline experiment. Must be one of experimentIds. Defaults to the first ID in experimentIds.
44
46
 
45
47
  ## Returns
46
48
 
47
- Throws `MastraError` if fewer than 2 experiment IDs are provided.
49
+ Throws a `MastraError` with ID `COMPARE_INVALID_INPUT` when:
50
+
51
+ - `experimentIds` contains fewer than 2 distinct IDs.
52
+ - `baselineId` isn't one of `experimentIds`. Earlier versions silently ignored an unknown `baselineId`.
48
53
 
49
54
  **result** (`Promise<object>`): Comparison results.
50
55
 
@@ -58,7 +63,11 @@ Throws `MastraError` if fewer than 2 experiment IDs are provided.
58
63
 
59
64
  **result.items.groundTruth** (`unknown | null`): Ground truth for the item.
60
65
 
61
- **result.items.results** (`Record<string, { output: unknown; scores: Record<string, number | null> } | null>`): Results keyed by experiment ID. Each entry contains the output and scorer results for that experiment.
66
+ **result.items.results** (`Record<string, { output: unknown; scores: Record<string, number | null> } | null>`): Results keyed by experiment ID, with an entry for every experiment in experimentIds. Each entry contains the output and scorer results for that experiment, or null when that experiment did not run the item.
67
+
68
+ ## HTTP route
69
+
70
+ `POST /api/datasets/:datasetId/compare` calls this method. The route accepts between 2 and 10 IDs in `experimentIds`. It also still accepts the deprecated `{ experimentIdA, experimentIdB }` body, which compares the two experiments with `experimentIdA` as the baseline.
62
71
 
63
72
  ## Related
64
73
 
@@ -60,7 +60,7 @@ const history = await dataset.getItemHistory({ itemId: 'item-id' })
60
60
 
61
61
  ## Access
62
62
 
63
- `Dataset` isn't instantiated directly. Obtain one via `DatasetsManager`:
63
+ Obtain a `Dataset` through `DatasetsManager`, which resolves the dataset and applies tenancy scope:
64
64
 
65
65
  ```typescript
66
66
  const dataset = await mastra.datasets.get({ id: 'dataset-id' })
@@ -68,6 +68,8 @@ const dataset = await mastra.datasets.get({ id: 'dataset-id' })
68
68
  const dataset = await mastra.datasets.create({ name: 'My dataset' })
69
69
  ```
70
70
 
71
+ `Dataset` also has a public constructor (`new Dataset(id, mastra)`) that skips the manager's lookup and tenancy scoping.
72
+
71
73
  ## Properties
72
74
 
73
75
  For the full dataset record (name, description, schemas, version, timestamps), call [`dataset.getDetails()`](https://mastra.ai/reference/datasets/getDetails).
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.61.0`
8
8
 
9
- Finalizes a caller-driven experiment created with [`createExperiment()`](https://mastra.ai/reference/datasets/createExperiment), with or without a target. Mastra computes the final counts server-side from the persisted result rows and marks the experiment `'completed'`. The caller never tracks completion bookkeeping.
9
+ Finalizes a caller-driven experiment created with [`createExperiment()`](https://mastra.ai/reference/datasets/createExperiment), with or without a target. Mastra computes the final counts server-side from the persisted result rows and marks the experiment `'completed'`. An experiment that's already `'failed'` is returned unchanged and stays failed. The caller never tracks completion bookkeeping.
10
10
 
11
11
  Counts are per item, so `succeededCount + failedCount + skippedCount === totalItems` even when items have multiple attempts:
12
12
 
@@ -16,7 +16,7 @@ Counts are per item, so `succeededCount + failedCount + skippedCount === totalIt
16
16
 
17
17
  Attempt-level detail remains available through [`listExperimentResults()`](https://mastra.ai/reference/datasets/listExperimentResults).
18
18
 
19
- Finalization is idempotent: calling it on an already-finalized experiment returns the stored record without recomputing.
19
+ Finalization is idempotent: calling it on an already completed or failed experiment returns the stored record without recomputing.
20
20
 
21
21
  ## Usage example
22
22
 
@@ -67,9 +67,9 @@ for (const exp of experiments) {
67
67
 
68
68
  **result.experiments.datasetVersion** (`number | null`): Dataset version used for the experiment.
69
69
 
70
- **result.experiments.targetType** (`'agent' | 'workflow' | 'scorer' | 'processor'`): Type of target used.
70
+ **result.experiments.targetType** (`'agent' | 'workflow' | 'scorer' | 'processor' | null`): Type of target used. null for caller-driven ingestion experiments.
71
71
 
72
- **result.experiments.targetId** (`string`): ID of the target used.
72
+ **result.experiments.targetId** (`string | null`): ID of the target used. null for caller-driven ingestion experiments.
73
73
 
74
74
  **result.experiments.status** (`'pending' | 'running' | 'completed' | 'failed'`): Current status of the experiment.
75
75
 
@@ -37,7 +37,7 @@ The item must be visible at the experiment's pinned dataset version. Submissions
37
37
 
38
38
  **groundTruth** (`unknown`): Expected output. Defaults to the dataset item's ground truth at the pinned version.
39
39
 
40
- **error** (`object`): Error details (message, optional stack and code) when the item failed.
40
+ **error** (`object | null`): Error details (message, optional stack and code) when the item failed.
41
41
 
42
42
  **startedAt** (`Date`): When the worker started this item.
43
43
 
@@ -78,10 +78,18 @@ Stored HTTP definitions don't accept arbitrary headers. When the reserved `mastr
78
78
 
79
79
  MCP tools can be allowlisted at two levels:
80
80
 
81
- 1. **Server level**: The stored server's `tools` map limits tools for every agent that uses the client.
82
- 2. **Agent level**: The agent's MCP client reference limits the remaining tools for that agent.
81
+ 1. **Server level**: The stored server's `tools` map limits tools for every agent that uses the client. Omitting `tools` at this level exposes all of the server's tools.
82
+ 2. **Agent level**: The agent's MCP client reference limits the remaining tools for that agent. Omitting `tools` at this level selects no tools.
83
83
 
84
- Agent-level tool names can use namespaced or bare names. An explicit empty `tools` map selects all tools. With the current resolver, omitting `tools` from an agent-level MCP reference selects none.
84
+ Agent-level tool names can use namespaced or bare names. To select every remaining tool at the agent level, pass an explicit empty `tools` map:
85
+
86
+ ```typescript
87
+ const mcpClients = {
88
+ 'docs-client': { tools: {} }, // all tools
89
+ 'search-client': { tools: { docs_search: {} } }, // only docs_search
90
+ 'billing-client': {}, // no tools
91
+ }
92
+ ```
85
93
 
86
94
  ### Namespacing
87
95
 
@@ -25,7 +25,7 @@ The `.run()` method returns a result in the following shape:
25
25
  ```typescript
26
26
  {
27
27
  runId: string,
28
- extractStepResult: {
28
+ preprocessStepResult: {
29
29
  inputElements: string[],
30
30
  outputElements: string[],
31
31
  missingElements: string[],
@@ -52,9 +52,9 @@ The extraction process includes:
52
52
  - Special handling of short words (3 characters or less)
53
53
  - Deduplication of elements
54
54
 
55
- ### `extractStepResult`
55
+ ### `preprocessStepResult`
56
56
 
57
- From the `.run()` method, you can get the `extractStepResult` object with the following properties:
57
+ From the `.run()` method, you can get the `preprocessStepResult` object with the following properties:
58
58
 
59
59
  - **inputElements**: Key elements found in the input (e.g., nouns, verbs, topics, terms).
60
60
  - **outputElements**: Key elements found in the output.
@@ -34,7 +34,7 @@ Either `context` or `contextExtractor` must be provided. If both are provided, `
34
34
 
35
35
  ## `.run()` returns
36
36
 
37
- **score** (`number`): Mean Average Precision score between 0 and scale (default 0-1)
37
+ **score** (`number`): Mean Average Precision score between 0 and scale (default 0-1). Assumes a positive scale.
38
38
 
39
39
  **reason** (`string`): Human-readable explanation of the context precision evaluation
40
40
 
@@ -10,7 +10,7 @@ Mastra provides a unified `createScorer` factory that allows you to define custo
10
10
 
11
11
  Use the `createScorer` factory to define your scorer with a name, description, and optional judge configuration. Then chain step methods to build your evaluation pipeline. You must provide at least a `generateScore` step.
12
12
 
13
- **Prompt object steps** are step configurations expressed as objects with `description` + `createPrompt` (and `outputSchema` for `preprocess`/`analyze`). These steps invoke the judge LLM. **Function steps** are plain functions and never call the judge.
13
+ **Prompt object steps** are step configurations expressed as objects with `description` + `createPrompt` (and `outputSchema` for `preprocess`/`analyze`, but not for `generateScore`). These steps invoke the judge LLM. **Function steps** are plain functions and never call the judge.
14
14
 
15
15
  ```typescript
16
16
  import { createScorer } from '@mastra/core/evals'
@@ -65,7 +65,7 @@ This function returns a scorer builder that you can chain step methods onto. See
65
65
 
66
66
  The judge only runs for steps defined as **prompt objects** (`preprocess`, `analyze`, `generateScore`, `generateReason` in prompt mode). If you use function steps only, the judge is never called and there is no LLM output to inspect. In that case, any score/reason must be produced by your functions.
67
67
 
68
- When a prompt-object step runs, its structured LLM output is stored in the corresponding result field (`preprocessStepResult`, `analyzeStepResult`, or the value consumed by `calculateScore` in `generateScore`).
68
+ When a prompt-object step runs, its structured LLM output is stored in the corresponding result field (`preprocessStepResult` or `analyzeStepResult`). For `generateScore`, the judge returns `{ score: number }` and `score` becomes the scorer's score.
69
69
 
70
70
  ## Retry judge requests
71
71
 
@@ -289,15 +289,11 @@ The method must return a numerical score.
289
289
 
290
290
  **description** (`string`): Description of what this scoring step does.
291
291
 
292
- **outputSchema** (`StandardJSONSchemaV1`): Standard JSON Schema for the expected output of the generateScore step.
293
-
294
292
  **createPrompt** (`function`): Function: ({ run, results }) => string. Returns the prompt for the LLM.
295
293
 
296
294
  **judge** (`object`): (Optional) LLM judge for this step (can override main judge). See Judge Object section.
297
295
 
298
- When using prompt object mode, you must also provide a `calculateScore` function to convert the LLM output to a numerical score:
299
-
300
- **calculateScore** (`function`): Function: ({ run, results, analyzeStepResult }) => number. Converts the LLM's structured output into a numerical score.
296
+ In prompt object mode, don't set `outputSchema`. Mastra asks the judge for structured output of the form `{ score: number }` and uses `score` as the step result.
301
297
 
302
298
  ### `generateReason`
303
299
 
@@ -12,9 +12,11 @@ The `createFaithfulnessScorer()` function accepts a single options object with t
12
12
 
13
13
  **model** (`LanguageModel`): Configuration for the model used to evaluate faithfulness.
14
14
 
15
- **context** (`string[]`): Array of context chunks against which the output's claims will be verified.
15
+ **options** (`{ context?: string[]; scale?: number }`): Configuration options for the scorer.
16
16
 
17
- **scale** (`number`): The maximum score value. The final score will be normalized to this scale. (Default: `1`)
17
+ **options.context** (`string[]`): Array of context chunks against which the output's claims will be verified. When omitted, the scorer uses the results of tool calls in the run output.
18
+
19
+ **options.scale** (`number`): The maximum score value. The final score will be normalized to this scale.
18
20
 
19
21
  This function returns an instance of the MastraScorer class. The `.run()` method accepts the same input as other scorers (see the [MastraScorer reference](https://mastra.ai/reference/evals/mastra-scorer)), but the return value includes LLM-specific fields as documented below.
20
22
 
@@ -22,7 +24,7 @@ This function returns an instance of the MastraScorer class. The `.run()` method
22
24
 
23
25
  **runId** (`string`): The id of the run (optional).
24
26
 
25
- **preprocessStepResult** (`string[]`): Array of extracted claims from the output.
27
+ **preprocessStepResult** (`object`): Object with the claims extracted from the output: { claims: string\[] }
26
28
 
27
29
  **preprocessPrompt** (`string`): The prompt sent to the LLM for the preprocess step (optional).
28
30
 
@@ -64,7 +66,7 @@ Final score: `(supported_claims / total_claims) * scale`
64
66
 
65
67
  ### Score interpretation
66
68
 
67
- A faithfulness score between 0 and 1:
69
+ A faithfulness score between 0 and the configured scale (default 1). With the default scale:
68
70
 
69
71
  - **1.0**: All claims are accurate and directly supported by the context.
70
72
  - **0.7 to 0.9**: Most claims are correct, with minor additions or omissions.
@@ -115,7 +115,7 @@ The `partTypes` option accepts `MastraPartType` values. Each value is prefix-mat
115
115
  ## Filtering behavior
116
116
 
117
117
  - **Part type filtering** applies to both `input.rememberedMessages` and `output` when they contain agent message arrays.
118
- - **Tool name filtering** only affects messages that contain tool invocations. Text-only messages pass through.
118
+ - **Tool name filtering** only affects messages that contain tool invocations. Messages without tool invocations are filtered by `partTypes` only, and pass through when `partTypes` isn't set.
119
119
  - **System messages** (`systemMessages`, `taggedSystemMessages`) are never filtered, regardless of `partTypes` or `toolNames`.
120
120
  - **Message limits** (`maxRememberedMessages`, `maxOutputMessages`) apply after type and tool filtering, taking the most recent messages.
121
- - When both `partTypes` and `toolNames` are set, a message must satisfy both filters to be kept.
121
+ - When both `partTypes` and `toolNames` are set, a message with tool invocations must satisfy both filters to be kept.
@@ -93,13 +93,14 @@ The discriminated union includes these additional step types:
93
93
  | Step type | Key properties |
94
94
  | ---------------------- | ------------------------------------------------------------- |
95
95
  | `mcp_tool_call` | `toolArgs`, `toolResult`, `mcpServer`, `success` |
96
+ | `provider_tool_call` | `toolArgs`, `toolResult`, `success` |
96
97
  | `model_generation` | `modelId`, `promptTokens`, `completionTokens`, `finishReason` |
97
98
  | `agent_run` | `agentId` |
98
99
  | `workflow_run` | `workflowId`, `status` |
99
100
  | `workflow_conditional` | `conditionCount`, `selectedSteps` |
100
101
  | `workflow_parallel` | `branchCount`, `parallelSteps` |
101
102
  | `workflow_loop` | `loopType`, `totalIterations` |
102
- | `workflow_sleep` | `durationMs`, `sleepType` |
103
+ | `workflow_sleep` | `sleepDurationMs`, `sleepType` |
103
104
  | `workflow_wait_event` | `eventName`, `eventReceived` |
104
105
  | `processor_run` | `processorId` |
105
106
 
@@ -261,7 +262,7 @@ Only checks that each expected step is present. Order is ignored, and extra step
261
262
 
262
263
  ## Code-based scoring details
263
264
 
264
- - **Continuous scores**: Returns values between 0.0 and 1.0 in relaxed mode; binary (0 or 1) in strict mode
265
+ - **Continuous scores**: Returns values between 0.0 and 1.0 in every ordering mode. In strict mode, the score is the share of expected steps matched in order, minus penalties for extra steps and, when `allowRepeatedSteps` is `false`, repeated steps
265
266
  - **Deterministic**: Same input always produces the same output
266
267
  - **Fast**: No external API calls
267
268
 
@@ -27,7 +27,6 @@ The Reference section provides documentation of Mastra's API, including paramete
27
27
  - [.getMetadata()](https://mastra.ai/reference/agents/getMetadata)
28
28
  - [.getModel()](https://mastra.ai/reference/agents/getModel)
29
29
  - [.getSkill()](https://mastra.ai/reference/agents/getSkill)
30
- - [.getTools()](https://mastra.ai/reference/agents/getTools)
31
30
  - [.getVoice()](https://mastra.ai/reference/agents/getVoice)
32
31
  - [.listAgents()](https://mastra.ai/reference/agents/listAgents)
33
32
  - [.listScorers()](https://mastra.ai/reference/agents/listScorers)
@@ -69,7 +69,7 @@ const result = await memory.listThreads({
69
69
 
70
70
  **page** (`number`): Page number (0-indexed) to retrieve
71
71
 
72
- **perPage** (`number | false`): Maximum number of threads to return per page, or false to fetch all
72
+ **perPage** (`number | false`): Maximum number of threads to return per page, or false to fetch all (Default: `100`)
73
73
 
74
74
  **orderBy** (`{ field: 'createdAt' | 'updatedAt', direction: 'ASC' | 'DESC' }`): Sort configuration with field and direction (defaults to { field: 'createdAt', direction: 'DESC' })
75
75
 
@@ -16,12 +16,12 @@ Streamable HTTP still streams responses as Server-Sent Events. What's removed is
16
16
 
17
17
  ### `@mastra/core` peer range
18
18
 
19
- `@mastra/mcp` 2.0 requires `@mastra/core` 1.68 or newer, which adds the shared server contract (`mcpVersion`, `MCPToolExecutionResultV2`, `context.mcp.protocolVersion`). Update both packages together.
19
+ `@mastra/mcp` 2.0 requires `@mastra/core` 1.76 or a later 1.x release, which includes the shared server contract (`mcpVersion`, `MCPToolExecutionResultV2`, `context.mcp.protocolVersion`). Update both packages together.
20
20
 
21
21
  ```diff
22
22
  - "@mastra/core": "^1.60.0",
23
23
  - "@mastra/mcp": "^1.17.0"
24
- + "@mastra/core": "^1.68.0",
24
+ + "@mastra/core": "^1.76.0",
25
25
  + "@mastra/mcp": "^2.0.0"
26
26
  ```
27
27
 
@@ -81,7 +81,7 @@ To migrate, replace property access with the corresponding getter methods.
81
81
  - const tools = agent.tools;
82
82
  - const instructions = agent.instructions;
83
83
  + const llm = agent.getLLM();
84
- + const tools = agent.getTools();
84
+ + const tools = await agent.listTools();
85
85
  + const instructions = agent.getInstructions();
86
86
  ```
87
87
 
@@ -153,7 +153,7 @@ The following options are available in the standard `.stream()` and `generate()`
153
153
  - `errorStrategy` - Determines what happens when the output doesn’t match the schema:
154
154
 
155
155
  - 'warn' - log a warning
156
- - 'error' - throw an error
156
+ - 'strict' - throw an error
157
157
  - 'fallback' - return a fallback value you provide
158
158
 
159
159
  ```typescript
@@ -345,7 +345,7 @@ Use `FeedbackInput` with `mastra.observability.addFeedback()`, `recordedTrace.ad
345
345
 
346
346
  **metadata** (`Record<string, unknown>`): Additional feedback-specific metadata.
347
347
 
348
- **experimentId** (`string`): Experiment or eval run identifier.
348
+ **experimentId** (`string`): Deprecated. The experiment is derived from the target trace or span. Read correlationContext.experimentId on the exported event instead.
349
349
 
350
350
  **sourceId** (`string`): ID of the source record this feedback is linked to.
351
351
 
@@ -66,10 +66,20 @@ The detailed breakdown metrics (everything except `total_input` and `total_outpu
66
66
 
67
67
  ### When cost context is attached
68
68
 
69
- Cost context is attached to token metrics when the provider reports a valid cost for every completed model step or when the embedded pricing registry has a matching entry for the provider and model. Mastra sums the per-step provider costs into one query total. If any completed step lacks a valid reported cost, Mastra uses the pricing registry instead of reporting a partial total. If neither source is available, token metrics are still emitted without cost fields.
69
+ Cost context is attached to token metrics when the provider reports a valid cost for every completed model step or when the pricing registry has a matching entry for the provider and model. Mastra sums the per-step provider costs into one query total. If any completed step lacks a valid reported cost, Mastra uses the pricing registry instead of reporting a partial total. If neither source is available, token metrics are still emitted without cost fields.
70
70
 
71
71
  A caller-supplied `costContext` takes precedence over provider-reported costs and pricing registry estimates. Provider-reported totals use `costMetadata.source: 'provider_reported'`, `costMetadata.scope: 'query_total'`, and `costMetadata.reportedStepCount` to identify the source, scope, and number of completed steps included in the total.
72
72
 
73
+ ### Where prices come from
74
+
75
+ The pricing registry uses model prices from [models.dev](https://models.dev). `@mastra/observability` includes a snapshot of these prices, and each new release of the package includes recent prices. Stored cost estimates aren't recalculated when prices change.
76
+
77
+ When you run `mastra dev`, Mastra also refreshes prices from models.dev in the background once a day, and when a model has no price. Cost estimates don't wait for a refresh, so the first call to a newly released model can still have no cost. In other environments, such as production, you can turn on the refresh with `MASTRA_AUTO_REFRESH_PRICING=true`.
78
+
79
+ Refreshed prices are cached in `~/.cache/mastra/pricing-data.json` and reused by later processes. If a refresh fails, Mastra keeps the prices it already has.
80
+
81
+ To use only the bundled snapshot, set `MASTRA_AUTO_REFRESH_PRICING=false`. Setting `MASTRA_OFFLINE=true` also turns off the refresh.
82
+
73
83
  ### What cost fields may be included
74
84
 
75
85
  | Field | Description |
@@ -216,6 +216,9 @@ interface Span<TType extends SpanType> {
216
216
  /** Tags for categorizing traces (only present on root spans) */
217
217
  tags?: string[]
218
218
 
219
+ /** Spans in other traces this span is related to */
220
+ links?: SpanLink[]
221
+
219
222
  /** End the span */
220
223
  end(options?: EndSpanOptions<TType>): void
221
224
 
@@ -778,6 +781,12 @@ interface MCPServerRequestAttributes {
778
781
 
779
782
  /** Client implementation version, when the client reported one */
780
783
  clientVersion?: string
784
+
785
+ /** W3C `traceparent` the caller sent, when it parses */
786
+ callerTraceparent?: string
787
+
788
+ /** W3C `tracestate` the caller sent with a valid `traceparent`, capped at 512 characters */
789
+ callerTracestate?: string
781
790
  }
782
791
  ```
783
792
 
@@ -998,6 +1007,23 @@ interface StartSpanOptions<TType extends SpanType> {
998
1007
 
999
1008
  /** Options passed when using a custom sampler strategy */
1000
1009
  customSamplerOptions?: CustomSamplerOptions
1010
+
1011
+ /** Spans in other traces this span is related to. Links with invalid IDs are ignored. */
1012
+ links?: SpanLink[]
1013
+ }
1014
+ ```
1015
+
1016
+ ### `SpanLink`
1017
+
1018
+ A reference to a span in another trace, such as the caller's span when an `MCPServer` serves a request. Unlike a parent, a link doesn't put the two spans in the same trace.
1019
+
1020
+ ```typescript
1021
+ interface SpanLink {
1022
+ /** Trace ID of the linked span (1-32 hexadecimal characters) */
1023
+ traceId: string
1024
+
1025
+ /** Span ID of the linked span (1-16 hexadecimal characters) */
1026
+ spanId: string
1001
1027
  }
1002
1028
  ```
1003
1029
 
@@ -207,6 +207,8 @@ When tracing is disabled (sampling returns false), NO-OP spans are returned:
207
207
  class NoOpSpan<TType extends SpanType> extends BaseSpan<TType>
208
208
  ```
209
209
 
210
+ `NoOpSpan` is exported from `@mastra/observability`. It extends that package's abstract `BaseSpan` class, which implements the `Span` interface. That class is different from the `BaseSpan` interface described on this page.
211
+
210
212
  A span that performs no operations. All methods are no-ops:
211
213
 
212
214
  - `id` returns `'no-op'`