@mastra/mcp-docs-server 1.2.7-alpha.14 → 1.2.7-alpha.18

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 (46) 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 +6 -2
  12. package/.docs/models/gateways/azure-openai.md +15 -15
  13. package/.docs/models/gateways/mastra.md +2 -2
  14. package/.docs/models/index.md +1 -1
  15. package/.docs/models/providers/ambient.md +7 -5
  16. package/.docs/models/providers/crossmodel.md +5 -2
  17. package/.docs/models/providers/databricks.md +4 -1
  18. package/.docs/models/providers/deepseek.md +2 -2
  19. package/.docs/models/providers/ebcloud.md +76 -0
  20. package/.docs/models/providers/empiriolabs.md +3 -1
  21. package/.docs/models/providers/google.md +4 -0
  22. package/.docs/models/providers/llmgateway.md +1 -5
  23. package/.docs/models/providers/lynkr.md +73 -0
  24. package/.docs/models/providers/openai.md +10 -2
  25. package/.docs/models/providers/snowflake-cortex.md +4 -1
  26. package/.docs/models/providers/stepfun-ai-step-plan.md +75 -0
  27. package/.docs/models/providers/stepfun-ai.md +6 -6
  28. package/.docs/models/providers/stepfun-step-plan.md +76 -0
  29. package/.docs/models/providers/stepfun.md +5 -5
  30. package/.docs/models/providers/xai.md +1 -1
  31. package/.docs/models/providers.md +6 -2
  32. package/.docs/reference/coding-agent/create-coding-agent.md +5 -4
  33. package/.docs/reference/evals/run-evals.md +2 -2
  34. package/.docs/reference/mastra-platform/api.md +1 -1
  35. package/.docs/reference/observability/metrics/automatic-metrics.md +8 -8
  36. package/.docs/reference/observability/tracing/exporters/braintrust.md +1 -0
  37. package/.docs/reference/observability/tracing/exporters/datadog.md +10 -9
  38. package/.docs/reference/observability/tracing/exporters/langsmith.md +8 -7
  39. package/.docs/reference/observability/tracing/exporters/posthog.md +13 -12
  40. package/.docs/reference/observability/tracing/exporters/sentry.md +1 -0
  41. package/.docs/reference/observability/tracing/interfaces.md +9 -0
  42. package/.docs/reference/processors/stream-error-retry-processor.md +25 -0
  43. package/.docs/reference/server/register-api-route.md +5 -4
  44. package/.docs/reference/templates/overview.md +1 -1
  45. package/CHANGELOG.md +14 -0
  46. package/package.json +8 -8
