@mastra/mcp-docs-server 1.2.14-alpha.1 → 1.2.14-alpha.4

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 (127) hide show
  1. package/.docs/docs/agents/a2a.md +1 -1
  2. package/.docs/docs/agents/acp.md +1 -1
  3. package/.docs/docs/agents/agent-approval.md +1 -1
  4. package/.docs/docs/agents/networks.md +2 -2
  5. package/.docs/docs/agents/overview.md +2 -2
  6. package/.docs/docs/agents/processors.md +25 -1
  7. package/.docs/docs/agents/using-tools.md +2 -2
  8. package/.docs/docs/capabilities/channels/overview.md +1 -1
  9. package/.docs/docs/{agents/supervisor-agents.md → capabilities/subagents.md} +58 -58
  10. package/.docs/docs/deployment/sandbox.md +95 -1
  11. package/.docs/docs/getting-started/develop.md +2 -0
  12. package/.docs/docs/harness/agent-controller.md +370 -0
  13. package/.docs/docs/long-running-agents/background-tasks.md +1 -1
  14. package/.docs/docs/long-running-agents/goals.md +3 -3
  15. package/.docs/docs/mcp/overview.md +222 -281
  16. package/.docs/docs/memory/overview.md +2 -2
  17. package/.docs/docs/observability/integrations/exporters/confident-ai.md +140 -0
  18. package/.docs/docs/observability/integrations/overview.md +1 -1
  19. package/.docs/docs/observability/overview.md +122 -8
  20. package/.docs/docs/observability/tracing/overview.md +2 -2
  21. package/.docs/docs/server/mastra-client.md +1 -1
  22. package/.docs/docs/server/server-adapters.md +2 -0
  23. package/.docs/docs/storage/overview.md +2 -2
  24. package/.docs/docs/workflows/agents-and-tools.md +29 -0
  25. package/.docs/docs/workflows/stored-workflows.md +146 -0
  26. package/.docs/guides/build-your-ui/copilotkit/channels.md +49 -39
  27. package/.docs/guides/concepts/multi-agent-systems.md +7 -7
  28. package/.docs/guides/guide/coding-agent.md +2 -2
  29. package/.docs/guides/guide/research-coordinator.md +1 -1
  30. package/.docs/guides/migrations/network-to-supervisor.md +1 -1
  31. package/.docs/models/environment-variables.md +1 -1
  32. package/.docs/models/gateways/neon.md +71 -0
  33. package/.docs/models/gateways/netlify.md +6 -6
  34. package/.docs/models/gateways/openrouter.md +6 -6
  35. package/.docs/models/gateways/vercel.md +6 -6
  36. package/.docs/models/gateways.md +1 -0
  37. package/.docs/models/index.md +96 -97
  38. package/.docs/models/providers/alibaba-cn.md +23 -25
  39. package/.docs/models/providers/alibaba-token-plan-cn.md +24 -24
  40. package/.docs/models/providers/alibaba-token-plan.md +23 -25
  41. package/.docs/models/providers/alibaba.md +23 -25
  42. package/.docs/models/providers/ambient.md +23 -25
  43. package/.docs/models/providers/baseten.md +23 -25
  44. package/.docs/models/providers/chutes.md +23 -25
  45. package/.docs/models/providers/cortecs.md +23 -25
  46. package/.docs/models/providers/crof.md +23 -25
  47. package/.docs/models/providers/crossmodel.md +23 -25
  48. package/.docs/models/providers/deepinfra.md +22 -24
  49. package/.docs/models/providers/digitalocean.md +32 -34
  50. package/.docs/models/providers/empiriolabs.md +23 -25
  51. package/.docs/models/providers/fireworks-ai.md +24 -24
  52. package/.docs/models/providers/greenpt.md +23 -25
  53. package/.docs/models/providers/groq.md +23 -25
  54. package/.docs/models/providers/huggingface.md +23 -25
  55. package/.docs/models/providers/hyper.md +23 -25
  56. package/.docs/models/providers/impossibl.md +23 -25
  57. package/.docs/models/providers/infomaniak.md +24 -24
  58. package/.docs/models/providers/kilo.md +24 -26
  59. package/.docs/models/providers/llmgateway.md +24 -26
  60. package/.docs/models/providers/mistral.md +23 -25
  61. package/.docs/models/providers/modal.md +23 -25
  62. package/.docs/models/providers/modelis.md +23 -25
  63. package/.docs/models/providers/nano-gpt.md +23 -25
  64. package/.docs/models/providers/neuralwatt.md +23 -25
  65. package/.docs/models/providers/ofox.md +23 -25
  66. package/.docs/models/providers/ollama-cloud.md +23 -25
  67. package/.docs/models/providers/opencode-go.md +23 -25
  68. package/.docs/models/providers/opencode.md +25 -26
  69. package/.docs/models/providers/pioneer.md +23 -25
  70. package/.docs/models/providers/requesty.md +23 -25
  71. package/.docs/models/providers/routing-run.md +23 -25
  72. package/.docs/models/providers/scx.md +23 -25
  73. package/.docs/models/providers/tensorx.md +23 -25
  74. package/.docs/models/providers/togetherai.md +22 -24
  75. package/.docs/models/providers/umans-ai-coding-plan.md +24 -24
  76. package/.docs/models/providers/umans-ai.md +23 -25
  77. package/.docs/models/providers/wandb.md +23 -25
  78. package/.docs/models/providers/xai.md +26 -28
  79. package/.docs/models/providers/zai-coding-plan.md +23 -25
  80. package/.docs/models/providers/zhipuai-coding-plan.md +23 -25
  81. package/.docs/models/providers.md +0 -1
  82. package/.docs/reference/acp/acp-agent.md +1 -1
  83. package/.docs/reference/agent-controller/agent-controller-class.md +195 -506
  84. package/.docs/reference/agent-controller/session.md +274 -111
  85. package/.docs/reference/agents/network.md +1 -1
  86. package/.docs/reference/ai-sdk/handle-network-stream.md +1 -1
  87. package/.docs/reference/ai-sdk/network-route.md +1 -1
  88. package/.docs/reference/cli/create-mastra.md +1 -1
  89. package/.docs/reference/client-js/workflows.md +92 -0
  90. package/.docs/reference/core/addStoredWorkflow.md +62 -0
  91. package/.docs/reference/core/addStoredWorkflows.md +40 -0
  92. package/.docs/reference/editor/versioning.md +1 -1
  93. package/.docs/reference/evals/rubric.md +1 -1
  94. package/.docs/reference/file-based-agents/observability.md +2 -2
  95. package/.docs/reference/file-based-agents/storage.md +1 -1
  96. package/.docs/reference/file-based-agents/subagents.md +1 -1
  97. package/.docs/reference/file-based-agents/tools.md +1 -1
  98. package/.docs/reference/index.md +5 -0
  99. package/.docs/reference/observability/tracing/configuration.md +1 -1
  100. package/.docs/reference/observability/tracing/exporters/confident-ai.md +138 -0
  101. package/.docs/reference/observability/tracing/interfaces.md +29 -0
  102. package/.docs/reference/processors/processor-interface.md +121 -10
  103. package/.docs/reference/server/routes.md +13 -0
  104. package/.docs/reference/signals/signal-provider.md +2 -0
  105. package/.docs/reference/storage/overview.md +9 -8
  106. package/.docs/reference/streaming/workflows/observeStream.md +1 -1
  107. package/.docs/reference/streaming/workflows/resumeStream.md +1 -1
  108. package/.docs/reference/streaming/workflows/stream.md +1 -1
  109. package/.docs/reference/tools/mcp-server.md +1 -1
  110. package/.docs/reference/tools/submit-plan-tool.md +1 -1
  111. package/.docs/reference/workflows/stored-workflow-definition.md +292 -0
  112. package/.docs/reference/workflows/workflow-methods/agent.md +62 -0
  113. package/.docs/reference/workflows/workflow-methods/tool.md +43 -0
  114. package/.docs/reference/workspace/railway-sandbox.md +5 -5
  115. package/CHANGELOG.md +14 -0
  116. package/package.json +4 -4
  117. package/.docs/docs/agent-controller/channels.md +0 -111
  118. package/.docs/docs/agent-controller/modes.md +0 -147
  119. package/.docs/docs/agent-controller/overview.md +0 -136
  120. package/.docs/docs/agent-controller/session.md +0 -161
  121. package/.docs/docs/agent-controller/subagents.md +0 -110
  122. package/.docs/docs/agent-controller/threads-and-state.md +0 -148
  123. package/.docs/docs/agent-controller/tool-approvals.md +0 -147
  124. package/.docs/docs/mcp/mcp-apps.md +0 -306
  125. package/.docs/docs/observability/config.md +0 -140
  126. package/.docs/docs/observability/storage.md +0 -81
  127. package/.docs/models/providers/neon.md +0 -109
