@mastra/mcp-docs-server 1.2.7-alpha.12 → 1.2.7-alpha.16

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 (52) hide show
  1. package/.docs/docs/agents/using-tools.md +2 -0
  2. package/.docs/docs/evals/datasets/overview.md +2 -0
  3. package/.docs/docs/evals/datasets/running-experiments.md +2 -0
  4. package/.docs/docs/evals/gates-and-verdicts.md +17 -0
  5. package/.docs/docs/getting-started/file-based-agents.md +7 -4
  6. package/.docs/docs/mastra-platform/github.md +2 -2
  7. package/.docs/docs/observability/logging.md +2 -0
  8. package/.docs/docs/observability/metrics/querying.md +2 -0
  9. package/.docs/docs/observability/tracing/overview.md +2 -0
  10. package/.docs/docs/workflows/overview.md +1 -1
  11. package/.docs/models/environment-variables.md +10 -2
  12. package/.docs/models/gateways/azure-openai.md +15 -15
  13. package/.docs/models/gateways/mastra.md +2 -2
  14. package/.docs/models/gateways/openrouter.md +1 -2
  15. package/.docs/models/gateways/vercel.md +4 -1
  16. package/.docs/models/index.md +1 -1
  17. package/.docs/models/providers/ai-router.md +77 -0
  18. package/.docs/models/providers/ambient.md +4 -3
  19. package/.docs/models/providers/blueclaw.md +74 -0
  20. package/.docs/models/providers/crossmodel.md +4 -1
  21. package/.docs/models/providers/daoxe.md +81 -0
  22. package/.docs/models/providers/databricks.md +4 -2
  23. package/.docs/models/providers/deepinfra.md +2 -2
  24. package/.docs/models/providers/ebcloud.md +76 -0
  25. package/.docs/models/providers/hpc-ai.md +16 -10
  26. package/.docs/models/providers/inferx.md +78 -0
  27. package/.docs/models/providers/llmgateway.md +1 -3
  28. package/.docs/models/providers/lynkr.md +73 -0
  29. package/.docs/models/providers/neon.md +1 -1
  30. package/.docs/models/providers/stepfun-ai-step-plan.md +75 -0
  31. package/.docs/models/providers/stepfun-ai.md +6 -6
  32. package/.docs/models/providers/stepfun-step-plan.md +76 -0
  33. package/.docs/models/providers/stepfun.md +5 -5
  34. package/.docs/models/providers/vivgrid.md +5 -2
  35. package/.docs/models/providers/wafer.ai.md +9 -12
  36. package/.docs/models/providers/zenmux.md +5 -1
  37. package/.docs/models/providers.md +10 -2
  38. package/.docs/reference/coding-agent/create-coding-agent.md +5 -4
  39. package/.docs/reference/evals/run-evals.md +2 -2
  40. package/.docs/reference/mastra-platform/api.md +1 -1
  41. package/.docs/reference/observability/metrics/automatic-metrics.md +8 -8
  42. package/.docs/reference/observability/tracing/exporters/braintrust.md +1 -0
  43. package/.docs/reference/observability/tracing/exporters/datadog.md +10 -9
  44. package/.docs/reference/observability/tracing/exporters/langsmith.md +8 -7
  45. package/.docs/reference/observability/tracing/exporters/posthog.md +13 -12
  46. package/.docs/reference/observability/tracing/exporters/sentry.md +1 -0
  47. package/.docs/reference/observability/tracing/interfaces.md +9 -0
  48. package/.docs/reference/processors/stream-error-retry-processor.md +25 -0
  49. package/.docs/reference/server/register-api-route.md +5 -4
  50. package/.docs/reference/templates/overview.md +1 -1
  51. package/CHANGELOG.md +14 -0
  52. package/package.json +5 -5
@@ -1,10 +1,10 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # ![StepFun logo](https://models.dev/logos/stepfun.svg)StepFun
3
+ # ![StepFun (China) logo](https://models.dev/logos/stepfun.svg)StepFun (China)
4
4
 
5
- Access 8 StepFun models through Mastra's model router. Authentication is handled automatically using the `STEPFUN_API_KEY` environment variable.
5
+ Access 8 StepFun (China) models through Mastra's model router. Authentication is handled automatically using the `STEPFUN_API_KEY` environment variable.
6
6
 