@@ -142,7 +142,7 @@ const response = await agent.generate("Hello!", {
142
142
 
143
143
  **conversation** (`string | null | undefined`)
144
144
 
145
- **include** (`("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined`)
145
+ **include** (`("web_search_call.results" | "file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined`)
146
146
 
147
147
  **instructions** (`string | null | undefined`)
148
148
 
@@ -158,18 +158,26 @@ const response = await agent.generate("Hello!", {
158
158
 
159
159
  **promptCacheKey** (`string | null | undefined`)
160
160
 
161
+ **promptCacheOptions** (`{ mode?: "explicit" | "implicit" | undefined; ttl?: "30m" | undefined; } | undefined`)
162
+
161
163
  **promptCacheRetention** (`"in_memory" | "24h" | null | undefined`)
162
164
 
163
165
  **reasoningEffort** (`string | null | undefined`)
164
166
 
167
+ **reasoningMode** (`"standard" | "pro" | undefined`)
168
+
169
+ **reasoningContext** (`"auto" | "current_turn" | "all_turns" | undefined`)
170
+
165
171
  **reasoningSummary** (`string | null | undefined`)
166
172
 
167
173
  **safetyIdentifier** (`string | null | undefined`)
168
174
 
169
- **serviceTier** (`"default" | "auto" | "flex" | "priority" | null | undefined`)
175
+ **serviceTier** (`"auto" | "default" | "flex" | "priority" | null | undefined`)
170
176
 
171
177
  **store** (`boolean | null | undefined`): Controls whether OpenAI stores your API requests for model training. Required to be "false" if your organization has zero data retention enabled. See: https\://platform.openai.com/docs/guides/your-data#zero-data-retention
172
178
 
179
+ **passThroughUnsupportedFiles** (`boolean | undefined`)
180
+
173
181
  **strictJsonSchema** (`boolean | null | undefined`)
174
182
 
175
183
  **textVerbosity** (`"low" | "medium" | "high" | null | undefined`)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Snowflake Cortex logo](https://models.dev/logos/snowflake-cortex.svg)Snowflake Cortex
4
4
 
5
- Access 18 Snowflake Cortex models through Mastra's model router. Authentication is handled automatically using the `SNOWFLAKE_CORTEX_PAT` environment variable. Configure `SNOWFLAKE_ACCOUNT` as well.
5
+ Access 21 Snowflake Cortex models through Mastra's model router. Authentication is handled automatically using the `SNOWFLAKE_CORTEX_PAT` environment variable. Configure `SNOWFLAKE_ACCOUNT` as well.
6
6
 
7
7
  Learn more in the [Snowflake Cortex documentation](https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-rest-api).
8
8
 
@@ -54,6 +54,9 @@ for await (const chunk of stream) {
54
54
  | `snowflake-cortex/openai-gpt-5.2` | 400K | | | | | | — | — |
55
55
  | `snowflake-cortex/openai-gpt-5.4` | 1.1M | | | | | | — | — |
56
56
  | `snowflake-cortex/openai-gpt-5.5` | 1.1M | | | | | | — | — |
57
+ | `snowflake-cortex/openai-gpt-5.6-luna` | 1.1M | | | | | | — | — |
58
+ | `snowflake-cortex/openai-gpt-5.6-sol` | 1.1M | | | | | | — | — |
59
+ | `snowflake-cortex/openai-gpt-5.6-terra` | 1.1M | | | | | | — | — |
57
60
  | `snowflake-cortex/snowflake-llama3.3-70b` | 128K | | | | | | — | — |
58
61
 
59
62
  ## Advanced configuration
@@ -0,0 +1,75 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # ![StepFun Step Plan (Global) logo](https://models.dev/logos/stepfun-ai-step-plan.svg)StepFun Step Plan (Global)
4
+
5
+ Access 3 StepFun Step Plan (Global) models through Mastra's model router. Authentication is handled automatically using the `STEPFUN_API_KEY` environment variable.
6
+
7
+ Learn more in the [StepFun Step Plan (Global) documentation](https://platform.stepfun.ai/docs/en/step-plan/integrations/reasoning-api).
8
+
9
+ ```bash
10
+ STEPFUN_API_KEY=your-api-key
11
+ ```
12
+
13
+ ```typescript
14
+ import { Agent } from "@mastra/core/agent";
15
+
16
+ const agent = new Agent({
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "stepfun-ai-step-plan/step-3.5-flash"
21
+ });
22
+
23
+ // Generate a response
24
+ const response = await agent.generate("Hello!");
25
+
26
+ // Stream a response
27
+ const stream = await agent.stream("Tell me a story");
28
+ for await (const chunk of stream) {
29
+ console.log(chunk);
30
+ }
31
+ ```
32
+
33
+ > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [StepFun Step Plan (Global) documentation](https://platform.stepfun.ai/docs/en/step-plan/integrations/reasoning-api) for details.
34
+
35
+ ## Models
36
+
37
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
38
+ | ------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
39
+ | `stepfun-ai-step-plan/step-3.5-flash` | 256K | | | | | | — | — |
40
+ | `stepfun-ai-step-plan/step-3.5-flash-2603` | 256K | | | | | | — | — |
41
+ | `stepfun-ai-step-plan/step-3.7-flash` | 256K | | | | | | — | — |
42
+
43
+ ## Advanced configuration
44
+
45
+ ### Custom headers
46
+
47
+ ```typescript
48
+ const agent = new Agent({
49
+ id: "custom-agent",
50
+ name: "custom-agent",
51
+ model: {
52
+ url: "https://api.stepfun.ai/step_plan/v1",
53
+ id: "stepfun-ai-step-plan/step-3.5-flash",
54
+ apiKey: process.env.STEPFUN_API_KEY,
55
+ headers: {
56
+ "X-Custom-Header": "value"
57
+ }
58
+ }
59
+ });
60
+ ```
61
+
62
+ ### Dynamic model selection
63
+
64
+ ```typescript
65
+ const agent = new Agent({
66
+ id: "dynamic-agent",
67
+ name: "Dynamic Agent",
68
+ model: ({ requestContext }) => {
69
+ const useAdvanced = requestContext.task === "complex";
70
+ return useAdvanced
71
+ ? "stepfun-ai-step-plan/step-3.7-flash"
72
+ : "stepfun-ai-step-plan/step-3.5-flash";
73
+ }
74
+ });
75
+ ```
@@ -1,10 +1,10 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # ![StepFun AI logo](https://models.dev/logos/stepfun-ai.svg)StepFun AI
3
+ # ![StepFun (Global) logo](https://models.dev/logos/stepfun-ai.svg)StepFun (Global)
4
4
 
5
- Access 8 StepFun AI models through Mastra's model router. Authentication is handled automatically using the `STEPFUN_API_KEY` environment variable.
5
+ Access 8 StepFun (Global) 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 AI documentation](https://platform.stepfun.ai/docs/en/step-plan/integrations/open-code).
7
+ Learn more in the [StepFun (Global) documentation](https://platform.stepfun.ai/docs/en/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 AI documentation](https://platform.stepfun.ai/docs/en/step-plan/integrations/open-code) for details.
33
+ > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [StepFun (Global) documentation](https://platform.stepfun.ai/docs/en/overview/concept) for details.
34
34
 
35
35
  ## Models
36
36
 
@@ -40,7 +40,7 @@ for await (const chunk of stream) {
40
40
  | `stepfun-ai/step-2-16k` | 16K | | | | | | $5 | $16 |
41
41
  | `stepfun-ai/step-3.5-flash` | 256K | | | | | | $0.10 | $0.30 |
42
42
  | `stepfun-ai/step-3.5-flash-2603` | 256K | | | | | | $0.10 | $0.30 |
43
- | `stepfun-ai/step-3.7-flash` | 256K | | | | | | $0.20 | $1 |
43
+ | `stepfun-ai/step-3.7-flash` | 256K | | | | | | $0.18 | $1 |
44
44
  | `stepfun-ai/step-tts-2` | — | | | | | | — | — |
45
45
  | `stepfun-ai/stepaudio-2.5-asr` | — | | | | | | — | — |
46
46
  | `stepfun-ai/stepaudio-2.5-tts` | — | | | | | | — | — |
@@ -54,7 +54,7 @@ const agent = new Agent({
54
54
  id: "custom-agent",
55
55
  name: "custom-agent",
56
56
  model: {
57
- url: "https://api.stepfun.ai/step_plan/v1",
57
+ url: "https://api.stepfun.ai/v1",
58
58
  id: "stepfun-ai/step-1-32k",
59
59
  apiKey: process.env.STEPFUN_API_KEY,
60
60
  headers: {
@@ -0,0 +1,76 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # ![StepFun Step Plan (China) logo](https://models.dev/logos/stepfun-step-plan.svg)StepFun Step Plan (China)
4
+
5
+ Access 4 StepFun Step Plan (China) models through Mastra's model router. Authentication is handled automatically using the `STEPFUN_API_KEY` environment variable.
6
+
7
+ Learn more in the [StepFun Step Plan (China) documentation](https://platform.stepfun.com/docs/zh/step-plan/integrations/reasoning-api).
8
+
9
+ ```bash
10
+ STEPFUN_API_KEY=your-api-key
11
+ ```
12
+
13
+ ```typescript
14
+ import { Agent } from "@mastra/core/agent";
15
+
16
+ const agent = new Agent({
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "stepfun-step-plan/step-3.5-flash"
21
+ });
22
+
23
+ // Generate a response
24
+ const response = await agent.generate("Hello!");
25
+
26
+ // Stream a response
27
+ const stream = await agent.stream("Tell me a story");
28
+ for await (const chunk of stream) {
29
+ console.log(chunk);
30
+ }
31
+ ```
32
+
33
+ > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [StepFun Step Plan (China) documentation](https://platform.stepfun.com/docs/zh/step-plan/integrations/reasoning-api) for details.
34
+
35
+ ## Models
36
+
37
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
38
+ | --------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
39
+ | `stepfun-step-plan/step-3.5-flash` | 256K | | | | | | — | — |
40
+ | `stepfun-step-plan/step-3.5-flash-2603` | 256K | | | | | | — | — |
41
+ | `stepfun-step-plan/step-3.7-flash` | 256K | | | | | | — | — |
42
+ | `stepfun-step-plan/step-router-v1` | 256K | | | | | | — | — |
43
+
44
+ ## Advanced configuration
45
+
46
+ ### Custom headers
47
+
48
+ ```typescript
49
+ const agent = new Agent({
50
+ id: "custom-agent",
51
+ name: "custom-agent",
52
+ model: {
53
+ url: "https://api.stepfun.com/step_plan/v1",
54
+ id: "stepfun-step-plan/step-3.5-flash",
55
+ apiKey: process.env.STEPFUN_API_KEY,
56
+ headers: {
57
+ "X-Custom-Header": "value"
58
+ }
59
+ }
60
+ });
61
+ ```
62
+
63
+ ### Dynamic model selection
64
+
65
+ ```typescript
66
+ const agent = new Agent({
67
+ id: "dynamic-agent",
68
+ name: "Dynamic Agent",
69
+ model: ({ requestContext }) => {
70
+ const useAdvanced = requestContext.task === "complex";
71
+ return useAdvanced
72
+ ? "stepfun-step-plan/step-router-v1"
73
+ : "stepfun-step-plan/step-3.5-flash";
74
+ }
75
+ });
76
+ ```
@@ -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` | — | | | | | | — | — |
@@ -93,7 +93,7 @@ const response = await agent.generate("Hello!", {
93
93
 
94
94
  ### Available Options
95
95
 
96
- **reasoningEffort** (`"low" | "high" | undefined`)
96
+ **reasoningEffort** (`"none" | "low" | "medium" | "high" | undefined`)
97
97
 
98
98
  **logprobs** (`boolean | undefined`)
99
99
 
@@ -44,6 +44,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
44
44
  - [Deep Infra](https://mastra.ai/models/providers/deepinfra)
45
45
  - [DigitalOcean](https://mastra.ai/models/providers/digitalocean)
46
46
  - [DInference](https://mastra.ai/models/providers/dinference)
47
+ - [EBCloud](https://mastra.ai/models/providers/ebcloud)
47
48
  - [EmpirioLabs AI](https://mastra.ai/models/providers/empiriolabs)
48
49
  - [evroc](https://mastra.ai/models/providers/evroc)
49
50
  - [FastRouter](https://mastra.ai/models/providers/fastrouter)
@@ -74,6 +75,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
74
75
  - [LMStudio](https://mastra.ai/models/providers/lmstudio)
75
76
  - [LongCat](https://mastra.ai/models/providers/longcat)
76
77
  - [LucidQuery](https://mastra.ai/models/providers/lucidquery)
78
+ - [Lynkr](https://mastra.ai/models/providers/lynkr)
77
79
  - [Meganova](https://mastra.ai/models/providers/meganova)
78
80
  - [Meta](https://mastra.ai/models/providers/meta)
79
81
  - [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax)
@@ -118,8 +120,10 @@ Direct access to individual AI model providers. Each provider offers unique mode
118
120
  - [SiliconFlow (China)](https://mastra.ai/models/providers/siliconflow-cn)
119
121
  - [Snowflake Cortex](https://mastra.ai/models/providers/snowflake-cortex)
120
122
  - [STACKIT](https://mastra.ai/models/providers/stackit)
121
- - [StepFun](https://mastra.ai/models/providers/stepfun)
122
- - [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)
123
127
  - [Subconscious](https://mastra.ai/models/providers/subconscious)
124
128
  - [submodel](https://mastra.ai/models/providers/submodel)
125
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.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`bd6d240`](https://github.com/mastra-ai/mastra/commit/bd6d2402db93dddaef0721667e7e8a030e7c6e16), [`0111486`](https://github.com/mastra-ai/mastra/commit/01114867612593eef5cfa2fda6a1194dfedda841), [`96a3749`](https://github.com/mastra-ai/mastra/commit/96a37492235f5b8076b3e3177d83ed5a5e44a640), [`3e26c87`](https://github.com/mastra-ai/mastra/commit/3e26c87de0c5bc2583b795ce6ca5889b6b161acb), [`a5008f2`](https://github.com/mastra-ai/mastra/commit/a5008f22ae710ad9402ea9f2547d8c02f74d384b)]:
8
+ - @mastra/core@1.51.0-alpha.8
9
+
10
+ ## 1.2.7-alpha.15
11
+
12
+ ### Patch Changes
13
+
14
+ - 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)]:
15
+ - @mastra/core@1.51.0-alpha.7
16
+
3
17
  ## 1.2.7-alpha.13
4
18
 
5
19
  ### Patch Changes