@@ -11,22 +11,22 @@ NEURALWATT_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "neuralwatt/Qwen/Qwen3.5-397B-A17B-FP8"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'neuralwatt/Qwen/Qwen3.5-397B-A17B-FP8',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -64,30 +64,28 @@ for await (const chunk of stream) {
64
64
 
65
65
  ```typescript
66
66
  const agent = new Agent({
67
- id: "custom-agent",
68
- name: "custom-agent",
67
+ id: 'custom-agent',
68
+ name: 'custom-agent',
69
69
  model: {
70
- url: "https://api.neuralwatt.com/v1",
71
- id: "neuralwatt/Qwen/Qwen3.5-397B-A17B-FP8",
70
+ url: 'https://api.neuralwatt.com/v1',
71
+ id: 'neuralwatt/Qwen/Qwen3.5-397B-A17B-FP8',
72
72
  apiKey: process.env.NEURALWATT_API_KEY,
73
73
  headers: {
74
- "X-Custom-Header": "value"
75
- }
76
- }
77
- });
74
+ 'X-Custom-Header': 'value',
75
+ },
76
+ },
77
+ })
78
78
  ```
79
79
 
80
80
  ### Dynamic model selection
81
81
 
82
82
  ```typescript
83
83
  const agent = new Agent({
84
- id: "dynamic-agent",
85
- name: "Dynamic Agent",
84
+ id: 'dynamic-agent',
85
+ name: 'Dynamic Agent',
86
86
  model: ({ requestContext }) => {
87
- const useAdvanced = requestContext.task === "complex";
88
- return useAdvanced
89
- ? "neuralwatt/qwen3.6-35b-fast"
90
- : "neuralwatt/Qwen/Qwen3.5-397B-A17B-FP8";
91
- }
92
- });
87
+ const useAdvanced = requestContext.task === 'complex'
88
+ return useAdvanced ? 'neuralwatt/qwen3.6-35b-fast' : 'neuralwatt/Qwen/Qwen3.5-397B-A17B-FP8'
89
+ },
90
+ })
93
91
  ```
@@ -11,22 +11,22 @@ OFOX_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "ofox/anthropic/claude-fable-5"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'ofox/anthropic/claude-fable-5',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -56,30 +56,28 @@ for await (const chunk of stream) {
56
56
 
57
57
  ```typescript
58
58
  const agent = new Agent({
59
- id: "custom-agent",
60
- name: "custom-agent",
59
+ id: 'custom-agent',
60
+ name: 'custom-agent',
61
61
  model: {
62
- url: "https://api.ofox.ai/v1",
63
- id: "ofox/anthropic/claude-fable-5",
62
+ url: 'https://api.ofox.ai/v1',
63
+ id: 'ofox/anthropic/claude-fable-5',
64
64
  apiKey: process.env.OFOX_API_KEY,
65
65
  headers: {
66
- "X-Custom-Header": "value"
67
- }
68
- }
69
- });
66
+ 'X-Custom-Header': 'value',
67
+ },
68
+ },
69
+ })
70
70
  ```
71
71
 
72
72
  ### Dynamic model selection
73
73
 
74
74
  ```typescript
75
75
  const agent = new Agent({
76
- id: "dynamic-agent",
77
- name: "Dynamic Agent",
76
+ id: 'dynamic-agent',
77
+ name: 'Dynamic Agent',
78
78
  model: ({ requestContext }) => {
79
- const useAdvanced = requestContext.task === "complex";
80
- return useAdvanced
81
- ? "ofox/z-ai/glm-5.2"
82
- : "ofox/anthropic/claude-fable-5";
83
- }
84
- });
79
+ const useAdvanced = requestContext.task === 'complex'
80
+ return useAdvanced ? 'ofox/z-ai/glm-5.2' : 'ofox/anthropic/claude-fable-5'
81
+ },
82
+ })
85
83
  ```
@@ -11,22 +11,22 @@ OLLAMA_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "ollama-cloud/deepseek-v4-flash"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'ollama-cloud/deepseek-v4-flash',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -63,30 +63,28 @@ for await (const chunk of stream) {
63
63
 
64
64
  ```typescript
65
65
  const agent = new Agent({
66
- id: "custom-agent",
67
- name: "custom-agent",
66
+ id: 'custom-agent',
67
+ name: 'custom-agent',
68
68
  model: {
69
- url: "https://ollama.com/v1",
70
- id: "ollama-cloud/deepseek-v4-flash",
69
+ url: 'https://ollama.com/v1',
70
+ id: 'ollama-cloud/deepseek-v4-flash',
71
71
  apiKey: process.env.OLLAMA_API_KEY,
72
72
  headers: {
73
- "X-Custom-Header": "value"
74
- }
75
- }
76
- });
73
+ 'X-Custom-Header': 'value',
74
+ },
75
+ },
76
+ })
77
77
  ```
78
78
 
79
79
  ### Dynamic model selection
80
80
 
81
81
  ```typescript
82
82
  const agent = new Agent({
83
- id: "dynamic-agent",
84
- name: "Dynamic Agent",
83
+ id: 'dynamic-agent',
84
+ name: 'Dynamic Agent',
85
85
  model: ({ requestContext }) => {
86
- const useAdvanced = requestContext.task === "complex";
87
- return useAdvanced
88
- ? "ollama-cloud/qwen3.5:397b"
89
- : "ollama-cloud/deepseek-v4-flash";
90
- }
91
- });
86
+ const useAdvanced = requestContext.task === 'complex'
87
+ return useAdvanced ? 'ollama-cloud/qwen3.5:397b' : 'ollama-cloud/deepseek-v4-flash'
88
+ },
89
+ })
92
90
  ```
@@ -11,22 +11,22 @@ OPENCODE_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "opencode-go/deepseek-v4-flash"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'opencode-go/deepseek-v4-flash',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -61,30 +61,28 @@ for await (const chunk of stream) {
61
61
 
62
62
  ```typescript
63
63
  const agent = new Agent({
64
- id: "custom-agent",
65
- name: "custom-agent",
64
+ id: 'custom-agent',
65
+ name: 'custom-agent',
66
66
  model: {
67
- url: "https://opencode.ai/zen/go/v1",
68
- id: "opencode-go/deepseek-v4-flash",
67
+ url: 'https://opencode.ai/zen/go/v1',
68
+ id: 'opencode-go/deepseek-v4-flash',
69
69
  apiKey: process.env.OPENCODE_API_KEY,
70
70
  headers: {
71
- "X-Custom-Header": "value"
72
- }
73
- }
74
- });
71
+ 'X-Custom-Header': 'value',
72
+ },
73
+ },
74
+ })
75
75
  ```
76
76
 
77
77
  ### Dynamic model selection
78
78
 
79
79
  ```typescript
80
80
  const agent = new Agent({
81
- id: "dynamic-agent",
82
- name: "Dynamic Agent",
81
+ id: 'dynamic-agent',
82
+ name: 'Dynamic Agent',
83
83
  model: ({ requestContext }) => {
84
- const useAdvanced = requestContext.task === "complex";
85
- return useAdvanced
86
- ? "opencode-go/qwen3.8-max"
87
- : "opencode-go/deepseek-v4-flash";
88
- }
89
- });
84
+ const useAdvanced = requestContext.task === 'complex'
85
+ return useAdvanced ? 'opencode-go/qwen3.8-max' : 'opencode-go/deepseek-v4-flash'
86
+ },
87
+ })
90
88
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![OpenCode Zen logo](https://models.dev/logos/opencode.svg)OpenCode Zen
4
4
 
5
- Access 85 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
5
+ Access 86 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [OpenCode Zen documentation](https://opencode.ai/docs/zen).
8
8
 
@@ -11,22 +11,22 @@ OPENCODE_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "opencode/big-pickle"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'opencode/big-pickle',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -88,6 +88,7 @@ for await (const chunk of stream) {
88
88
  | `opencode/kimi-k3` | 1.0M | | | | | | $3 | $15 |
89
89
  | `opencode/laguna-s-2.1-free` | 256K | | | | | | — | — |
90
90
  | `opencode/ling-3.0-flash-free` | 262K | | | | | | — | — |
91
+ | `opencode/longcat-2.0-free` | 1.0M | | | | | | — | — |
91
92
  | `opencode/mimo-v2.5-free` | 200K | | | | | | — | — |
92
93
  | `opencode/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
93
94
  | `opencode/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
@@ -103,30 +104,28 @@ for await (const chunk of stream) {
103
104
 
104
105
  ```typescript
105
106
  const agent = new Agent({
106
- id: "custom-agent",
107
- name: "custom-agent",
107
+ id: 'custom-agent',
108
+ name: 'custom-agent',
108
109
  model: {
109
- url: "https://opencode.ai/zen/v1",
110
- id: "opencode/big-pickle",
110
+ url: 'https://opencode.ai/zen/v1',
111
+ id: 'opencode/big-pickle',
111
112
  apiKey: process.env.OPENCODE_API_KEY,
112
113
  headers: {
113
- "X-Custom-Header": "value"
114
- }
115
- }
116
- });
114
+ 'X-Custom-Header': 'value',
115
+ },
116
+ },
117
+ })
117
118
  ```
118
119
 
119
120
  ### Dynamic model selection
120
121
 
121
122
  ```typescript
122
123
  const agent = new Agent({
123
- id: "dynamic-agent",
124
- name: "Dynamic Agent",
124
+ id: 'dynamic-agent',
125
+ name: 'Dynamic Agent',
125
126
  model: ({ requestContext }) => {
126
- const useAdvanced = requestContext.task === "complex";
127
- return useAdvanced
128
- ? "opencode/trinity-large-preview-free"
129
- : "opencode/big-pickle";
130
- }
131
- });
127
+ const useAdvanced = requestContext.task === 'complex'
128
+ return useAdvanced ? 'opencode/trinity-large-preview-free' : 'opencode/big-pickle'
129
+ },
130
+ })
132
131
  ```
@@ -11,22 +11,22 @@ PIONEER_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "pioneer/HuggingFaceTB/SmolLM3-3B-Base"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'pioneer/HuggingFaceTB/SmolLM3-3B-Base',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -119,30 +119,28 @@ for await (const chunk of stream) {
119
119
 
120
120
  ```typescript
121
121
  const agent = new Agent({
122
- id: "custom-agent",
123
- name: "custom-agent",
122
+ id: 'custom-agent',
123
+ name: 'custom-agent',
124
124
  model: {
125
- url: "https://api.pioneer.ai/v1",
126
- id: "pioneer/HuggingFaceTB/SmolLM3-3B-Base",
125
+ url: 'https://api.pioneer.ai/v1',
126
+ id: 'pioneer/HuggingFaceTB/SmolLM3-3B-Base',
127
127
  apiKey: process.env.PIONEER_API_KEY,
128
128
  headers: {
129
- "X-Custom-Header": "value"
130
- }
131
- }
132
- });
129
+ 'X-Custom-Header': 'value',
130
+ },
131
+ },
132
+ })
133
133
  ```
134
134
 
135
135
  ### Dynamic model selection
136
136
 
137
137
  ```typescript