7
- Learn more in the [StepFun documentation](https://platform.stepfun.com/docs/zh/overview/concept).
7
+ Learn more in the [StepFun (China) documentation](https://platform.stepfun.com/docs/zh/overview/concept).
8
8
 
9
9
  ```bash
10
10
  STEPFUN_API_KEY=your-api-key
@@ -30,7 +30,7 @@ for await (const chunk of stream) {
30
30
  }
31
31
  ```
32
32
 
33
- > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [StepFun documentation](https://platform.stepfun.com/docs/zh/overview/concept) for details.
33
+ > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [StepFun (China) documentation](https://platform.stepfun.com/docs/zh/overview/concept) for details.
34
34
 
35
35
  ## Models
36
36
 
@@ -40,7 +40,7 @@ for await (const chunk of stream) {
40
40
  | `stepfun/step-2-16k` | 16K | | | | | | $5 | $16 |
41
41
  | `stepfun/step-3.5-flash` | 256K | | | | | | $0.10 | $0.30 |
42
42
  | `stepfun/step-3.5-flash-2603` | 256K | | | | | | $0.10 | $0.30 |
43
- | `stepfun/step-3.7-flash` | 256K | | | | | | $0.20 | $1 |
43
+ | `stepfun/step-3.7-flash` | 256K | | | | | | $0.18 | $1 |
44
44
  | `stepfun/step-tts-2` | — | | | | | | — | — |
45
45
  | `stepfun/stepaudio-2.5-asr` | — | | | | | | — | — |
46
46
  | `stepfun/stepaudio-2.5-tts` | — | | | | | | — | — |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Vivgrid logo](https://models.dev/logos/vivgrid.svg)Vivgrid
4
4
 
5
- Access 14 Vivgrid models through Mastra's model router. Authentication is handled automatically using the `VIVGRID_API_KEY` environment variable.
5
+ Access 17 Vivgrid models through Mastra's model router. Authentication is handled automatically using the `VIVGRID_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Vivgrid documentation](https://docs.vivgrid.com/models).
8
8
 
@@ -50,6 +50,9 @@ for await (const chunk of stream) {
50
50
  | `vivgrid/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
51
51
  | `vivgrid/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
52
52
  | `vivgrid/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
53
+ | `vivgrid/gpt-5.6-luna` | 1.1M | | | | | | $1 | $6 |
54
+ | `vivgrid/gpt-5.6-sol` | 1.1M | | | | | | $5 | $30 |
55
+ | `vivgrid/gpt-5.6-terra` | 1.1M | | | | | | $3 | $15 |
53
56
 
54
57
  ## Advanced configuration
55
58
 
@@ -79,7 +82,7 @@ const agent = new Agent({
79
82
  model: ({ requestContext }) => {
80
83
  const useAdvanced = requestContext.task === "complex";
81
84
  return useAdvanced
82
- ? "vivgrid/gpt-5.5"
85
+ ? "vivgrid/gpt-5.6-terra"
83
86
  : "vivgrid/deepseek-v3.2";
84
87
  }
85
88
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Wafer logo](https://models.dev/logos/wafer.ai.svg)Wafer
4
4
 
5
- Access 8 Wafer models through Mastra's model router. Authentication is handled automatically using the `WAFER_API_KEY` environment variable.
5
+ Access 5 Wafer models through Mastra's model router. Authentication is handled automatically using the `WAFER_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Wafer documentation](https://docs.wafer.ai/wafer-pass).
8
8
 
@@ -34,16 +34,13 @@ for await (const chunk of stream) {
34
34
 
35
35
  ## Models
36
36
 
37
- | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
38
- | ---------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
39
- | `wafer.ai/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
40
- | `wafer.ai/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
41
- | `wafer.ai/GLM-5.1` | 203K | | | | | | $1 | $3 |
42
- | `wafer.ai/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
43
- | `wafer.ai/Kimi-K2.6` | 262K | | | | | | $0.68 | $3 |
44
- | `wafer.ai/Qwen3.5-397B-A17B` | 262K | | | | | | $0.43 | $3 |
45
- | `wafer.ai/Qwen3.6-35B-A3B` | 256K | | | | | | $0.15 | $1 |
46
- | `wafer.ai/qwen3.7-max` | 256K | | | | | | $5 | $15 |
37
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
38
+ | ---------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
39
+ | `wafer.ai/GLM-5.1` | 203K | | | | | | $1 | $3 |
40
+ | `wafer.ai/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
41
+ | `wafer.ai/glm5.2-fast` | 1.0M | | | | | | $3 | $10 |
42
+ | `wafer.ai/Kimi-K2.6` | 262K | | | | | | $1 | $5 |
43
+ | `wafer.ai/MiniMax-M3` | 1.0M | | | | | | $0.33 | $1 |
47
44
 
48
45
  ## Advanced configuration
49
46
 
@@ -73,7 +70,7 @@ const agent = new Agent({
73
70
  model: ({ requestContext }) => {
74
71
  const useAdvanced = requestContext.task === "complex";
75
72
  return useAdvanced
76
- ? "wafer.ai/qwen3.7-max"
73
+ ? "wafer.ai/glm5.2-fast"
77
74
  : "wafer.ai/GLM-5.1";
78
75
  }
79
76
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![ZenMux logo](https://models.dev/logos/zenmux.svg)ZenMux
4
4
 
5
- Access 114 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
5
+ Access 118 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [ZenMux documentation](https://docs.zenmux.ai).
8
8
 
@@ -101,6 +101,9 @@ for await (const chunk of stream) {
101
101
  | `zenmux/openai/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
102
102
  | `zenmux/openai/gpt-5.5-instant` | 400K | | | | | | $5 | $30 |
103
103
  | `zenmux/openai/gpt-5.5-pro` | 1.1M | | | | | | $30 | $180 |
104
+ | `zenmux/openai/gpt-5.6-luna` | 1.1M | | | | | | $1 | $6 |
105
+ | `zenmux/openai/gpt-5.6-sol` | 1.1M | | | | | | $5 | $30 |
106
+ | `zenmux/openai/gpt-5.6-terra` | 1.1M | | | | | | $3 | $15 |
104
107
  | `zenmux/qwen/qwen3-coder-plus` | 1.0M | | | | | | $1 | $5 |
105
108
  | `zenmux/qwen/qwen3-max` | 256K | | | | | | $1 | $6 |
106
109
  | `zenmux/qwen/qwen3.5-flash` | 1.0M | | | | | | $0.10 | $0.40 |
@@ -128,6 +131,7 @@ for await (const chunk of stream) {
128
131
  | `zenmux/x-ai/grok-4.2-fast` | 2.0M | | | | | | $3 | $9 |
129
132
  | `zenmux/x-ai/grok-4.2-fast-non-reasoning` | 2.0M | | | | | | $3 | $9 |
130
133
  | `zenmux/x-ai/grok-4.3` | 1.0M | | | | | | $1 | $3 |
134
+ | `zenmux/x-ai/grok-4.5` | 500K | | | | | | $2 | $6 |
131
135
  | `zenmux/x-ai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
132
136
  | `zenmux/x-ai/grok-code-fast-1` | 256K | | | | | | $0.20 | $2 |
133
137
  | `zenmux/xiaomi/mimo-v2-flash` | 262K | | | | | | $0.10 | $0.30 |
@@ -14,6 +14,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
14
14
  - [302.AI](https://mastra.ai/models/providers/302ai)
15
15
  - [Abacus](https://mastra.ai/models/providers/abacus)
16
16
  - [abliteration.ai](https://mastra.ai/models/providers/abliteration-ai)
17
+ - [AI-ROUTER](https://mastra.ai/models/providers/ai-router)
17
18
  - [Alibaba](https://mastra.ai/models/providers/alibaba)
18
19
  - [Alibaba (China)](https://mastra.ai/models/providers/alibaba-cn)
19
20
  - [Alibaba Coding Plan](https://mastra.ai/models/providers/alibaba-coding-plan)
@@ -27,6 +28,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
27
28
  - [Bailing](https://mastra.ai/models/providers/bailing)
28
29
  - [Baseten](https://mastra.ai/models/providers/baseten)
29
30
  - [Berget.AI](https://mastra.ai/models/providers/berget)
31
+ - [Blue Claw](https://mastra.ai/models/providers/blueclaw)
30
32
  - [Cerebras](https://mastra.ai/models/providers/cerebras)
31
33
  - [Chutes](https://mastra.ai/models/providers/chutes)
32
34
  - [Clarifai](https://mastra.ai/models/providers/clarifai)
@@ -37,10 +39,12 @@ Direct access to individual AI model providers. Each provider offers unique mode
37
39
  - [CrofAI](https://mastra.ai/models/providers/crof)
38
40
  - [CrossModel](https://mastra.ai/models/providers/crossmodel)
39
41
  - [D.Run (China)](https://mastra.ai/models/providers/drun)
42
+ - [DaoXE](https://mastra.ai/models/providers/daoxe)
40
43
  - [Databricks](https://mastra.ai/models/providers/databricks)
41
44
  - [Deep Infra](https://mastra.ai/models/providers/deepinfra)
42
45
  - [DigitalOcean](https://mastra.ai/models/providers/digitalocean)
43
46
  - [DInference](https://mastra.ai/models/providers/dinference)
47
+ - [EBCloud](https://mastra.ai/models/providers/ebcloud)
44
48
  - [EmpirioLabs AI](https://mastra.ai/models/providers/empiriolabs)
45
49
  - [evroc](https://mastra.ai/models/providers/evroc)
46
50
  - [FastRouter](https://mastra.ai/models/providers/fastrouter)
@@ -57,6 +61,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
57
61
  - [Inception](https://mastra.ai/models/providers/inception)
58
62
  - [Inceptron](https://mastra.ai/models/providers/inceptron)
59
63
  - [Inference](https://mastra.ai/models/providers/inference)
64
+ - [InferX](https://mastra.ai/models/providers/inferx)
60
65
  - [IO.NET](https://mastra.ai/models/providers/io-net)
61
66
  - [Jiekou.AI](https://mastra.ai/models/providers/jiekou)
62
67
  - [Kenari](https://mastra.ai/models/providers/kenari)
@@ -70,6 +75,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
70
75
  - [LMStudio](https://mastra.ai/models/providers/lmstudio)
71
76
  - [LongCat](https://mastra.ai/models/providers/longcat)
72
77
  - [LucidQuery](https://mastra.ai/models/providers/lucidquery)
78
+ - [Lynkr](https://mastra.ai/models/providers/lynkr)
73
79
  - [Meganova](https://mastra.ai/models/providers/meganova)
74
80
  - [Meta](https://mastra.ai/models/providers/meta)
75
81
  - [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax)
@@ -114,8 +120,10 @@ Direct access to individual AI model providers. Each provider offers unique mode
114
120
  - [SiliconFlow (China)](https://mastra.ai/models/providers/siliconflow-cn)
115
121
  - [Snowflake Cortex](https://mastra.ai/models/providers/snowflake-cortex)
116
122
  - [STACKIT](https://mastra.ai/models/providers/stackit)
117
- - [StepFun](https://mastra.ai/models/providers/stepfun)
118
- - [StepFun AI](https://mastra.ai/models/providers/stepfun-ai)
123
+ - [StepFun (China)](https://mastra.ai/models/providers/stepfun)
124
+ - [StepFun (Global)](https://mastra.ai/models/providers/stepfun-ai)
125
+ - [StepFun Step Plan (China)](https://mastra.ai/models/providers/stepfun-step-plan)
126
+ - [StepFun Step Plan (Global)](https://mastra.ai/models/providers/stepfun-ai-step-plan)
119
127
  - [Subconscious](https://mastra.ai/models/providers/subconscious)
120
128
  - [submodel](https://mastra.ai/models/providers/submodel)
121
129
  - [Synthetic](https://mastra.ai/models/providers/synthetic)
@@ -38,7 +38,7 @@ const agent = createCodingAgent({
38
38
 
39
39
  **signals** (`SignalProvider[]`): Signal providers for the agent. When omitted, defaults to a single TaskSignalProvider.
40
40
 
41
- **errorProcessors** (`Processor[]`): Error processors for the agent. When omitted, defaults to the ECONNRESET/bad-request retry stack plus PrefillErrorHandler and ProviderHistoryCompat.
41
+ **errorProcessors** (`Processor[]`): Error processors for the agent. When omitted, defaults to unknown stream-error retries with specialized ECONNRESET and bad-request policies, plus PrefillErrorHandler and ProviderHistoryCompat.
42
42
 
43
43
  **goal** (`AgentGoalConfig`): Goal configuration. When provided without a prompt, the prompt defaults to DEFAULT\_GOAL\_JUDGE\_PROMPT.
44
44
 
@@ -54,7 +54,7 @@ The factory only fills a default when you don't provide the corresponding field.
54
54
  | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
55
55
  | `workspace` | A [`Workspace`](https://mastra.ai/reference/workspace/workspace-class) backed by `LocalFilesystem` and `LocalSandbox` rooted at the base path. |
56
56
  | `signals` | A single [`TaskSignalProvider`](https://mastra.ai/reference/signals/task-signal-provider). |
57
- | `errorProcessors` | ECONNRESET and bad-request retry processors plus `PrefillErrorHandler` and `ProviderHistoryCompat`. |
57
+ | `errorProcessors` | Unknown stream-error retries with specialized ECONNRESET and bad-request policies, plus `PrefillErrorHandler` and `ProviderHistoryCompat`. |
58
58
  | `goal.prompt` | `DEFAULT_GOAL_JUDGE_PROMPT` (only when a `goal` is configured). |
59
59
 
60
60
  ### Workspace
@@ -85,12 +85,13 @@ const agent = createCodingAgent({
85
85
 
86
86
  ### Error processors
87
87
 
88
- The default error processors apply a retry policy for transient failures:
88
+ The default [`StreamErrorRetryProcessor`](https://mastra.ai/reference/processors/stream-error-retry-processor) applies these retry policies:
89
89
 
90
+ - Unknown errors left unmatched by provider metadata or a specific matcher retry up to twice with a `3000ms` delay. Known authorization failures surface immediately.
90
91
  - Network resets (`ECONNRESET` / `socket hang up`) retry up to twice with exponential backoff (`1000ms * 2^retryCount`, capped at `30000ms`).
91
92
  - Bad-request errors retry once after `2000ms`.
92
93
 
93
- `PrefillErrorHandler` and `ProviderHistoryCompat` are also included for provider compatibility.
94
+ Specific network-reset and bad-request policies take precedence over the unknown-error policy. Passing `errorProcessors` replaces the default processor stack. `PrefillErrorHandler` and `ProviderHistoryCompat` are also included for provider compatibility.
94
95
 
95
96
  ## Related
96
97
 
@@ -56,9 +56,9 @@ result.thresholdResults // [{ id, passed, averageScore, threshold }]
56
56
 
57
57
  **data** (`RunEvalsDataItem[]`): Array of test cases with input data and optional ground truth.
58
58
 
59
- **scorers** (`ScorerEntry[] | AgentScorerConfig | WorkflowScorerConfig`): Scorers to use. Each entry is either a bare MastraScorer or { scorer, threshold } for threshold tracking. An AgentScorerConfig object separates agent-level and trajectory scorers. A WorkflowScorerConfig object specifies scorers for the workflow, individual steps, and trajectory.
59
+ **scorers** (`ScorerEntry[] | AgentScorerConfig | WorkflowScorerConfig`): Scorers to use. Each entry is either a bare MastraScorer or { scorer, threshold } for threshold tracking. An AgentScorerConfig object separates agent-level and trajectory scorers. A WorkflowScorerConfig object specifies scorers for the workflow, individual steps, and trajectory. Optional when at least one gate is provided (gate-only runs).
60
60
 
61
- **gates** (`MastraScorer[]`): Scorers that must score 1.0 for the run to pass. If any gate averages below 1.0 across data items, the verdict is failed. Gates run before regular scorers on each data item.
61
+ **gates** (`MastraScorer[]`): Scorers that must score 1.0 for the run to pass. If any gate averages below 1.0 across data items, the verdict is failed. Gates run before regular scorers on each data item. When provided, scorers may be omitted.
62
62
 
63
63
  **targetOptions** (`AgentExecutionOptions | WorkflowRunOptions`): Options forwarded to the target during execution. For agents: options passed to agent.generate() (e.g. maxSteps, modelSettings, instructions). For workflows: options passed to run.start() (e.g. perStep, outputOptions, initialState).
64
64
 
@@ -107,4 +107,4 @@ The root URL for the endpoints below is: `/v1/gateway`
107
107
 
108
108
  ## Gateway proxy endpoints
109
109
 
110
- Visit the [Memory Gateway documentation](https://gateway.mastra.ai/docs) for more details.
110
+ Visit the [Gateway documentation](https://gateway.mastra.ai/docs) for more details.
@@ -23,13 +23,13 @@ If metrics aren't available, see [troubleshooting](#troubleshooting).
23
23
 
24
24
  Duration metrics record execution time in milliseconds, calculated from the span's start and end timestamps. Each duration metric includes a `status` label set to `ok` or `error`, derived from the span's status.
25
25
 
26
- | Metric name | Span type | Description |
27
- | ------------------------------ | ---------------------------- | ------------------------------------------------------- |
28
- | `mastra_agent_duration_ms` | `AGENT_RUN` | Execution time of an agent run |
29
- | `mastra_tool_duration_ms` | `TOOL_CALL`, `MCP_TOOL_CALL` | Execution time of a tool call, including MCP tool calls |
30
- | `mastra_workflow_duration_ms` | `WORKFLOW_RUN` | Execution time of a workflow run |
31
- | `mastra_model_duration_ms` | `MODEL_GENERATION` | Execution time of a model generation |
32
- | `mastra_processor_duration_ms` | `PROCESSOR_RUN` | Execution time of a processor run |
26
+ | Metric name | Span type | Description |
27
+ | ------------------------------ | -------------------------------------------------- | ----------------------------------------------------------------------------- |
28
+ | `mastra_agent_duration_ms` | `AGENT_RUN` | Execution time of an agent run |
29
+ | `mastra_tool_duration_ms` | `TOOL_CALL`, `MCP_TOOL_CALL`, `PROVIDER_TOOL_CALL` | Execution time of a tool call, including MCP and provider-executed tool calls |
30
+ | `mastra_workflow_duration_ms` | `WORKFLOW_RUN` | Execution time of a workflow run |
31
+ | `mastra_model_duration_ms` | `MODEL_GENERATION` | Execution time of a model generation |
32
+ | `mastra_processor_duration_ms` | `PROCESSOR_RUN` | Execution time of a processor run |
33
33
 
34
34
  ## Token usage metrics
35
35
 
@@ -124,7 +124,7 @@ When you spot a spike in latency or token usage on the Metrics dashboard, correl
124
124
  ### Duration metrics are missing
125
125
 
126
126
  - **Span has timestamps**: Duration is calculated from `startTime` and `endTime`. If either is missing, the metric is skipped.
127
- - **Span type maps to a metric**: Only `AGENT_RUN`, `TOOL_CALL`, `MCP_TOOL_CALL`, `WORKFLOW_RUN`, `MODEL_GENERATION`, and `PROCESSOR_RUN` spans produce duration metrics.
127
+ - **Span type maps to a metric**: Only `AGENT_RUN`, `TOOL_CALL`, `MCP_TOOL_CALL`, `PROVIDER_TOOL_CALL`, `WORKFLOW_RUN`, `MODEL_GENERATION`, and `PROCESSOR_RUN` spans produce duration metrics.
128
128
 
129
129
  ### Token metrics are missing
130
130
 
@@ -92,6 +92,7 @@ const exporter = new BraintrustExporter({
92
92
  | `MODEL_CHUNK` | `llm` |
93
93
  | `TOOL_CALL` | `tool` |
94
94
  | `MCP_TOOL_CALL` | `tool` |
95
+ | `PROVIDER_TOOL_CALL` | `tool` |
95
96
  | `WORKFLOW_CONDITIONAL_EVAL` | `function` |
96
97
  | `WORKFLOW_WAIT_EVENT` | `function` |
97
98
  | All others | `task` |
@@ -95,15 +95,16 @@ const exporter = new DatadogExporter({
95
95
 
96
96
  Mastra span types are mapped to Datadog LLM Observability span kinds:
97
97
 
98
- | Mastra SpanType | Datadog Kind |
99
- | ------------------ | ------------ |
100
- | `AGENT_RUN` | `agent` |
101
- | `MODEL_GENERATION` | `workflow` |
102
- | `MODEL_STEP` | `llm` |
103
- | `TOOL_CALL` | `tool` |
104
- | `MCP_TOOL_CALL` | `tool` |
105
- | `WORKFLOW_RUN` | `workflow` |
106
- | All other types | `task` |
98
+ | Mastra SpanType | Datadog Kind |
99
+ | -------------------- | ------------ |
100
+ | `AGENT_RUN` | `agent` |
101
+ | `MODEL_GENERATION` | `workflow` |
102
+ | `MODEL_STEP` | `llm` |
103
+ | `TOOL_CALL` | `tool` |
104
+ | `MCP_TOOL_CALL` | `tool` |
105
+ | `PROVIDER_TOOL_CALL` | `tool` |
106
+ | `WORKFLOW_RUN` | `workflow` |
107
+ | All other types | `task` |
107
108
 
108
109
  All unmapped span types (including `MODEL_CHUNK`, `WORKFLOW_STEP`, `GENERIC`, and future span types) automatically default to `task`.
109
110
 
@@ -73,13 +73,14 @@ const exporter = new LangSmithExporter({
73
73
 
74
74
  ## Span type mapping
75
75
 
76
- | Span Type | LangSmith Type |
77
- | ------------------ | -------------- |
78
- | `MODEL_GENERATION` | `llm` |
79
- | `MODEL_CHUNK` | `llm` |
80
- | `TOOL_CALL` | `tool` |
81
- | `MCP_TOOL_CALL` | `tool` |
82
- | All others | `chain` |
76
+ | Span Type | LangSmith Type |
77
+ | -------------------- | -------------- |
78
+ | `MODEL_GENERATION` | `llm` |
79
+ | `MODEL_CHUNK` | `llm` |
80
+ | `TOOL_CALL` | `tool` |
81
+ | `MCP_TOOL_CALL` | `tool` |
82
+ | `PROVIDER_TOOL_CALL` | `tool` |
83
+ | All others | `chain` |
83
84
 
84
85
  ## `withLangsmithMetadata`
85
86
 
@@ -80,15 +80,16 @@ const exporter = new PosthogExporter({
80
80
 
81
81
  ## Span type mapping
82
82
 
83
- | Mastra Span Type | PostHog Event Type |
84
- | ------------------- | ------------------ |
85
- | `MODEL_GENERATION` | `$ai_generation` |
86
- | `MODEL_STEP` | `$ai_generation` |
87
- | `MODEL_CHUNK` | `$ai_span` |
88
- | `TOOL_CALL` | `$ai_span` |
89
- | `MCP_TOOL_CALL` | `$ai_span` |
90
- | `PROCESSOR_RUN` | `$ai_span` |
91
- | `AGENT_RUN` | `$ai_span` |
92
- | `WORKFLOW_RUN` | `$ai_span` |
93
- | All other workflows | `$ai_span` |
94
- | `GENERIC` | `$ai_span` |
83
+ | Mastra Span Type | PostHog Event Type |
84
+ | -------------------- | ------------------ |
85
+ | `MODEL_GENERATION` | `$ai_generation` |
86
+ | `MODEL_STEP` | `$ai_generation` |
87
+ | `MODEL_CHUNK` | `$ai_span` |
88
+ | `TOOL_CALL` | `$ai_span` |
89
+ | `MCP_TOOL_CALL` | `$ai_span` |
90
+ | `PROVIDER_TOOL_CALL` | `$ai_span` |
91
+ | `PROCESSOR_RUN` | `$ai_span` |
92
+ | `AGENT_RUN` | `$ai_span` |
93
+ | `WORKFLOW_RUN` | `$ai_span` |
94
+ | All other workflows | `$ai_span` |
95
+ | `GENERIC` | `$ai_span` |
@@ -117,6 +117,7 @@ Mastra span types are mapped to Sentry operations:
117
117
  | `MODEL_CHUNK` | _(skipped)_ |
118
118
  | `TOOL_CALL` | `gen_ai.execute_tool` |
119
119
  | `MCP_TOOL_CALL` | `gen_ai.execute_tool` |
120
+ | `PROVIDER_TOOL_CALL` | `gen_ai.execute_tool` |
120
121
  | `WORKFLOW_RUN` | `workflow.run` |
121
122
  | `WORKFLOW_STEP` | `workflow.step` |
122
123
  | `WORKFLOW_CONDITIONAL` | `workflow.conditional` |
@@ -46,6 +46,7 @@ interface SpanTypeMap {
46
46
  MODEL_CHUNK: ModelChunkAttributes
47
47
  TOOL_CALL: ToolCallAttributes
48
48
  CLIENT_TOOL_CALL: ClientToolCallAttributes
49
+ PROVIDER_TOOL_CALL: ProviderToolCallAttributes
49
50
  MCP_TOOL_CALL: MCPToolCallAttributes
50
51
  PROCESSOR_RUN: ProcessorRunAttributes
51
52
  WORKFLOW_STEP: WorkflowStepAttributes
@@ -314,6 +315,14 @@ enum SpanType {
314
315
  */
315
316
  CLIENT_TOOL_CALL = 'client_tool_call',
316
317
 
318
+ /**
319
+ * Provider-executed (server-side) tool span. Reconstructed from
320
+ * tool-call and tool-result stream chunks for tools the model
321
+ * provider executes (e.g. Anthropic code execution, server-side
322
+ * web search). Opened on tool-call chunk, closed on tool-result.
323
+ */
324
+ PROVIDER_TOOL_CALL = 'provider_tool_call',
325
+
317
326
  /** Workflow run - root span for workflow processes */
318
327
  WORKFLOW_RUN = 'workflow_run',
319
328
 
@@ -35,6 +35,31 @@ When the error is retryable, the processor returns `{ retry: true }`. It doesn't
35
35
 
36
36
  When `delayMs` is set, the processor waits before signaling a retry. This is useful for transient network errors like `ECONNRESET` where immediately retrying is likely to fail again. The delay can be a fixed number of milliseconds or a function evaluated with the error args (for example, to implement exponential backoff).
37
37
 
38
+ ## Retry unknown errors
39
+
40
+ Set `retryUnknownErrors` to retry errors that don't match provider metadata, the built-in OpenAI matcher, or a custom matcher. Unknown-error retries use the processor-level `maxRetries` and `delayMs` values. Known authorization failures, including HTTP `401` and `403` responses, aren't retried:
41
+
42
+ ```typescript
43
+ import { Agent } from '@mastra/core/agent'
44
+ import { StreamErrorRetryProcessor } from '@mastra/core/processors'
45
+
46
+ export const agent = new Agent({
47
+ id: 'resilient-agent',
48
+ name: 'Resilient agent',
49
+ instructions: 'You are a helpful assistant.',
50
+ model: 'openai/gpt-5',
51
+ errorProcessors: [
52
+ new StreamErrorRetryProcessor({
53
+ retryUnknownErrors: true,
54
+ maxRetries: 2,
55
+ delayMs: 3000,
56
+ }),
57
+ ],
58
+ })
59
+ ```
60
+
61
+ Specific matcher policies still take precedence over the unknown-error values. The option defaults to `false`, so unknown errors aren't retried unless you enable it.
62
+
38
63
  ## Delaying retries
39
64
 
40
65
  Use `delayMs` with a custom matcher to retry transient network resets with a wait:
@@ -28,7 +28,7 @@ registerApiRoute("/items/:itemId", { ... })
28
28
 
29
29
  **handler** (`Handler`): Route handler function receiving Hono Context. Use either handler or createHandler, not both.
30
30
 
31
- **createHandler** (`(c: Context) => Promise<Handler>`): Async factory function to create the handler. Use either handler or createHandler, not both.
31
+ **createHandler** (`({ mastra }: { mastra: Mastra }) => Promise<ApiRouteHandler>`): Async factory that receives the Mastra instance and returns the route handler. Runs once at server startup, so it can perform one-time setup. Use either handler or createHandler, not both.
32
32
 
33
33
  **middleware** (`MiddlewareHandler | MiddlewareHandler[]`): Route-specific middleware functions
34
34
 
@@ -229,12 +229,13 @@ For routes that need async initialization:
229
229
  ```typescript
230
230
  registerApiRoute('/dynamic', {
231
231
  method: 'GET',
232
- createHandler: async c => {
233
- // Perform async setup
232
+ createHandler: async ({ mastra }) => {
233
+ // Perform one-time async setup
234
234
  const config = await loadConfig()
235
+ const agent = mastra.getAgent('weatherAgent')
235
236
 
236
237
  return async c => {
237
- return c.json({ config })
238
+ return c.json({ config, agent: agent.name })
238
239
  }
239
240
  },
240
241
  })
@@ -15,7 +15,7 @@ Mastra templates are pre-built project structures that demonstrate specific use
15
15
 
16
16
  The following templates demonstrate Gateway-first Mastra applications:
17
17
 
18
- - `template-docs-expert`: Answers documentation questions with Mastra Gateway web search, citations, memory, and structured responses.
18
+ - `template-docs-expert`: Answers documentation questions with Gateway web search, citations, memory, and structured responses.
19
19
  - `template-browser-agent`: Uses AgentBrowser to browse, inspect, and interact with web pages.
20
20
  - `template-meeting-notes`: Turns Zoom transcripts or uploaded transcripts into structured notes with decisions and action items.
21
21
  - `template-company-knowledge`: Indexes Linear and Notion content into pgvector and answers internal knowledge questions.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.7-alpha.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`25e7c12`](https://github.com/mastra-ai/mastra/commit/25e7c126a770069ae7fb7ecf1d2adb40e017b009), [`1ce5121`](https://github.com/mastra-ai/mastra/commit/1ce512155d122bb21f47d98383e82ffbf84b39e8), [`3cfc47a`](https://github.com/mastra-ai/mastra/commit/3cfc47a6b89940aadd0f46fb01ae9624a73a865d), [`2bb7817`](https://github.com/mastra-ai/mastra/commit/2bb78176112fde628483de2830528f7eee911e56), [`51d9870`](https://github.com/mastra-ai/mastra/commit/51d987032c689c2855374d0f244f5d654da809d1), [`5cab274`](https://github.com/mastra-ai/mastra/commit/5cab2744250e22d12fefa7b32637dce224233cee), [`7fa27d3`](https://github.com/mastra-ai/mastra/commit/7fa27d3b6f5ed68cd34e454a4d3ad9c482a0cfbc), [`a58dcbb`](https://github.com/mastra-ai/mastra/commit/a58dcbb546d7e1d65ebdc1f39e55f0908fcd9391), [`153bd3b`](https://github.com/mastra-ai/mastra/commit/153bd3b396bdfed6b74cf43de12db8fd2d83c04a), [`07bb863`](https://github.com/mastra-ai/mastra/commit/07bb8631919c6f7cf377dccd45b096e0f17fbed0), [`8a586ec`](https://github.com/mastra-ai/mastra/commit/8a586eca9a4914f31dff6140d0d45ac375b00669), [`3927473`](https://github.com/mastra-ai/mastra/commit/392747323ddb10c643d12be7b9ae913159dfaeed), [`dce50dc`](https://github.com/mastra-ai/mastra/commit/dce50dc9a1c1fcd0f427bb5f6250ec74910cb04b), [`634caff`](https://github.com/mastra-ai/mastra/commit/634caff29a9200ad058b67d53f96d9e5832fb8a2)]:
8
+ - @mastra/core@1.51.0-alpha.7
9
+
10
+ ## 1.2.7-alpha.13
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`e2d5f37`](https://github.com/mastra-ai/mastra/commit/e2d5f373bd289be534d5f8694d34465010533df6)]:
15
+ - @mastra/core@1.51.0-alpha.6
16
+
3
17
  ## 1.2.7-alpha.11
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.7-alpha.12",
3
+ "version": "1.2.7-alpha.16",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,8 +28,8 @@
28
28
  "jsdom": "^26.1.0",
29
29
  "local-pkg": "^1.1.2",
30
30
  "zod": "^4.4.3",
31
- "@mastra/mcp": "^1.14.0-alpha.0",
32
- "@mastra/core": "1.51.0-alpha.5"
31
+ "@mastra/core": "1.51.0-alpha.7",
32
+ "@mastra/mcp": "^1.14.0-alpha.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^1.19.11",
@@ -45,9 +45,9 @@
45
45
  "tsx": "^4.22.4",
46
46
  "typescript": "^6.0.3",
47
47
  "vitest": "4.1.9",
48
- "@internal/lint": "0.0.113",
49
48
  "@internal/types-builder": "0.0.88",
50
- "@mastra/core": "1.51.0-alpha.5"
49
+ "@mastra/core": "1.51.0-alpha.7",
50
+ "@internal/lint": "0.0.113"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {