@mastra/mcp-docs-server 1.3.5-alpha.11 → 1.3.5-alpha.14
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.
- package/.docs/docs/agents/processors.md +8 -0
- package/.docs/docs/agents/tools.md +17 -0
- package/.docs/docs/mastra-platform/environments.md +1 -1
- package/.docs/docs/mastra-platform/observability.md +1 -1
- package/.docs/docs/memory/observational-memory.md +2 -0
- package/.docs/models/gateways/netlify.md +1 -2
- package/.docs/models/gateways/openrouter.md +1 -3
- package/.docs/models/gateways/vercel.md +4 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/edenai.md +3 -2
- package/.docs/models/providers/kilo.md +7 -9
- package/.docs/models/providers/nano-gpt.md +9 -1
- package/.docs/models/providers/wandb.md +4 -13
- package/.docs/reference/agents/generate.md +2 -0
- package/.docs/reference/cli/mastra.md +43 -5
- package/.docs/reference/editor/prompt-blocks.md +41 -0
- package/.docs/reference/editor/tool-provider.md +19 -0
- package/.docs/reference/tools/create-tool.md +2 -0
- package/.docs/reference/tools/mcp-server.md +7 -1
- package/package.json +4 -4
|
@@ -1030,6 +1030,14 @@ export class ContextLengthHandler implements Processor {
|
|
|
1030
1030
|
|
|
1031
1031
|
Mastra includes a built-in [`PrefillErrorHandler`](https://mastra.ai/reference/processors/prefill-error-handler) that automatically handles the Anthropic "assistant message prefill" error. This processor is auto-injected and requires no configuration.
|
|
1032
1032
|
|
|
1033
|
+
### Recover from attachment download failures
|
|
1034
|
+
|
|
1035
|
+
When a model can't fetch an attachment URL itself, Mastra downloads the attachment before calling the model. If the download fails, `processAPIError()` receives a `MastraError` with the id `DOWNLOAD_ASSETS_FAILED` and the attachment URL in `error.details.url`. An error processor can use this to replace the attachment, for example with a fresh signed URL, and return `{ retry: true }`. Fallback models get a chance next.
|
|
1036
|
+
|
|
1037
|
+
If nothing recovers the download, the agent doesn't fail the turn. It retries once with the attachment replaced by an `[Attachment unavailable: <name>]` text placeholder and logs a warning. Mastra records the URL on the stored user message under `metadata.mastra.unavailableAttachments`. Later turns show the same placeholder without downloading the attachment again. The attachment itself stays in the thread's history.
|
|
1038
|
+
|
|
1039
|
+
A data URL that can't be decoded is replaced with the placeholder right away, because retrying can't fix it.
|
|
1040
|
+
|
|
1033
1041
|
## Receive background work notifications
|
|
1034
1042
|
|
|
1035
1043
|
Use `createBackgroundWorkSignalProcessor()` to retain the active caller's signal capability for eligible background tool calls:
|
|
@@ -145,6 +145,23 @@ export const weatherTool = createTool({
|
|
|
145
145
|
})
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
### Handle output validation failures
|
|
149
|
+
|
|
150
|
+
When a result doesn't match `outputSchema`, Mastra logs a warning and returns a validation error object instead of the result. The model then treats the call as failed and may retry it. For tools whose side effects have already happened by the time the result is produced, set `outputValidation: 'warn'`. Mastra still logs the mismatch, but it returns the real result unchanged, which keeps the model from retrying an order that was already placed.
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
export const placeOrderTool = createTool({
|
|
154
|
+
id: 'place-order',
|
|
155
|
+
description: 'Places an order and returns its id and total',
|
|
156
|
+
inputSchema: z.object({ sku: z.string(), quantity: z.number().int().positive() }),
|
|
157
|
+
outputSchema: z.object({ orderId: z.string(), total: z.number() }),
|
|
158
|
+
outputValidation: 'warn',
|
|
159
|
+
execute: async ({ sku, quantity }) => {
|
|
160
|
+
return await orders.create({ sku, quantity })
|
|
161
|
+
},
|
|
162
|
+
})
|
|
163
|
+
```
|
|
164
|
+
|
|
148
165
|
## Multiple tools
|
|
149
166
|
|
|
150
167
|
An agent can use multiple tools to handle more complex tasks by delegating specific parts to individual tools. The agent decides which tools to use based on the user's message and the agent's instructions, plus the tool descriptions and schemas.
|
|
@@ -42,7 +42,7 @@ mastra env list
|
|
|
42
42
|
|
|
43
43
|
The output shows each environment's name, region, active deploy status, and the managed environment variables injected by attached databases. Pass `--json` for machine-readable output in CI.
|
|
44
44
|
|
|
45
|
-
All `mastra env` commands resolve their project from
|
|
45
|
+
All `mastra env` commands resolve their project from the `--project` flag, the `MASTRA_PROJECT_ID` environment variable, or the `.mastra-project.json` file written by your first deploy, in that order. Run them from your project directory and you never need to name the project.
|
|
46
46
|
|
|
47
47
|
## Environment variables
|
|
48
48
|
|
|
@@ -213,7 +213,7 @@ Specify the destination with `--project`, or set `MASTRA_PROJECT_ID`. You can us
|
|
|
213
213
|
npx mastra traces import langfuse --project my-project --dry-run
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
The `--project` flag takes precedence over `MASTRA_PROJECT_ID`. Without either value, the CLI uses the project linked in `.mastra-project.json`.
|
|
217
217
|
|
|
218
218
|
For a headless environment, set the API token and organization ID. The command uses `MASTRA_API_TOKEN` for project discovery, upload, and read-back. Set the project ID or pass `--project`:
|
|
219
219
|
|
|
@@ -418,6 +418,8 @@ new Agent({
|
|
|
418
418
|
|
|
419
419
|
You can also pass an allowlist of mimeType globs (for example `['image/*']`) to forward only the kinds the Observer can handle. Alternatively, set `observeAttachments: 'auto'` so Mastra consults the provider capabilities registry. It forwards attachments when the Observer model supports multimodal input and drops them otherwise. If capability data is unavailable for the model, the setting falls back to `true`.
|
|
420
420
|
|
|
421
|
+
Attachments that the agent recorded as unavailable, because they could no longer be downloaded, are never sent to the Observer. The Observer still sees their `[Image #1: ...]` or `[File #1: ...]` line. See [attachment download failures](https://mastra.ai/docs/agents/processors) for how Mastra records them.
|
|
422
|
+
|
|
421
423
|
```md
|
|
422
424
|
Date: 2026-01-15
|
|
423
425
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Netlify
|
|
6
6
|
|
|
7
|
-
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access
|
|
7
|
+
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 270 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
|
|
10
10
|
|
|
@@ -261,7 +261,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
261
261
|
| `openrouter/qwen/qwen3.6-35b-a3b` |
|
|
262
262
|
| `openrouter/qwen/qwen3.8-2.4t-a95b` |
|
|
263
263
|
| `openrouter/qwen/qwen3.8-27b` |
|
|
264
|
-
| `openrouter/qwen/qwen3.8-27b:free` |
|
|
265
264
|
| `openrouter/rekaai/reka-edge` |
|
|
266
265
|
| `openrouter/rekaai/reka-flash-3` |
|
|
267
266
|
| `openrouter/relace/relace-apply-3` |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# OpenRouter
|
|
6
6
|
|
|
7
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
7
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 388 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
10
10
|
|
|
@@ -360,7 +360,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
360
360
|
| `qwen/qwen3.7-plus` |
|
|
361
361
|
| `qwen/qwen3.8-2.4t-a95b` |
|
|
362
362
|
| `qwen/qwen3.8-27b` |
|
|
363
|
-
| `qwen/qwen3.8-27b:free` |
|
|
364
363
|
| `qwen/qwen3.8-flash` |
|
|
365
364
|
| `qwen/qwen3.8-max-0902` |
|
|
366
365
|
| `qwen/qwen3.8-max-prime` |
|
|
@@ -376,7 +375,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
376
375
|
| `sao10k/l3-lunaris-8b` |
|
|
377
376
|
| `sao10k/l3.1-euryale-70b` |
|
|
378
377
|
| `sao10k/l3.3-euryale-70b` |
|
|
379
|
-
| `stealth/space-bunny-alpha` |
|
|
380
378
|
| `stepfun/step-3.5-flash` |
|
|
381
379
|
| `stepfun/step-3.7-flash` |
|
|
382
380
|
| `tencent/hunyuan-a13b-instruct` |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Vercel
|
|
6
6
|
|
|
7
|
-
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
7
|
+
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 405 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
|
|
10
10
|
|
|
@@ -113,6 +113,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
113
113
|
| `bfl/flux-2-klein-9b` |
|
|
114
114
|
| `bfl/flux-2-max` |
|
|
115
115
|
| `bfl/flux-2-pro` |
|
|
116
|
+
| `bfl/flux-3-image` |
|
|
116
117
|
| `bfl/flux-3-video` |
|
|
117
118
|
| `bfl/flux-kontext-max` |
|
|
118
119
|
| `bfl/flux-kontext-pro` |
|
|
@@ -135,6 +136,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
135
136
|
| `bytedance/seedream-5.0-pro` |
|
|
136
137
|
| `cohere/command-a` |
|
|
137
138
|
| `cohere/embed-v4.0` |
|
|
139
|
+
| `cohere/embed-v5.0-fast` |
|
|
140
|
+
| `cohere/embed-v5.0-pro` |
|
|
138
141
|
| `cohere/rerank-v3.5` |
|
|
139
142
|
| `cohere/rerank-v4-fast` |
|
|
140
143
|
| `cohere/rerank-v4-pro` |
|
package/.docs/models/index.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Model Providers
|
|
6
6
|
|
|
7
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
7
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 7766 models from 213 providers through a single API.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Eden AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 292 Eden AI models through Mastra's model router. Authentication is handled automatically using the `EDENAI_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Eden AI documentation](https://docs.edenai.co).
|
|
10
10
|
|
|
@@ -160,7 +160,8 @@ for await (const chunk of stream) {
|
|
|
160
160
|
| `edenai/google/gemini-3.8-flash` | 1.0M | | | | | | $0.75 | $4 |
|
|
161
161
|
| `edenai/google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
|
|
162
162
|
| `edenai/google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
|
|
163
|
-
| `edenai/greenference/
|
|
163
|
+
| `edenai/greenference/deepseek-v4.1-flash` | 1.0M | | | | | | $0.00 | $0.09 |
|
|
164
|
+
| `edenai/greenference/gpt-oss-20b` | 131K | | | | | | $0.01 | $0.04 |
|
|
164
165
|
| `edenai/groq/openai/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
165
166
|
| `edenai/groq/openai/gpt-oss-20b` | 131K | | | | | | $0.07 | $0.30 |
|
|
166
167
|
| `edenai/groq/openai/gpt-oss-safeguard-20b` | 131K | | | | | | $0.07 | $0.30 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Kilo Gateway
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 395 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Kilo Gateway documentation](https://kilo.ai).
|
|
10
10
|
|
|
@@ -43,11 +43,11 @@ for await (const chunk of stream) {
|
|
|
43
43
|
| `kilo/~anthropic/claude-opus-latest` | 1.0M | | | | | | $4 | $20 |
|
|
44
44
|
| `kilo/~anthropic/claude-sonnet-latest` | 1.0M | | | | | | $2 | $10 |
|
|
45
45
|
| `kilo/~deepseek/deepseek-flash-latest` | 1.0M | | | | | | $0.00 | $2 |
|
|
46
|
-
| `kilo/~deepseek/deepseek-pro-latest` | 1.0M | | | | | | $0.
|
|
46
|
+
| `kilo/~deepseek/deepseek-pro-latest` | 1.0M | | | | | | $0.28 | $4 |
|
|
47
47
|
| `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.02 | $1 |
|
|
48
48
|
| `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
|
|
49
49
|
| `kilo/~google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
|
|
50
|
-
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.
|
|
50
|
+
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.80 | $13 |
|
|
51
51
|
| `kilo/~openai/gpt-astra-latest` | 1.1M | | | | | | $10 | $50 |
|
|
52
52
|
| `kilo/~openai/gpt-luna-latest` | 1.1M | | | | | | $0.10 | $0.50 |
|
|
53
53
|
| `kilo/~openai/gpt-mini-latest` | 400K | | | | | | $0.75 | $5 |
|
|
@@ -105,8 +105,8 @@ for await (const chunk of stream) {
|
|
|
105
105
|
| `kilo/deepseek/deepseek-chat-v3.1` | 164K | | | | | | $0.25 | $0.95 |
|
|
106
106
|
| `kilo/deepseek/deepseek-r1` | 64K | | | | | | $0.70 | $3 |
|
|
107
107
|
| `kilo/deepseek/deepseek-r1-0528` | 164K | | | | | | $0.70 | $3 |
|
|
108
|
-
| `kilo/deepseek/deepseek-v3.1-terminus` |
|
|
109
|
-
| `kilo/deepseek/deepseek-v3.2` |
|
|
108
|
+
| `kilo/deepseek/deepseek-v3.1-terminus` | 131K | | | | | | $0.30 | $1 |
|
|
109
|
+
| `kilo/deepseek/deepseek-v3.2` | 164K | | | | | | $0.26 | $0.42 |
|
|
110
110
|
| `kilo/deepseek/deepseek-v3.2-exp` | 164K | | | | | | $0.27 | $0.41 |
|
|
111
111
|
| `kilo/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
112
112
|
| `kilo/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.44 | $1 |
|
|
@@ -362,7 +362,6 @@ for await (const chunk of stream) {
|
|
|
362
362
|
| `kilo/qwen/qwen3.7-plus` | 1.0M | | | | | | $0.32 | $1 |
|
|
363
363
|
| `kilo/qwen/qwen3.8-2.4t-a95b` | 1.0M | | | | | | $2 | $6 |
|
|
364
364
|
| `kilo/qwen/qwen3.8-27b` | 1.0M | | | | | | $0.42 | $3 |
|
|
365
|
-
| `kilo/qwen/qwen3.8-27b:free` | 262K | | | | | | — | — |
|
|
366
365
|
| `kilo/qwen/qwen3.8-flash` | 1.0M | | | | | | $0.15 | $0.47 |
|
|
367
366
|
| `kilo/qwen/qwen3.8-max-0902` | 1.0M | | | | | | $2 | $6 |
|
|
368
367
|
| `kilo/qwen/qwen3.8-max-prime` | 1.0M | | | | | | $4 | $12 |
|
|
@@ -383,7 +382,6 @@ for await (const chunk of stream) {
|
|
|
383
382
|
| `kilo/stealth/claude-opus-4.8` | 1.0M | | | | | | $4 | $20 |
|
|
384
383
|
| `kilo/stealth/claude-sonnet-4.6` | 1.0M | | | | | | $2 | $12 |
|
|
385
384
|
| `kilo/stealth/qwen3.6-plus` | 1.0M | | | | | | $0.25 | $2 |
|
|
386
|
-
| `kilo/stealth/space-bunny-alpha` | 1.0M | | | | | | — | — |
|
|
387
385
|
| `kilo/stepfun/step-3.5-flash` | 262K | | | | | | $0.10 | $0.30 |
|
|
388
386
|
| `kilo/stepfun/step-3.7-flash` | 256K | | | | | | $0.20 | $1 |
|
|
389
387
|
| `kilo/stepfun/step-3.7-flash:free` | 262K | | | | | | — | — |
|
|
@@ -391,9 +389,9 @@ for await (const chunk of stream) {
|
|
|
391
389
|
| `kilo/tencent/hy-mt2-1.8b` | 8K | | | | | | $0.04 | $0.18 |
|
|
392
390
|
| `kilo/tencent/hy-mt2-30b-a3b` | 8K | | | | | | $0.07 | $0.29 |
|
|
393
391
|
| `kilo/tencent/hy-mt2-7b` | 8K | | | | | | $0.07 | $0.29 |
|
|
394
|
-
| `kilo/tencent/hy3` | 262K | | | | | | $0.
|
|
392
|
+
| `kilo/tencent/hy3` | 262K | | | | | | $0.08 | $0.33 |
|
|
395
393
|
| `kilo/tencent/hy3-preview` | 262K | | | | | | $0.18 | $0.60 |
|
|
396
|
-
| `kilo/tencent/hy4-preview` | 1.0M | | | | | | $0.
|
|
394
|
+
| `kilo/tencent/hy4-preview` | 1.0M | | | | | | $0.75 | $2 |
|
|
397
395
|
| `kilo/thedrummer/cydonia-24b-v4.1` | 131K | | | | | | $0.30 | $0.50 |
|
|
398
396
|
| `kilo/thedrummer/skyfall-36b-v2` | 33K | | | | | | $0.55 | $0.80 |
|
|
399
397
|
| `kilo/thedrummer/unslopnemo-12b` | 1.0M | | | | | | $0.40 | $0.40 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# NanoGPT
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 610 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [NanoGPT documentation](https://docs.nano-gpt.com).
|
|
10
10
|
|
|
@@ -481,12 +481,20 @@ for await (const chunk of stream) {
|
|
|
481
481
|
| `nano-gpt/qwen/qwen3.7-plus` | 992K | | | | | | $0.40 | $2 |
|
|
482
482
|
| `nano-gpt/qwen/qwen3.7-plus:thinking` | 984K | | | | | | $0.40 | $2 |
|
|
483
483
|
| `nano-gpt/qwen/qwen3.8-27b` | 262K | | | | | | $0.15 | $0.70 |
|
|
484
|
+
| `nano-gpt/qwen/qwen3.8-27b-antislop` | 262K | | | | | | $0.10 | $0.60 |
|
|
484
485
|
| `nano-gpt/qwen/qwen3.8-27b-cybersecurity` | 262K | | | | | | $0.10 | $0.60 |
|
|
486
|
+
| `nano-gpt/qwen/qwen3.8-27b-darkidol` | 262K | | | | | | $0.10 | $0.60 |
|
|
485
487
|
| `nano-gpt/qwen/qwen3.8-27b-fable` | 524K | | | | | | $0.25 | $2 |
|
|
488
|
+
| `nano-gpt/qwen/qwen3.8-27b-fimi` | 262K | | | | | | $0.10 | $0.60 |
|
|
486
489
|
| `nano-gpt/qwen/qwen3.8-27b-hemmingway` | 262K | | | | | | $0.25 | $2 |
|
|
490
|
+
| `nano-gpt/qwen/qwen3.8-27b-kimiko` | 262K | | | | | | $0.10 | $0.60 |
|
|
491
|
+
| `nano-gpt/qwen/qwen3.8-27b-kiwen` | 262K | | | | | | $0.10 | $0.60 |
|
|
492
|
+
| `nano-gpt/qwen/qwen3.8-27b-novelist` | 262K | | | | | | $0.10 | $0.60 |
|
|
487
493
|
| `nano-gpt/qwen/qwen3.8-27b-obliterated` | 524K | | | | | | $0.25 | $2 |
|
|
488
494
|
| `nano-gpt/qwen/qwen3.8-27b-obliterated:thinking` | 524K | | | | | | $0.25 | $2 |
|
|
489
495
|
| `nano-gpt/qwen/qwen3.8-27b-queen` | 524K | | | | | | $0.25 | $2 |
|
|
496
|
+
| `nano-gpt/qwen/qwen3.8-27b-swift` | 262K | | | | | | $0.10 | $0.60 |
|
|
497
|
+
| `nano-gpt/qwen/qwen3.8-27b-synthia` | 262K | | | | | | $0.10 | $0.60 |
|
|
490
498
|
| `nano-gpt/qwen/qwen3.8-27b-uncensored` | 524K | | | | | | $0.15 | $1 |
|
|
491
499
|
| `nano-gpt/qwen/qwen3.8-27b-uncensored:thinking` | 524K | | | | | | $0.15 | $1 |
|
|
492
500
|
| `nano-gpt/qwen/qwen3.8-27b:thinking` | 262K | | | | | | $0.15 | $0.70 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# CoreWeave
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 20 CoreWeave models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [CoreWeave documentation](https://docs.wandb.ai).
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ const agent = new Agent({
|
|
|
19
19
|
id: "my-agent",
|
|
20
20
|
name: "My Agent",
|
|
21
21
|
instructions: "You are a helpful assistant",
|
|
22
|
-
model: "wandb/
|
|
22
|
+
model: "wandb/MiniMaxAI/MiniMax-M3"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// Generate a response
|
|
@@ -39,17 +39,12 @@ for await (const chunk of stream) {
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| ---------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
41
|
| `wandb/deepseek-ai/DeepSeek-V3.1` | 161K | | | | | | $0.55 | $2 |
|
|
42
|
-
| `wandb/deepseek-ai/DeepSeek-V4-Flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
43
42
|
| `wandb/deepseek-ai/DeepSeek-V4-Flash-0731` | 262K | | | | | | $0.13 | $0.28 |
|
|
44
|
-
| `wandb/deepseek-ai/DeepSeek-V4-Pro` | 1.0M | | | | | | $1 | $3 |
|
|
45
43
|
| `wandb/deepseek-ai/DeepSeek-V4-Pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
46
44
|
| `wandb/deepseek-ai/DeepSeek-V4.1-Flash` | 1.0M | | | | | | $0.20 | $0.65 |
|
|
47
45
|
| `wandb/google/gemma-4-26B-A4B-it` | 262K | | | | | | $0.10 | $0.30 |
|
|
48
46
|
| `wandb/google/gemma-4-31B-it` | 262K | | | | | | $0.10 | $0.34 |
|
|
49
|
-
| `wandb/ibm-granite/granite-4.1-8b` | 131K | | | | | | $0.05 | $0.10 |
|
|
50
47
|
| `wandb/ibm-granite/granite-4.2-8b` | 131K | | | | | | $0.10 | $0.15 |
|
|
51
|
-
| `wandb/JetBrains/Mellum2-12B-A2.5B-Instruct` | 131K | | | | | | $0.05 | $0.10 |
|
|
52
|
-
| `wandb/meta-llama/Llama-3.1-70B-Instruct` | 131K | | | | | | $0.80 | $0.80 |
|
|
53
48
|
| `wandb/meta-llama/Llama-3.1-8B-Instruct` | 131K | | | | | | $0.22 | $0.22 |
|
|
54
49
|
| `wandb/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.71 | $0.71 |
|
|
55
50
|
| `wandb/MiniMaxAI/MiniMax-M3` | 262K | | | | | | $0.23 | $0.96 |
|
|
@@ -59,10 +54,6 @@ for await (const chunk of stream) {
|
|
|
59
54
|
| `wandb/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B` | 262K | | | | | | $0.07 | $0.20 |
|
|
60
55
|
| `wandb/openai/gpt-oss-120b` | 131K | | | | | | $0.03 | $0.17 |
|
|
61
56
|
| `wandb/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.13 |
|
|
62
|
-
| `wandb/OpenPipe/Qwen3-14B-Instruct` | 33K | | | | | | $0.05 | $0.22 |
|
|
63
|
-
| `wandb/Qwen/Qwen3-30B-A3B-Instruct-2507` | 262K | | | | | | $0.10 | $0.30 |
|
|
64
|
-
| `wandb/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
65
|
-
| `wandb/Qwen/Qwen3.6-27B` | 262K | | | | | | $0.60 | $4 |
|
|
66
57
|
| `wandb/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.25 | $1 |
|
|
67
58
|
| `wandb/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
|
|
68
59
|
| `wandb/zai-org/GLM-5.2` | 1.0M | | | | | | $0.76 | $2 |
|
|
@@ -80,7 +71,7 @@ const agent = new Agent({
|
|
|
80
71
|
name: "custom-agent",
|
|
81
72
|
model: {
|
|
82
73
|
url: "https://api.inference.wandb.ai/v1",
|
|
83
|
-
id: "wandb/
|
|
74
|
+
id: "wandb/MiniMaxAI/MiniMax-M3",
|
|
84
75
|
apiKey: process.env.WANDB_API_KEY,
|
|
85
76
|
headers: {
|
|
86
77
|
"X-Custom-Header": "value"
|
|
@@ -99,7 +90,7 @@ const agent = new Agent({
|
|
|
99
90
|
const useAdvanced = requestContext.task === "complex";
|
|
100
91
|
return useAdvanced
|
|
101
92
|
? "wandb/zai-org/GLM-5.3-Flash"
|
|
102
|
-
: "wandb/
|
|
93
|
+
: "wandb/MiniMaxAI/MiniMax-M3";
|
|
103
94
|
}
|
|
104
95
|
});
|
|
105
96
|
```
|
|
@@ -444,6 +444,8 @@ const response = await agent.generate([
|
|
|
444
444
|
console.log(response.text)
|
|
445
445
|
```
|
|
446
446
|
|
|
447
|
+
The `image` value, or `data` for a `type: 'file'` part, should be an absolute URL, a data URL, or base64 content. The model can't see an attachment given as a relative path such as `/api/images/foo.png`, so resolve it to an absolute URL before sending. The agent replaces it with a placeholder and logs a warning. It does the same for inline content that can't be decoded or isn't the image or PDF its media type says, and for any attachment it can't download, instead of failing. See [attachment download failures](https://mastra.ai/docs/agents/processors).
|
|
448
|
+
|
|
447
449
|
### Using `maxSteps`
|
|
448
450
|
|
|
449
451
|
The `maxSteps` parameter controls the maximum number of sequential LLM calls an agent can make. Each step generates a response and executes any tool calls before processing the result. Limiting steps helps prevent infinite loops and reduce latency. It also controls token usage for agents that use tools. The default is 5, but can be increased:
|
|
@@ -428,7 +428,7 @@ mastra deploy --env staging --yes
|
|
|
428
428
|
|
|
429
429
|
Manages environments on Mastra platform. Environments are deploy targets (for example `production`, `staging`, `preview-42`) that belong to a project. The current organization is resolved from stored credentials.
|
|
430
430
|
|
|
431
|
-
Every subcommand resolves its project in a fixed order. It first checks the
|
|
431
|
+
Every subcommand resolves its project in a fixed order. It first checks the `--project <name|slug|id>` flag, then the `MASTRA_PROJECT_ID` environment variable. It then reads the `.mastra-project.json` file written by [`mastra deploy`](#mastra-deploy) in the current directory. Run from your project directory and you never need to name the project.
|
|
432
432
|
|
|
433
433
|
### `mastra env list`
|
|
434
434
|
|
|
@@ -790,7 +790,7 @@ Organization ID. Can also be set via the `MASTRA_ORG_ID` environment variable.
|
|
|
790
790
|
|
|
791
791
|
#### `--project`
|
|
792
792
|
|
|
793
|
-
Project ID or slug
|
|
793
|
+
Project ID or slug. Takes precedence over `MASTRA_PROJECT_ID`. Slugs are resolved against projects in the current organization.
|
|
794
794
|
|
|
795
795
|
#### `-c, --config`
|
|
796
796
|
|
|
@@ -858,7 +858,7 @@ The file defaults to `.env` when no argument is given. All values are double-quo
|
|
|
858
858
|
|
|
859
859
|
#### `--project`
|
|
860
860
|
|
|
861
|
-
Project ID or slug.
|
|
861
|
+
Project ID or slug. Takes precedence over `MASTRA_PROJECT_ID` and the linked project.
|
|
862
862
|
|
|
863
863
|
#### CI usage
|
|
864
864
|
|
|
@@ -913,6 +913,44 @@ Revokes an API token.
|
|
|
913
913
|
mastra auth tokens revoke <token-id>
|
|
914
914
|
```
|
|
915
915
|
|
|
916
|
+
## `mastra connect`
|
|
917
|
+
|
|
918
|
+
Manages provider connections for the linked platform project, so agents using `@mastra/connect` pick up provider toolsets without leaving the terminal.
|
|
919
|
+
|
|
920
|
+
The target project resolves from the `--project` flag, the `MASTRA_PROJECT_ID` environment variable, or the `.mastra-project.json` written by `mastra deploy`, in that order. All subcommands accept `--project <name|slug|id>`.
|
|
921
|
+
|
|
922
|
+
### `mastra connect list`
|
|
923
|
+
|
|
924
|
+
Lists the available providers. Providers already connected to the project are shown in green, and unconnected providers are shown in grey.
|
|
925
|
+
|
|
926
|
+
```bash
|
|
927
|
+
mastra connect list
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
### `mastra connect add`
|
|
931
|
+
|
|
932
|
+
Connects a provider to the project. When the organization already has connections for the provider that aren't attached to the project, the command lists them and lets you attach an existing connection or create a new one. With no existing connections it goes straight to the provider's auth flow.
|
|
933
|
+
|
|
934
|
+
OAuth providers open the provider's consent screen in your browser, while API key and Basic auth providers prompt for credentials in the terminal. Providers with other auth types open a hosted connect page. The command waits until the connection becomes active before exiting.
|
|
935
|
+
|
|
936
|
+
Once a new connection is active, the command offers to set a display name so you can tell connections to the same provider apart. It lists the provider's existing connections, suggests a name that doesn't collide with them, and asks for confirmation if the chosen name duplicates another connection's name. Leave the field blank to skip naming.
|
|
937
|
+
|
|
938
|
+
```bash
|
|
939
|
+
mastra connect add <provider>
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
Pass `--yes` to skip all prompts. This always creates a new connection without a display name, even when existing connections could be reused.
|
|
943
|
+
|
|
944
|
+
### `mastra connect remove`
|
|
945
|
+
|
|
946
|
+
Unlinks a provider's connection from the project. The organization-level connection is kept and can be re-attached later.
|
|
947
|
+
|
|
948
|
+
```bash
|
|
949
|
+
mastra connect remove <provider>
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
When a provider has multiple connections, the command prompts for which one to remove. Pass `--yes` to skip confirmation. Without a terminal, or with `--yes`, removing several connections at once requires `--all`, and `--connection <id>` removes a single one.
|
|
953
|
+
|
|
916
954
|
## `mastra lint`
|
|
917
955
|
|
|
918
956
|
The `mastra lint` command validates the structure and code of your Mastra project.
|
|
@@ -1100,7 +1138,7 @@ See [Import existing traces](https://mastra.ai/docs/mastra-platform/observabilit
|
|
|
1100
1138
|
|
|
1101
1139
|
#### `--project <name|slug|id>`
|
|
1102
1140
|
|
|
1103
|
-
Selects the destination Mastra Platform project.
|
|
1141
|
+
Selects the destination Mastra Platform project. Takes precedence over `MASTRA_PROJECT_ID`. Without either value, the command uses the project linked in `.mastra-project.json`.
|
|
1104
1142
|
|
|
1105
1143
|
#### `--from <date>`
|
|
1106
1144
|
|
|
@@ -1136,7 +1174,7 @@ The command loads `.env` and `.env.local` from the current directory.
|
|
|
1136
1174
|
| `MASTRA_API_TOKEN` | For headless authentication | Mastra Platform API token. Without it, the command uses credentials from `mastra auth login`. |
|
|
1137
1175
|
| `MASTRA_ORG_ID` | With `MASTRA_API_TOKEN` | Organization that owns the destination project. |
|
|
1138
1176
|
| `MASTRA_PLATFORM_ACCESS_TOKEN` | For upload and read-back with interactive login | Mastra Platform access token for the destination. Not required for `--dry-run` or when `MASTRA_API_TOKEN` is set. |
|
|
1139
|
-
| `MASTRA_PROJECT_ID` | When no project is otherwise linked | Destination project ID.
|
|
1177
|
+
| `MASTRA_PROJECT_ID` | When no project is otherwise linked | Destination project ID. The `--project` flag takes precedence over it. |
|
|
1140
1178
|
|
|
1141
1179
|
### Examples
|
|
1142
1180
|
|
|
@@ -92,6 +92,47 @@ Dot paths are supported. An empty group evaluates to `true`, and an unknown oper
|
|
|
92
92
|
|
|
93
93
|
Blocks without conditions are always included.
|
|
94
94
|
|
|
95
|
+
A `prompt_block_ref` can also have its own `rules`. They apply only to that reference in that agent, so you can reuse one stored block under different conditions. If the stored block has rules too, both must pass.
|
|
96
|
+
|
|
97
|
+
### Runtime slot with a fallback
|
|
98
|
+
|
|
99
|
+
Combine an inline `prompt_block` and a conditional `prompt_block_ref` to insert a value from request context and fall back to a shared stored block when the value is missing:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
await editor.agent.update({
|
|
103
|
+
id: 'support-agent',
|
|
104
|
+
instructions: [
|
|
105
|
+
{ type: 'text', content: 'Follow the platform safety policy.' },
|
|
106
|
+
{
|
|
107
|
+
type: 'prompt_block',
|
|
108
|
+
content: '{{userPrompt}}',
|
|
109
|
+
rules: {
|
|
110
|
+
operator: 'AND',
|
|
111
|
+
conditions: [
|
|
112
|
+
{ field: 'userPrompt', operator: 'exists' },
|
|
113
|
+
{ field: 'userPrompt', operator: 'not_equals', value: '' },
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: 'prompt_block_ref',
|
|
119
|
+
id: 'default-user-prompt',
|
|
120
|
+
rules: {
|
|
121
|
+
operator: 'OR',
|
|
122
|
+
conditions: [
|
|
123
|
+
{ field: 'userPrompt', operator: 'not_exists' },
|
|
124
|
+
{ field: 'userPrompt', operator: 'equals', value: '' },
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
})
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
When the request context contains a non-empty `userPrompt`, the agent receives that value. Otherwise, it receives the published `default-user-prompt` block. The stored block doesn't need to know about `userPrompt`.
|
|
133
|
+
|
|
134
|
+
> **Note:** The `exists` operator treats an empty string as present. The extra `''` conditions make an empty `userPrompt` use the fallback too.
|
|
135
|
+
|
|
95
136
|
## Programmatic API
|
|
96
137
|
|
|
97
138
|
Access prompt blocks through `mastra.getEditor().prompt`. See the [`prompt` namespace](https://mastra.ai/reference/editor/mastra-editor) for complete method signatures.
|
|
@@ -81,6 +81,8 @@ const editor = new MastraEditor({
|
|
|
81
81
|
|
|
82
82
|
**userIdResolver** (`ComposioUserIdResolver`): Server-side resolver that derives the effective Composio userId from authenticated context fields. Used for invoker and caller-supplied execution. The exact connected account always comes from the stored connection pin.
|
|
83
83
|
|
|
84
|
+
**sharedConnections** (`{ acl?: ComposioSharedAccountAcl }`): Opt in to Composio SHARED connected accounts. When set, connections authorized with scope: 'shared' are created as Composio SHARED accounts. acl accepts allowAllUsers, allowedUserIds, and notAllowedUserIds. Omit acl to keep Composio's deny-by-default access.
|
|
85
|
+
|
|
84
86
|
### Tool slugs
|
|
85
87
|
|
|
86
88
|
Composio tools use uppercase slug format: `GITHUB_CREATE_ISSUE`, `SLACK_SEND_MESSAGE`.
|
|
@@ -125,6 +127,23 @@ export const mastra = new Mastra({ editor })
|
|
|
125
127
|
|
|
126
128
|
Configure the agent with an invoker connection pinned to `ca_alice_salesforce`. When Bob invokes the agent, Mastra sends `bob` as the Composio user and the pinned account ID as the exact connected account. The Memory resource stays `project_123`. Composio then checks whether the account's ACL permits Bob to execute it.
|
|
127
129
|
|
|
130
|
+
### Create shared accounts
|
|
131
|
+
|
|
132
|
+
Set `sharedConnections` to create Composio [SHARED accounts](https://docs.composio.dev/docs/shared-connections) for connections authorized with `scope: 'shared'`:
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
new ComposioToolProvider({
|
|
136
|
+
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
137
|
+
sharedConnections: {
|
|
138
|
+
acl: { allowAllUsers: true, notAllowedUserIds: ['contractor_1'] },
|
|
139
|
+
},
|
|
140
|
+
})
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Without `sharedConnections`, shared-scope connections are Composio PRIVATE accounts under the `shared` user. Composio doesn't support SHARED accounts for toolkits that require custom connection fields, so authorization fails for those toolkits instead of creating a PRIVATE account.
|
|
144
|
+
|
|
145
|
+
`listConnections()` returns the requested users' PRIVATE and SHARED accounts, plus SHARED accounts owned by other users whose ACL grants access to one of the requested users. You can pin these accounts like any other connected account.
|
|
146
|
+
|
|
128
147
|
### Map application users to Composio users
|
|
129
148
|
|
|
130
149
|
Use `userIdResolver` when your Composio user IDs differ from the IDs returned by Mastra authentication, or when your application must authorize the stored account pin before execution.
|
|
@@ -49,6 +49,8 @@ The first `execute` parameter is the validated value from `inputSchema`. Destruc
|
|
|
49
49
|
|
|
50
50
|
**strict** (`boolean`): When true, Mastra enables strict tool input generation on model adapters that support it. This helps supported providers return arguments that match the tool schema more closely.
|
|
51
51
|
|
|
52
|
+
**outputValidation** (`'strict' | 'warn'`): How a result that fails outputSchema validation is handled. Both modes log a warning. 'strict' replaces the result with a validation error object. 'warn' returns the tool's actual result unchanged, for tools whose side effects have already happened. (Default: `'strict'`)
|
|
53
|
+
|
|
52
54
|
**toModelOutput** (`(output: TSchemaOut) => unknown`): Optional function that transforms the tool's execute output before it is sent back to the model. Use this to return text, json, or content-shaped outputs (including multimodal parts like images/files) to the model while still keeping the full raw output in your application code.
|
|
53
55
|
|
|
54
56
|
**transform** (`ToolPayloadTransform`): Optional target-aware transform for tool payloads before they leave runtime for display streams or user-visible transcript messages. Configure display and transcript transforms for phases such as input, inputDelta, output, error, approval, suspend, and resume.
|
|
@@ -75,7 +75,13 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
|
|
|
75
75
|
|
|
76
76
|
**workflows** (`Record<string, Workflow>`): An object where keys are workflow identifiers and values are Mastra Workflow instances. Each workflow is converted into a tool named run\_\<workflowKey>. The workflow's inputSchema becomes the tool's input schema. The workflow \*\*must\*\* have a non-empty description string property, which is used for the tool's description. If a workflow's description is missing or empty, an error will be thrown. The tool executes the workflow by calling workflow\.createRun() followed by run.start({ inputData: \<tool\_input> }). If a tool name derived from an agent or workflow (e.g., ask\_myAgent or run\_myWorkflow) collides with an explicitly defined tool name or another derived name, the explicitly defined tool takes precedence, and a warning is logged. Agents/workflows leading to subsequent collisions are skipped.
|
|
77
77
|
|
|
78
|
-
**description** (`string`): Optional description of what the MCP server does.
|
|
78
|
+
**description** (`string`): Optional description of what the MCP server does. Announced to MCP clients as part of the server's identity and returned in the registry server info.
|
|
79
|
+
|
|
80
|
+
**title** (`string`): Optional human-readable display title announced to MCP clients (e.g., 'Weather Server'). Clients fall back to name when it isn't set.
|
|
81
|
+
|
|
82
|
+
**websiteUrl** (`string`): Optional URL of the server's website, announced to MCP clients.
|
|
83
|
+
|
|
84
|
+
**icons** (`{ src: string; mimeType?: string; sizes?: string[]; theme?: 'light' | 'dark' }[]`): Optional icons clients can display for the server. src is an https: URL or a data: URI; sizes takes values like '48x48' or 'any'.
|
|
79
85
|
|
|
80
86
|
**instructions** (`string`): Optional instructions describing how to use the server and its features.
|
|
81
87
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.5-alpha.
|
|
3
|
+
"version": "1.3.5-alpha.14",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
|
|
27
27
|
"local-pkg": "^1.1.2",
|
|
28
28
|
"zod": "^4.6.4",
|
|
29
|
-
"@mastra/core": "1.75.0-alpha.
|
|
30
|
-
"@mastra/mcp": "^2.2.0-alpha.
|
|
29
|
+
"@mastra/core": "1.75.0-alpha.6",
|
|
30
|
+
"@mastra/mcp": "^2.2.0-alpha.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hono/node-server": "^2.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vitest": "4.1.11",
|
|
46
46
|
"@internal/lint": "0.0.140",
|
|
47
47
|
"@internal/types-builder": "0.0.115",
|
|
48
|
-
"@mastra/core": "1.75.0-alpha.
|
|
48
|
+
"@mastra/core": "1.75.0-alpha.6"
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://mastra.ai",
|
|
51
51
|
"repository": {
|