138
138
  const agent = new Agent({
139
- id: "dynamic-agent",
140
- name: "Dynamic Agent",
139
+ id: 'dynamic-agent',
140
+ name: 'Dynamic Agent',
141
141
  model: ({ requestContext }) => {
142
- const useAdvanced = requestContext.task === "complex";
143
- return useAdvanced
144
- ? "pioneer/zai-org/GLM-5.2"
145
- : "pioneer/HuggingFaceTB/SmolLM3-3B-Base";
146
- }
147
- });
142
+ const useAdvanced = requestContext.task === 'complex'
143
+ return useAdvanced ? 'pioneer/zai-org/GLM-5.2' : 'pioneer/HuggingFaceTB/SmolLM3-3B-Base'
144
+ },
145
+ })
148
146
  ```
@@ -11,22 +11,22 @@ REQUESTY_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "requesty/claude-fable-5"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'requesty/claude-fable-5',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -90,30 +90,28 @@ for await (const chunk of stream) {
90
90
 
91
91
  ```typescript
92
92
  const agent = new Agent({
93
- id: "custom-agent",
94
- name: "custom-agent",
93
+ id: 'custom-agent',
94
+ name: 'custom-agent',
95
95
  model: {
96
- url: "https://router.requesty.ai/v1",
97
- id: "requesty/claude-fable-5",
96
+ url: 'https://router.requesty.ai/v1',
97
+ id: 'requesty/claude-fable-5',
98
98
  apiKey: process.env.REQUESTY_API_KEY,
99
99
  headers: {
100
- "X-Custom-Header": "value"
101
- }
102
- }
103
- });
100
+ 'X-Custom-Header': 'value',
101
+ },
102
+ },
103
+ })
104
104
  ```
105
105
 
106
106
  ### Dynamic model selection
107
107
 
108
108
  ```typescript
109
109
  const agent = new Agent({
110
- id: "dynamic-agent",
111
- name: "Dynamic Agent",
110
+ id: 'dynamic-agent',
111
+ name: 'Dynamic Agent',
112
112
  model: ({ requestContext }) => {
113
- const useAdvanced = requestContext.task === "complex";
114
- return useAdvanced
115
- ? "requesty/o4-mini@eu"
116
- : "requesty/claude-fable-5";
117
- }
118
- });
113
+ const useAdvanced = requestContext.task === 'complex'
114
+ return useAdvanced ? 'requesty/o4-mini@eu' : 'requesty/claude-fable-5'
115
+ },
116
+ })
119
117
  ```
@@ -11,22 +11,22 @@ ROUTING_RUN_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from "@mastra/core/agent";
14
+ import { Agent } from '@mastra/core/agent'
15
15
 
16
16
  const agent = new Agent({
17
- id: "my-agent",
18
- name: "My Agent",
19
- instructions: "You are a helpful assistant",
20
- model: "routing-run/claude-opus-4-8"
21
- });
17
+ id: 'my-agent',
18
+ name: 'My Agent',
19
+ instructions: 'You are a helpful assistant',
20
+ model: 'routing-run/claude-opus-4-8',
21
+ })
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate("Hello!");
24
+ const response = await agent.generate('Hello!')
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream("Tell me a story");
27
+ const stream = await agent.stream('Tell me a story')
28
28
  for await (const chunk of stream) {
29
- console.log(chunk);
29
+ console.log(chunk)
30
30
  }
31
31
  ```
32
32
 
@@ -58,30 +58,28 @@ for await (const chunk of stream) {
58
58
 
59
59
  ```typescript
60
60
  const agent = new Agent({
61
- id: "custom-agent",
62
- name: "custom-agent",
61
+ id: 'custom-agent',
62
+ name: 'custom-agent',
63
63
  model: {
64
- url: "https://api.routing.run/v1",
65
- id: "routing-run/claude-opus-4-8",
64
+ url: 'https://api.routing.run/v1',
65
+ id: 'routing-run/claude-opus-4-8',
66
66
  apiKey: process.env.ROUTING_RUN_API_KEY,
67
67
  headers: {
68
- "X-Custom-Header": "value"
69
- }
70
- }
71
- });
68
+ 'X-Custom-Header': 'value',
69
+ },
70
+ },
71
+ })
72
72
  ```
73
73
 
74
74
  ### Dynamic model selection
75
75
 
76
76
  ```typescript
77
77
  const agent = new Agent({
78
- id: "dynamic-agent",
79
- name: "Dynamic Agent",
78
+ id: 'dynamic-agent',
79
+ name: 'Dynamic Agent',
80
80
  model: ({ requestContext }) => {
81
- const useAdvanced = requestContext.task === "complex";
82
- return useAdvanced
83
- ? "routing-run/qwen3.5-9b"
84
- : "routing-run/claude-opus-4-8";
85
- }
86
- });
81
+ const useAdvanced = requestContext.task === 'complex'
82
+ return useAdvanced ? 'routing-run/qwen3.5-9b' : 'routing-run/claude-opus-4-8'
83
+ },
84
+ })
87
85
  ```