@mastra/mcp-docs-server 1.2.1-alpha.4 → 1.2.1-alpha.6
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/agent-builder/overview.md +2 -0
- package/.docs/docs/agents/skills.md +186 -0
- package/.docs/docs/evals/datasets/running-experiments.md +76 -0
- package/.docs/docs/workspace/skills.md +9 -1
- package/.docs/models/gateways/openrouter.md +3 -4
- package/.docs/models/gateways/vercel.md +12 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/friendli.md +3 -2
- package/.docs/models/providers/lilac.md +7 -7
- package/.docs/models/providers/siliconflow-cn.md +2 -1
- package/.docs/models/providers/synthetic.md +14 -40
- package/.docs/models/providers/wafer.ai.md +2 -1
- package/.docs/reference/agents/createSkill.md +78 -0
- package/.docs/reference/agents/getSkill.md +58 -0
- package/.docs/reference/agents/listSkills.md +53 -0
- package/.docs/reference/index.md +3 -0
- package/.docs/reference/processors/stream-error-retry-processor.md +32 -0
- package/CHANGELOG.md +14 -0
- package/package.json +3 -3
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
4
4
|
|
|
5
|
+
[YouTube video player](https://www.youtube-nocookie.com/embed/AbdgIu4Z07I)
|
|
6
|
+
|
|
5
7
|
The Agent Builder lets you build, configure, and operate Mastra agents all within the UI. It runs inside your Mastra server, persists everything to `Mastra.storage`, and supports multi-tenant agent workflows with RBAC and channel integrations.
|
|
6
8
|
|
|
7
9
|
- [**Configuration**](https://mastra.ai/docs/agent-builder/configuration): Toggle UI sections and pin admin-controlled defaults for every new agent.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Agent skills
|
|
2
|
+
|
|
3
|
+
Skills are reusable instructions that teach agents how to perform specific tasks. They follow the [Agent Skills specification](https://agentskills.io).
|
|
4
|
+
|
|
5
|
+
You can attach skills directly to an agent without setting up a workspace, filesystem, or sandbox. This is useful when you want portable, code-defined capabilities that travel with your agent definition.
|
|
6
|
+
|
|
7
|
+
## When to use agent-level skills
|
|
8
|
+
|
|
9
|
+
Use agent-level skills when:
|
|
10
|
+
|
|
11
|
+
- You want self-contained agents that don't depend on a workspace
|
|
12
|
+
- Skills are defined in code and don't need filesystem discovery
|
|
13
|
+
- You're building packages or libraries that ship agent capabilities
|
|
14
|
+
- You need per-request skill resolution based on context
|
|
15
|
+
|
|
16
|
+
For filesystem-based skill discovery across a project, use [workspace skills](https://mastra.ai/docs/workspace/skills) instead.
|
|
17
|
+
|
|
18
|
+
## Quickstart
|
|
19
|
+
|
|
20
|
+
Define a skill inline and attach it to an agent:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { Agent } from '@mastra/core/agent'
|
|
24
|
+
import { createSkill } from '@mastra/core/skills'
|
|
25
|
+
|
|
26
|
+
const codeReview = createSkill({
|
|
27
|
+
name: 'code-review',
|
|
28
|
+
description: 'Use when reviewing code changes.',
|
|
29
|
+
instructions: `
|
|
30
|
+
When reviewing code:
|
|
31
|
+
1. Check for correctness and edge cases
|
|
32
|
+
2. Verify style consistency
|
|
33
|
+
3. Look for potential bugs
|
|
34
|
+
`,
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
export const reviewer = new Agent({
|
|
38
|
+
id: 'reviewer',
|
|
39
|
+
model: 'openai/gpt-5.5',
|
|
40
|
+
instructions: 'You are a code review assistant.',
|
|
41
|
+
skills: [codeReview],
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The agent automatically gets `skill`, `skill_read`, and `skill_search` tools so it can discover and load skills during conversations.
|
|
46
|
+
|
|
47
|
+
## Defining inline skills
|
|
48
|
+
|
|
49
|
+
Use `createSkill()` to create skills entirely in code:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { createSkill } from '@mastra/core/skills'
|
|
53
|
+
|
|
54
|
+
export const releaseChecklist = createSkill({
|
|
55
|
+
name: 'release-checklist',
|
|
56
|
+
description: 'Use when preparing a release.',
|
|
57
|
+
instructions: `
|
|
58
|
+
## Release Checklist
|
|
59
|
+
1. Run the full test suite
|
|
60
|
+
2. Update CHANGELOG.md
|
|
61
|
+
3. Bump version numbers
|
|
62
|
+
4. Create a git tag
|
|
63
|
+
`,
|
|
64
|
+
references: {
|
|
65
|
+
'changelog-format.md': '# Changelog Format\nUse Keep a Changelog...',
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The `references` field bundles supporting documents that the agent can read with the `skill_read` tool, just like `references/` files in a filesystem skill.
|
|
71
|
+
|
|
72
|
+
> **Note:** Visit [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill) for the full API.
|
|
73
|
+
|
|
74
|
+
## Filesystem path skills
|
|
75
|
+
|
|
76
|
+
Point to skill directories on disk without a workspace:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { Agent } from '@mastra/core/agent'
|
|
80
|
+
import { createSkill } from '@mastra/core/skills'
|
|
81
|
+
|
|
82
|
+
export const agent = new Agent({
|
|
83
|
+
id: 'my-agent',
|
|
84
|
+
model: 'openai/gpt-5.5',
|
|
85
|
+
skills: [
|
|
86
|
+
'./skills/code-review', // path to a SKILL.md directory
|
|
87
|
+
'./skills/testing', // another filesystem skill
|
|
88
|
+
createSkill({
|
|
89
|
+
/* ... */
|
|
90
|
+
}), // inline skill
|
|
91
|
+
],
|
|
92
|
+
})
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Filesystem paths use `LocalSkillSource` under the hood, which reads `SKILL.md` files following the same format as [workspace skills](https://mastra.ai/docs/workspace/skills).
|
|
96
|
+
|
|
97
|
+
## Dynamic skills
|
|
98
|
+
|
|
99
|
+
For per-request skill resolution, pass a function:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { Agent } from '@mastra/core/agent'
|
|
103
|
+
import { createSkill } from '@mastra/core/skills'
|
|
104
|
+
|
|
105
|
+
const devSkill = createSkill({
|
|
106
|
+
name: 'dev-tools',
|
|
107
|
+
description: 'Developer productivity tools.',
|
|
108
|
+
instructions: '...',
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const supportSkill = createSkill({
|
|
112
|
+
name: 'support-guide',
|
|
113
|
+
description: 'Customer support guidelines.',
|
|
114
|
+
instructions: '...',
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
export const agent = new Agent({
|
|
118
|
+
id: 'dynamic-agent',
|
|
119
|
+
model: 'openai/gpt-5.5',
|
|
120
|
+
skills: ({ requestContext }) => {
|
|
121
|
+
const role = requestContext.get('userRole')
|
|
122
|
+
if (role === 'developer') return [devSkill]
|
|
123
|
+
return [supportSkill]
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The resolver function receives `{ requestContext }` and returns a `SkillInput[]` array or a `Promise<SkillInput[]>`.
|
|
129
|
+
|
|
130
|
+
## Merging with workspace skills
|
|
131
|
+
|
|
132
|
+
When an agent has both `skills` and a workspace with skills configured, they merge. Agent-level skills take precedence on name conflicts:
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
import { Agent } from '@mastra/core/agent'
|
|
136
|
+
import { Workspace, LocalFilesystem } from '@mastra/core/workspace'
|
|
137
|
+
import { createSkill } from '@mastra/core/skills'
|
|
138
|
+
|
|
139
|
+
const workspace = new Workspace({
|
|
140
|
+
filesystem: new LocalFilesystem({ basePath: './workspace' }),
|
|
141
|
+
skills: ['skills'], // provides "code-review" skill
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const customReview = createSkill({
|
|
145
|
+
name: 'code-review', // same name as workspace skill
|
|
146
|
+
description: 'Custom review process.',
|
|
147
|
+
instructions: '...',
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
export const agent = new Agent({
|
|
151
|
+
id: 'reviewer',
|
|
152
|
+
model: 'openai/gpt-5.5',
|
|
153
|
+
workspace,
|
|
154
|
+
skills: [customReview], // agent-level "code-review" wins
|
|
155
|
+
})
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Programmatic skill access
|
|
159
|
+
|
|
160
|
+
Use `agent.getSkill()` and `agent.listSkills()` to access skills from application code (e.g., in workflows or API routes):
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
import { reviewer } from '../mastra/agents'
|
|
164
|
+
|
|
165
|
+
// Get a specific skill by name
|
|
166
|
+
const skill = await reviewer.getSkill('code-review')
|
|
167
|
+
if (skill) {
|
|
168
|
+
console.log(skill.instructions)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// List all available skills
|
|
172
|
+
const allSkills = await reviewer.listSkills()
|
|
173
|
+
for (const meta of allSkills) {
|
|
174
|
+
console.log(`${meta.name}: ${meta.description}`)
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
> **Note:** Visit [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill) and [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills) for the full API.
|
|
179
|
+
|
|
180
|
+
## Related
|
|
181
|
+
|
|
182
|
+
- [Workspace skills](https://mastra.ai/docs/workspace/skills)
|
|
183
|
+
- [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
|
|
184
|
+
- [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill)
|
|
185
|
+
- [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills)
|
|
186
|
+
- [Agent skills specification](https://agentskills.io)
|
|
@@ -127,6 +127,82 @@ for (const item of summary.results) {
|
|
|
127
127
|
|
|
128
128
|
> **Info:** Visit the [Scorers overview](https://mastra.ai/docs/evals/overview) for details on available and custom scorers.
|
|
129
129
|
|
|
130
|
+
## Tool mocks
|
|
131
|
+
|
|
132
|
+
When an experiment runs an agent that calls side-effecting tools, you can make the run deterministic by attaching static tool mocks to individual dataset items. During the experiment, a mocked tool returns its declared output instead of executing. Tools that have no mock on the item run live.
|
|
133
|
+
|
|
134
|
+
Mocks live on the dataset item, so they version with the row and travel with the test case. Each mock declares a tool name, the arguments it expects, and the output to return:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
await dataset.addItem({
|
|
138
|
+
input: 'What is the weather in Seattle?',
|
|
139
|
+
toolMocks: [
|
|
140
|
+
{
|
|
141
|
+
toolName: 'getWeather',
|
|
142
|
+
args: { city: 'Seattle' },
|
|
143
|
+
output: { temperature: 60, conditions: 'rainy' },
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
})
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Tool mocks are supported for `agent` targets only.
|
|
150
|
+
|
|
151
|
+
### Matching and consumption
|
|
152
|
+
|
|
153
|
+
Arguments are matched strictly: object key order is ignored, array order is significant, and there is no type coercion. A mock is served only when the agent calls the tool with arguments that deep-equal the mock's `args`.
|
|
154
|
+
|
|
155
|
+
When an item declares several mocks for the same tool and arguments, they are consumed in order — the first call gets the first mock, the next call gets the second, and so on. Ordering is tracked per `(toolName, args)` group and is independent across different arguments.
|
|
156
|
+
|
|
157
|
+
### Matching mode
|
|
158
|
+
|
|
159
|
+
By default each mock matches strictly on its `args`. Set `matchArgs: 'ignore'` to match on the tool name only — the mock's `args` are not compared and the next unconsumed mock for that tool is served regardless of how the agent called it:
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
const subAgentMock = {
|
|
163
|
+
toolName: 'agent-balanceAgent',
|
|
164
|
+
args: { prompt: 'look up the balance for YJ' },
|
|
165
|
+
output: { text: "YJ's balance is $100." },
|
|
166
|
+
matchArgs: 'ignore',
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
This is useful when a tool's arguments are noisy or generated by the model. The most common case is mocking a **sub-agent's response**: a delegated sub-agent is exposed to the parent as a tool named `agent-<name>`, and its arguments include an LLM-authored `prompt` plus runtime-injected fields. Mocking `agent-<name>` returns the canned response in place of running the sub-agent and its inner tools. When you create a mock from a trace, sub-agent delegation calls are derived with `matchArgs: 'ignore'` automatically; you can change it to `'strict'` to pin the exact arguments.
|
|
171
|
+
|
|
172
|
+
### Failures
|
|
173
|
+
|
|
174
|
+
A mocked tool call fails the item when the arguments do not match or all matching mocks have been consumed:
|
|
175
|
+
|
|
176
|
+
- `TOOL_MOCK_MISMATCH` — the tool was called with arguments that no mock matches.
|
|
177
|
+
- `TOOL_MOCK_EXHAUSTED` — every matching mock has already been consumed.
|
|
178
|
+
|
|
179
|
+
When a mocked tool is mis-called, the agent run is aborted immediately, so the model cannot go on to call any further tools — including unmocked, side-effecting tools that would otherwise run live. These failures are deterministic, so they are not retried. Mocks that are declared but never used do not fail the item — they are reported as unconsumed.
|
|
180
|
+
|
|
181
|
+
While an item has mocks, the agent's tools execute sequentially so repeated `(toolName, args)` mocks are consumed in the provider's call order. This serialization applies only to items that declare mocks.
|
|
182
|
+
|
|
183
|
+
### Diagnostics
|
|
184
|
+
|
|
185
|
+
Each item result carries a `toolMockReport` describing what the run did with the item's mocks:
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
for (const item of summary.results) {
|
|
189
|
+
const report = item.toolMockReport
|
|
190
|
+
if (!report) continue
|
|
191
|
+
|
|
192
|
+
console.log(report.served) // mocks matched and returned
|
|
193
|
+
console.log(report.unconsumed) // mocks declared but never used
|
|
194
|
+
console.log(report.liveCalls) // unmocked tools that ran live
|
|
195
|
+
console.log(report.failure) // the mismatch/exhausted failure, if any
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
In [Studio](https://mastra.ai/docs/studio/overview), edit a dataset item to author tool mocks as a JSON array, and open an experiment result to see the same report.
|
|
200
|
+
|
|
201
|
+
### Limitations
|
|
202
|
+
|
|
203
|
+
- **No tool span for mocked calls.** A mocked call returns its output before the tool executes, so it does not create a tool span. Trajectory scorers backed by stored traces may therefore not see mocked tool calls. Trajectory extraction that falls back to the agent's message output still sees them, so trajectory scoring can differ depending on your observability configuration.
|
|
204
|
+
- **Storage support.** Tool mocks and tool mock reports are persisted by the LibSQL, PostgreSQL, MongoDB, and Spanner adapters. The MySQL adapter does not support them and rejects writes that carry tool mocks or a tool mock report so the feature never silently runs tools live.
|
|
205
|
+
|
|
130
206
|
## Async experiments
|
|
131
207
|
|
|
132
208
|
`startExperiment()` blocks until every item completes. For long-running datasets, use [`startExperimentAsync()`](https://mastra.ai/reference/datasets/startExperimentAsync) to start the experiment in the background:
|
|
@@ -187,8 +187,16 @@ const workspace = new Workspace({
|
|
|
187
187
|
|
|
188
188
|
When `skillSource` is provided, it's used instead of the workspace filesystem for skill discovery.
|
|
189
189
|
|
|
190
|
+
## Agent-level skills
|
|
191
|
+
|
|
192
|
+
You can also attach skills directly to an agent without a workspace using `createSkill()` and the agent's `skills` config. When both agent-level and workspace-level skills exist, they merge — agent-level skills take precedence on name conflicts.
|
|
193
|
+
|
|
194
|
+
See [Agent skills](https://mastra.ai/docs/agents/skills) for details.
|
|
195
|
+
|
|
190
196
|
## Related
|
|
191
197
|
|
|
198
|
+
- [Agent skills](https://mastra.ai/docs/agents/skills)
|
|
192
199
|
- [Agent skills specification](https://agentskills.io)
|
|
193
200
|
- [Workspace overview](https://mastra.ai/docs/workspace/overview)
|
|
194
|
-
- [Search and indexing](https://mastra.ai/docs/workspace/search)
|
|
201
|
+
- [Search and indexing](https://mastra.ai/docs/workspace/search)
|
|
202
|
+
- [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenRouter
|
|
2
2
|
|
|
3
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
3
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 336 models through Mastra's model router.
|
|
4
4
|
|
|
5
5
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
6
6
|
|
|
@@ -97,7 +97,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
97
97
|
| `deepseek/deepseek-v3.2-exp` |
|
|
98
98
|
| `deepseek/deepseek-v4-flash` |
|
|
99
99
|
| `deepseek/deepseek-v4-pro` |
|
|
100
|
-
| `essentialai/rnj-1-instruct` |
|
|
101
100
|
| `google/gemini-2.5-flash` |
|
|
102
101
|
| `google/gemini-2.5-flash-image` |
|
|
103
102
|
| `google/gemini-2.5-flash-lite` |
|
|
@@ -284,7 +283,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
284
283
|
| `poolside/laguna-m.1:free` |
|
|
285
284
|
| `poolside/laguna-xs.2` |
|
|
286
285
|
| `poolside/laguna-xs.2:free` |
|
|
287
|
-
| `prime-intellect/intellect-3` |
|
|
288
286
|
| `qwen/qwen-2.5-72b-instruct` |
|
|
289
287
|
| `qwen/qwen-2.5-7b-instruct` |
|
|
290
288
|
| `qwen/qwen-2.5-coder-32b-instruct` |
|
|
@@ -370,4 +368,5 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
370
368
|
| `z-ai/glm-5` |
|
|
371
369
|
| `z-ai/glm-5-turbo` |
|
|
372
370
|
| `z-ai/glm-5.1` |
|
|
373
|
-
| `z-ai/glm-5.2` |
|
|
371
|
+
| `z-ai/glm-5.2` |
|
|
372
|
+
| `z-ai/glm-5v-turbo` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vercel
|
|
2
2
|
|
|
3
|
-
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
3
|
+
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 290 models through Mastra's model router.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
|
|
6
6
|
|
|
@@ -216,6 +216,8 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
216
216
|
| `openai/gpt-4o` |
|
|
217
217
|
| `openai/gpt-4o-mini` |
|
|
218
218
|
| `openai/gpt-4o-mini-search-preview` |
|
|
219
|
+
| `openai/gpt-4o-mini-transcribe` |
|
|
220
|
+
| `openai/gpt-4o-transcribe` |
|
|
219
221
|
| `openai/gpt-5` |
|
|
220
222
|
| `openai/gpt-5-chat` |
|
|
221
223
|
| `openai/gpt-5-codex` |
|
|
@@ -246,6 +248,9 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
246
248
|
| `openai/gpt-oss-120b` |
|
|
247
249
|
| `openai/gpt-oss-20b` |
|
|
248
250
|
| `openai/gpt-oss-safeguard-20b` |
|
|
251
|
+
| `openai/gpt-realtime-1.5` |
|
|
252
|
+
| `openai/gpt-realtime-2` |
|
|
253
|
+
| `openai/gpt-realtime-mini` |
|
|
249
254
|
| `openai/o1` |
|
|
250
255
|
| `openai/o3` |
|
|
251
256
|
| `openai/o3-deep-research` |
|
|
@@ -255,6 +260,9 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
255
260
|
| `openai/text-embedding-3-large` |
|
|
256
261
|
| `openai/text-embedding-3-small` |
|
|
257
262
|
| `openai/text-embedding-ada-002` |
|
|
263
|
+
| `openai/tts-1` |
|
|
264
|
+
| `openai/tts-1-hd` |
|
|
265
|
+
| `openai/whisper-1` |
|
|
258
266
|
| `perplexity/sonar` |
|
|
259
267
|
| `perplexity/sonar-pro` |
|
|
260
268
|
| `perplexity/sonar-reasoning-pro` |
|
|
@@ -295,6 +303,9 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
295
303
|
| `xai/grok-imagine-image` |
|
|
296
304
|
| `xai/grok-imagine-video` |
|
|
297
305
|
| `xai/grok-imagine-video-1.5-preview` |
|
|
306
|
+
| `xai/grok-stt` |
|
|
307
|
+
| `xai/grok-tts` |
|
|
308
|
+
| `xai/grok-voice-think-fast-1.0` |
|
|
298
309
|
| `xiaomi/mimo-v2-flash` |
|
|
299
310
|
| `xiaomi/mimo-v2-pro` |
|
|
300
311
|
| `xiaomi/mimo-v2.5` |
|
package/.docs/models/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Model Providers
|
|
2
2
|
|
|
3
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
3
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 4550 models from 133 providers through a single API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -44,7 +44,7 @@ for await (const chunk of stream) {
|
|
|
44
44
|
| `baseten/zai-org/GLM-4.7` | 200K | | | | | | $0.60 | $2 |
|
|
45
45
|
| `baseten/zai-org/GLM-5` | 203K | | | | | | $0.95 | $3 |
|
|
46
46
|
| `baseten/zai-org/GLM-5.1` | 203K | | | | | | $1 | $4 |
|
|
47
|
-
| `baseten/zai-org/GLM-5.2` |
|
|
47
|
+
| `baseten/zai-org/GLM-5.2` | 262K | | | | | | $1 | $4 |
|
|
48
48
|
|
|
49
49
|
## Advanced configuration
|
|
50
50
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Friendli
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 7 Friendli models through Mastra's model router. Authentication is handled automatically using the `FRIENDLI_TOKEN` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Friendli documentation](https://friendli.ai/docs/guides/serverless_endpoints/introduction).
|
|
6
6
|
|
|
@@ -40,6 +40,7 @@ for await (const chunk of stream) {
|
|
|
40
40
|
| `friendli/Qwen/Qwen3-235B-A22B-Instruct-2507` | 262K | | | | | | $0.20 | $0.80 |
|
|
41
41
|
| `friendli/zai-org/GLM-5` | 203K | | | | | | $1 | $3 |
|
|
42
42
|
| `friendli/zai-org/GLM-5.1` | 203K | | | | | | $1 | $4 |
|
|
43
|
+
| `friendli/zai-org/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
43
44
|
|
|
44
45
|
## Advanced configuration
|
|
45
46
|
|
|
@@ -69,7 +70,7 @@ const agent = new Agent({
|
|
|
69
70
|
model: ({ requestContext }) => {
|
|
70
71
|
const useAdvanced = requestContext.task === "complex";
|
|
71
72
|
return useAdvanced
|
|
72
|
-
? "friendli/zai-org/GLM-5.
|
|
73
|
+
? "friendli/zai-org/GLM-5.2"
|
|
73
74
|
: "friendli/MiniMaxAI/MiniMax-M2.5";
|
|
74
75
|
}
|
|
75
76
|
});
|
|
@@ -32,12 +32,12 @@ for await (const chunk of stream) {
|
|
|
32
32
|
|
|
33
33
|
## Models
|
|
34
34
|
|
|
35
|
-
| Model
|
|
36
|
-
|
|
|
37
|
-
| `lilac/google/gemma-4-31b-it`
|
|
38
|
-
| `lilac/minimaxai/minimax-
|
|
39
|
-
| `lilac/moonshotai/kimi-k2.6`
|
|
40
|
-
| `lilac/zai-org/glm-5.
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ----------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `lilac/google/gemma-4-31b-it` | 262K | | | | | | $0.11 | $0.35 |
|
|
38
|
+
| `lilac/minimaxai/minimax-m3` | 1.0M | | | | | | $0.28 | $1 |
|
|
39
|
+
| `lilac/moonshotai/kimi-k2.6` | 262K | | | | | | $0.70 | $4 |
|
|
40
|
+
| `lilac/zai-org/glm-5.2` | 524K | | | | | | $0.90 | $3 |
|
|
41
41
|
|
|
42
42
|
## Advanced configuration
|
|
43
43
|
|
|
@@ -67,7 +67,7 @@ const agent = new Agent({
|
|
|
67
67
|
model: ({ requestContext }) => {
|
|
68
68
|
const useAdvanced = requestContext.task === "complex";
|
|
69
69
|
return useAdvanced
|
|
70
|
-
? "lilac/zai-org/glm-5.
|
|
70
|
+
? "lilac/zai-org/glm-5.2"
|
|
71
71
|
: "lilac/google/gemma-4-31b-it";
|
|
72
72
|
}
|
|
73
73
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SiliconFlow (China)
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 75 SiliconFlow (China) models through Mastra's model router. Authentication is handled automatically using the `SILICONFLOW_CN_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [SiliconFlow (China) documentation](https://cloud.siliconflow.com/models).
|
|
6
6
|
|
|
@@ -43,6 +43,7 @@ for await (const chunk of stream) {
|
|
|
43
43
|
| `siliconflow-cn/deepseek-ai/DeepSeek-V3` | 164K | | | | | | $0.25 | $1 |
|
|
44
44
|
| `siliconflow-cn/deepseek-ai/DeepSeek-V3.1-Terminus` | 164K | | | | | | $0.27 | $1 |
|
|
45
45
|
| `siliconflow-cn/deepseek-ai/DeepSeek-V3.2` | 164K | | | | | | $0.27 | $0.42 |
|
|
46
|
+
| `siliconflow-cn/deepseek-ai/DeepSeek-V4-Flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
46
47
|
| `siliconflow-cn/deepseek-ai/DeepSeek-V4-Pro` | 1.0M | | | | | | $2 | $3 |
|
|
47
48
|
| `siliconflow-cn/deepseek-ai/deepseek-vl2` | 4K | | | | | | $0.15 | $0.15 |
|
|
48
49
|
| `siliconflow-cn/inclusionAI/Ling-flash-2.0` | 131K | | | | | | $0.14 | $0.57 |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Synthetic
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 8 Synthetic models through Mastra's model router. Authentication is handled automatically using the `SYNTHETIC_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Synthetic documentation](https://synthetic.new/pricing).
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ const agent = new Agent({
|
|
|
15
15
|
id: "my-agent",
|
|
16
16
|
name: "My Agent",
|
|
17
17
|
instructions: "You are a helpful assistant",
|
|
18
|
-
model: "synthetic/hf:MiniMaxAI/MiniMax-
|
|
18
|
+
model: "synthetic/hf:MiniMaxAI/MiniMax-M3"
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// Generate a response
|
|
@@ -32,42 +32,16 @@ for await (const chunk of stream) {
|
|
|
32
32
|
|
|
33
33
|
## Models
|
|
34
34
|
|
|
35
|
-
| Model
|
|
36
|
-
|
|
|
37
|
-
| `synthetic/hf:
|
|
38
|
-
| `synthetic/hf:
|
|
39
|
-
| `synthetic/hf:
|
|
40
|
-
| `synthetic/hf:
|
|
41
|
-
| `synthetic/hf:
|
|
42
|
-
| `synthetic/hf:
|
|
43
|
-
| `synthetic/hf:
|
|
44
|
-
| `synthetic/hf:
|
|
45
|
-
| `synthetic/hf:meta-llama/Llama-3.1-70B-Instruct` | 128K | | | | | | $0.90 | $0.90 |
|
|
46
|
-
| `synthetic/hf:meta-llama/Llama-3.1-8B-Instruct` | 128K | | | | | | $0.20 | $0.20 |
|
|
47
|
-
| `synthetic/hf:meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.90 | $0.90 |
|
|
48
|
-
| `synthetic/hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8` | 524K | | | | | | $0.22 | $0.88 |
|
|
49
|
-
| `synthetic/hf:meta-llama/Llama-4-Scout-17B-16E-Instruct` | 328K | | | | | | $0.15 | $0.60 |
|
|
50
|
-
| `synthetic/hf:MiniMaxAI/MiniMax-M2` | 197K | | | | | | $0.55 | $2 |
|
|
51
|
-
| `synthetic/hf:MiniMaxAI/MiniMax-M2.1` | 205K | | | | | | $0.55 | $2 |
|
|
52
|
-
| `synthetic/hf:MiniMaxAI/MiniMax-M2.5` | 191K | | | | | | $0.60 | $3 |
|
|
53
|
-
| `synthetic/hf:MiniMaxAI/MiniMax-M3` | 524K | | | | | | $0.60 | $1 |
|
|
54
|
-
| `synthetic/hf:moonshotai/Kimi-K2-Instruct-0905` | 262K | | | | | | $1 | $1 |
|
|
55
|
-
| `synthetic/hf:moonshotai/Kimi-K2-Thinking` | 262K | | | | | | $0.55 | $2 |
|
|
56
|
-
| `synthetic/hf:moonshotai/Kimi-K2.5` | 262K | | | | | | $0.55 | $2 |
|
|
57
|
-
| `synthetic/hf:moonshotai/Kimi-K2.6` | 262K | | | | | | $0.95 | $4 |
|
|
58
|
-
| `synthetic/hf:nvidia/Kimi-K2.5-NVFP4` | 262K | | | | | | $0.55 | $2 |
|
|
59
|
-
| `synthetic/hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4` | 262K | | | | | | $0.30 | $1 |
|
|
60
|
-
| `synthetic/hf:openai/gpt-oss-120b` | 128K | | | | | | $0.10 | $0.10 |
|
|
61
|
-
| `synthetic/hf:Qwen/Qwen2.5-Coder-32B-Instruct` | 33K | | | | | | $0.80 | $0.80 |
|
|
62
|
-
| `synthetic/hf:Qwen/Qwen3-235B-A22B-Instruct-2507` | 256K | | | | | | $0.20 | $0.60 |
|
|
63
|
-
| `synthetic/hf:Qwen/Qwen3-235B-A22B-Thinking-2507` | 256K | | | | | | $0.65 | $3 |
|
|
64
|
-
| `synthetic/hf:Qwen/Qwen3-Coder-480B-A35B-Instruct` | 256K | | | | | | $2 | $2 |
|
|
65
|
-
| `synthetic/hf:Qwen/Qwen3.5-397B-A17B` | 262K | | | | | | $0.60 | $3 |
|
|
66
|
-
| `synthetic/hf:zai-org/GLM-4.6` | 200K | | | | | | $0.55 | $2 |
|
|
67
|
-
| `synthetic/hf:zai-org/GLM-4.7` | 200K | | | | | | $0.55 | $2 |
|
|
68
|
-
| `synthetic/hf:zai-org/GLM-4.7-Flash` | 197K | | | | | | $0.06 | $0.40 |
|
|
69
|
-
| `synthetic/hf:zai-org/GLM-5` | 197K | | | | | | $1 | $3 |
|
|
70
|
-
| `synthetic/hf:zai-org/GLM-5.1` | 197K | | | | | | $1 | $3 |
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ------------------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `synthetic/hf:MiniMaxAI/MiniMax-M3` | 524K | | | | | | $0.60 | $1 |
|
|
38
|
+
| `synthetic/hf:moonshotai/Kimi-K2.6` | 262K | | | | | | $0.95 | $4 |
|
|
39
|
+
| `synthetic/hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4` | 262K | | | | | | $0.30 | $1 |
|
|
40
|
+
| `synthetic/hf:openai/gpt-oss-120b` | 128K | | | | | | $0.10 | $0.10 |
|
|
41
|
+
| `synthetic/hf:Qwen/Qwen3.5-397B-A17B` | 262K | | | | | | $0.60 | $3 |
|
|
42
|
+
| `synthetic/hf:zai-org/GLM-4.7` | 200K | | | | | | $0.55 | $2 |
|
|
43
|
+
| `synthetic/hf:zai-org/GLM-4.7-Flash` | 197K | | | | | | $0.06 | $0.40 |
|
|
44
|
+
| `synthetic/hf:zai-org/GLM-5.1` | 197K | | | | | | $1 | $3 |
|
|
71
45
|
|
|
72
46
|
## Advanced configuration
|
|
73
47
|
|
|
@@ -79,7 +53,7 @@ const agent = new Agent({
|
|
|
79
53
|
name: "custom-agent",
|
|
80
54
|
model: {
|
|
81
55
|
url: "https://api.synthetic.new/openai/v1",
|
|
82
|
-
id: "synthetic/hf:MiniMaxAI/MiniMax-
|
|
56
|
+
id: "synthetic/hf:MiniMaxAI/MiniMax-M3",
|
|
83
57
|
apiKey: process.env.SYNTHETIC_API_KEY,
|
|
84
58
|
headers: {
|
|
85
59
|
"X-Custom-Header": "value"
|
|
@@ -98,7 +72,7 @@ const agent = new Agent({
|
|
|
98
72
|
const useAdvanced = requestContext.task === "complex";
|
|
99
73
|
return useAdvanced
|
|
100
74
|
? "synthetic/hf:zai-org/GLM-5.1"
|
|
101
|
-
: "synthetic/hf:MiniMaxAI/MiniMax-
|
|
75
|
+
: "synthetic/hf:MiniMaxAI/MiniMax-M3";
|
|
102
76
|
}
|
|
103
77
|
});
|
|
104
78
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Wafer
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 8 Wafer models through Mastra's model router. Authentication is handled automatically using the `WAFER_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Wafer documentation](https://docs.wafer.ai/wafer-pass).
|
|
6
6
|
|
|
@@ -37,6 +37,7 @@ for await (const chunk of stream) {
|
|
|
37
37
|
| `wafer.ai/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
38
38
|
| `wafer.ai/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
|
|
39
39
|
| `wafer.ai/GLM-5.1` | 203K | | | | | | $1 | $3 |
|
|
40
|
+
| `wafer.ai/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
40
41
|
| `wafer.ai/Kimi-K2.6` | 262K | | | | | | $0.68 | $3 |
|
|
41
42
|
| `wafer.ai/Qwen3.5-397B-A17B` | 262K | | | | | | $0.43 | $3 |
|
|
42
43
|
| `wafer.ai/Qwen3.6-35B-A3B` | 256K | | | | | | $0.15 | $1 |
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# `createSkill()`
|
|
2
|
+
|
|
3
|
+
Creates an inline skill that can be passed directly to an agent's `skills` config without a filesystem or workspace.
|
|
4
|
+
|
|
5
|
+
The returned object implements the `Skill` interface and works anywhere a filesystem-discovered skill works.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { createSkill } from '@mastra/core/skills'
|
|
11
|
+
|
|
12
|
+
const reviewSkill = createSkill({
|
|
13
|
+
name: 'code-review',
|
|
14
|
+
description: 'Use when reviewing code changes.',
|
|
15
|
+
instructions: `
|
|
16
|
+
When reviewing code:
|
|
17
|
+
1. Check for correctness
|
|
18
|
+
2. Check for style consistency
|
|
19
|
+
3. Look for potential bugs
|
|
20
|
+
`,
|
|
21
|
+
references: {
|
|
22
|
+
'checklist.md': '# Review Checklist\n- No unused imports\n- Error handling present',
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Parameters
|
|
28
|
+
|
|
29
|
+
**name** (`string`): Unique skill name. Used as the identifier when agents activate the skill. Must be a valid slug (lowercase, hyphens allowed).
|
|
30
|
+
|
|
31
|
+
**description** (`string`): Short description shown to the agent in the system message. Helps the agent decide when to use the skill.
|
|
32
|
+
|
|
33
|
+
**instructions** (`string`): The full skill instructions in markdown. Loaded into the conversation when the agent activates the skill.
|
|
34
|
+
|
|
35
|
+
**references** (`Record<string, string>`): Supporting documents the agent can read with the \`skill\_read\` tool. Keys are filenames, values are file contents.
|
|
36
|
+
|
|
37
|
+
**license** (`string`): SPDX license identifier for the skill.
|
|
38
|
+
|
|
39
|
+
**compatibility** (`unknown`): Compatibility requirements. The Agent Skills spec leaves this flexible — can be a string array, object, or any structure your tooling expects.
|
|
40
|
+
|
|
41
|
+
**user-invocable** (`boolean`): Whether end users can invoke this skill directly. Defaults to \`undefined\` (agent decides).
|
|
42
|
+
|
|
43
|
+
**metadata** (`Record<string, unknown>`): Arbitrary metadata attached to the skill.
|
|
44
|
+
|
|
45
|
+
## Return value
|
|
46
|
+
|
|
47
|
+
Returns an `InlineSkill` object that implements the `Skill` interface:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
interface InlineSkill extends Skill {
|
|
51
|
+
__inline: true
|
|
52
|
+
__referenceContents: Record<string, string>
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The skill is assigned a synthetic path of `inline/<name>` (e.g., `inline/code-review`).
|
|
57
|
+
|
|
58
|
+
## Validation
|
|
59
|
+
|
|
60
|
+
`createSkill()` validates inputs using the same rules as filesystem skills:
|
|
61
|
+
|
|
62
|
+
- `name` is required and must be a valid slug
|
|
63
|
+
- `description` is required
|
|
64
|
+
- `instructions` is required and non-empty
|
|
65
|
+
|
|
66
|
+
If validation fails, an `Error` is thrown with details about the invalid fields.
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// Throws: Invalid skill "": name is required
|
|
70
|
+
createSkill({ name: '', description: 'test', instructions: 'test' })
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Related
|
|
74
|
+
|
|
75
|
+
- [Agent skills](https://mastra.ai/docs/agents/skills)
|
|
76
|
+
- [Workspace skills](https://mastra.ai/docs/workspace/skills)
|
|
77
|
+
- [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill)
|
|
78
|
+
- [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# `.getSkill()`
|
|
2
|
+
|
|
3
|
+
Retrieves a specific skill by name from the agent's configured skills (both agent-level and workspace skills).
|
|
4
|
+
|
|
5
|
+
## Usage example
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { agent } from '../mastra/agents'
|
|
9
|
+
|
|
10
|
+
const skill = await agent.getSkill('code-review')
|
|
11
|
+
|
|
12
|
+
if (skill) {
|
|
13
|
+
console.log(skill.name) // "code-review"
|
|
14
|
+
console.log(skill.description) // "Use when reviewing code changes."
|
|
15
|
+
console.log(skill.instructions) // Full markdown instructions
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
**skillName** (`string`): The name of the skill to retrieve.
|
|
22
|
+
|
|
23
|
+
**options** (`object`): Options for skill resolution.
|
|
24
|
+
|
|
25
|
+
**options.requestContext** (`RequestContext`): Request context passed to dynamic skill resolvers.
|
|
26
|
+
|
|
27
|
+
## Return value
|
|
28
|
+
|
|
29
|
+
Returns `Promise<Skill | null>`.
|
|
30
|
+
|
|
31
|
+
Returns the `Skill` object if found, or `null` if no skill with that name exists.
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
interface Skill {
|
|
35
|
+
name: string
|
|
36
|
+
description: string
|
|
37
|
+
instructions: string
|
|
38
|
+
path: string
|
|
39
|
+
source: { type: string; projectPath: string }
|
|
40
|
+
references: string[]
|
|
41
|
+
scripts: string[]
|
|
42
|
+
assets: string[]
|
|
43
|
+
license?: string
|
|
44
|
+
compatibility?: string[]
|
|
45
|
+
'user-invocable'?: boolean
|
|
46
|
+
metadata?: Record<string, unknown>
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Merging behavior
|
|
51
|
+
|
|
52
|
+
When both agent-level skills and workspace skills are configured, `.getSkill()` searches the merged set. Agent-level skills take precedence on name conflicts.
|
|
53
|
+
|
|
54
|
+
## Related
|
|
55
|
+
|
|
56
|
+
- [Agent skills](https://mastra.ai/docs/agents/skills)
|
|
57
|
+
- [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills)
|
|
58
|
+
- [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# `.listSkills()`
|
|
2
|
+
|
|
3
|
+
Returns metadata for all skills available to the agent, including both agent-level and workspace skills.
|
|
4
|
+
|
|
5
|
+
## Usage example
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { agent } from '../mastra/agents'
|
|
9
|
+
|
|
10
|
+
const skills = await agent.listSkills()
|
|
11
|
+
|
|
12
|
+
for (const skill of skills) {
|
|
13
|
+
console.log(`${skill.name}: ${skill.description}`)
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
**options** (`object`): Options for skill resolution.
|
|
20
|
+
|
|
21
|
+
**options.requestContext** (`RequestContext`): Request context passed to dynamic skill resolvers.
|
|
22
|
+
|
|
23
|
+
## Return value
|
|
24
|
+
|
|
25
|
+
Returns `Promise<SkillMetadata[]>`.
|
|
26
|
+
|
|
27
|
+
Each entry contains the metadata for a discovered skill:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
interface SkillMetadata {
|
|
31
|
+
name: string
|
|
32
|
+
description: string
|
|
33
|
+
path: string
|
|
34
|
+
source: { type: string; projectPath: string }
|
|
35
|
+
references: string[]
|
|
36
|
+
scripts: string[]
|
|
37
|
+
assets: string[]
|
|
38
|
+
license?: string
|
|
39
|
+
compatibility?: string[]
|
|
40
|
+
'user-invocable'?: boolean
|
|
41
|
+
metadata?: Record<string, unknown>
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Merging behavior
|
|
46
|
+
|
|
47
|
+
When both agent-level skills and workspace skills are configured, `.listSkills()` returns the merged set. Agent-level skills take precedence on name conflicts — if both define a skill named `code-review`, only the agent-level version appears in the result.
|
|
48
|
+
|
|
49
|
+
## Related
|
|
50
|
+
|
|
51
|
+
- [Agent skills](https://mastra.ai/docs/agents/skills)
|
|
52
|
+
- [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill)
|
|
53
|
+
- [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
|
package/.docs/reference/index.md
CHANGED
|
@@ -7,6 +7,7 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
7
7
|
- [Agent Class](https://mastra.ai/reference/agents/agent)
|
|
8
8
|
- [Channels](https://mastra.ai/reference/agents/channels)
|
|
9
9
|
- [createInngestAgent()](https://mastra.ai/reference/agents/inngest-agent)
|
|
10
|
+
- [createSkill()](https://mastra.ai/reference/agents/createSkill)
|
|
10
11
|
- [DurableAgent](https://mastra.ai/reference/agents/durable-agent)
|
|
11
12
|
- [.generate()](https://mastra.ai/reference/agents/generate)
|
|
12
13
|
- [.generateLegacy()](https://mastra.ai/reference/agents/generateLegacy)
|
|
@@ -19,10 +20,12 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
19
20
|
- [.getMemory()](https://mastra.ai/reference/agents/getMemory)
|
|
20
21
|
- [.getMetadata()](https://mastra.ai/reference/agents/getMetadata)
|
|
21
22
|
- [.getModel()](https://mastra.ai/reference/agents/getModel)
|
|
23
|
+
- [.getSkill()](https://mastra.ai/reference/agents/getSkill)
|
|
22
24
|
- [.getTools()](https://mastra.ai/reference/agents/getTools)
|
|
23
25
|
- [.getVoice()](https://mastra.ai/reference/agents/getVoice)
|
|
24
26
|
- [.listAgents()](https://mastra.ai/reference/agents/listAgents)
|
|
25
27
|
- [.listScorers()](https://mastra.ai/reference/agents/listScorers)
|
|
28
|
+
- [.listSkills()](https://mastra.ai/reference/agents/listSkills)
|
|
26
29
|
- [.listTools()](https://mastra.ai/reference/agents/listTools)
|
|
27
30
|
- [.listWorkflows()](https://mastra.ai/reference/agents/listWorkflows)
|
|
28
31
|
- [.network()](https://mastra.ai/reference/agents/network)
|
|
@@ -30,6 +30,38 @@ The processor checks the error and its cause chain for:
|
|
|
30
30
|
|
|
31
31
|
When the error is retryable, the processor returns `{ retry: true }`. It doesn't mutate messages.
|
|
32
32
|
|
|
33
|
+
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).
|
|
34
|
+
|
|
35
|
+
## Delaying retries
|
|
36
|
+
|
|
37
|
+
Use `delayMs` with a custom matcher to retry transient network resets with a wait:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { Agent } from '@mastra/core/agent'
|
|
41
|
+
import { StreamErrorRetryProcessor } from '@mastra/core/processors'
|
|
42
|
+
|
|
43
|
+
const isECONNRESET = (error: unknown) => {
|
|
44
|
+
if (!error || typeof error !== 'object') return false
|
|
45
|
+
const code = (error as { code?: unknown }).code
|
|
46
|
+
if (typeof code === 'string' && code.toUpperCase() === 'ECONNRESET') return true
|
|
47
|
+
const message = error instanceof Error ? error.message : undefined
|
|
48
|
+
return typeof message === 'string' && /econnreset|socket hang up/i.test(message)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const agent = new Agent({
|
|
52
|
+
name: 'resilient-agent',
|
|
53
|
+
instructions: 'You are a helpful assistant.',
|
|
54
|
+
model: 'openai/gpt-5',
|
|
55
|
+
errorProcessors: [
|
|
56
|
+
new StreamErrorRetryProcessor({
|
|
57
|
+
maxRetries: 2,
|
|
58
|
+
delayMs: ({ retryCount }) => Math.min(1000 * 2 ** retryCount, 30000),
|
|
59
|
+
matchers: [isECONNRESET],
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
33
65
|
## Default OpenAI Responses matcher
|
|
34
66
|
|
|
35
67
|
`isRetryableOpenAIResponsesStreamError` matches OpenAI Responses stream error chunks with `type: 'error'` or `type: 'response.failed'`. It retries known transient OpenAI error codes and, as a fallback, errors with explicit retry guidance such as `You can retry your request`.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.2.1-alpha.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`3818814`](https://github.com/mastra-ai/mastra/commit/38188149ce454c4403fe9fcbdf73b735c68d36be)]:
|
|
8
|
+
- @mastra/core@1.46.0-alpha.5
|
|
9
|
+
|
|
10
|
+
## 1.2.1-alpha.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`5c4e9a4`](https://github.com/mastra-ai/mastra/commit/5c4e9a4cfb2216bb3ea7f8988ad3727f3b92bb3a), [`25961e3`](https://github.com/mastra-ai/mastra/commit/25961e3260ff3b1464637af8fcdb36210551c39f), [`7b29f33`](https://github.com/mastra-ai/mastra/commit/7b29f332a357a83e555f29e718e5f2fab9979943), [`24912b1`](https://github.com/mastra-ai/mastra/commit/24912b1f855d29ec36af4ef4bde1f7417e20cdf5), [`7686216`](https://github.com/mastra-ai/mastra/commit/7686216f37e74568feddec17cef3c3d24e10e60a), [`975c59a`](https://github.com/mastra-ai/mastra/commit/975c59ae363ee275fc55062392e1ffd2cbccbd53), [`d95f394`](https://github.com/mastra-ai/mastra/commit/d95f394fd24c8411886930d727679c4d5252aa26), [`f3f0c9d`](https://github.com/mastra-ai/mastra/commit/f3f0c9d7c878db5a13177871ce3523a14f14b311)]:
|
|
15
|
+
- @mastra/core@1.46.0-alpha.4
|
|
16
|
+
|
|
3
17
|
## 1.2.1-alpha.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.2.1-alpha.
|
|
3
|
+
"version": "1.2.1-alpha.6",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"local-pkg": "^1.1.2",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
31
|
"@mastra/mcp": "^1.12.0-alpha.0",
|
|
32
|
-
"@mastra/core": "1.46.0-alpha.
|
|
32
|
+
"@mastra/core": "1.46.0-alpha.5"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hono/node-server": "^1.19.11",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"vitest": "4.1.8",
|
|
48
48
|
"@internal/lint": "0.0.107",
|
|
49
49
|
"@internal/types-builder": "0.0.82",
|
|
50
|
-
"@mastra/core": "1.46.0-alpha.
|
|
50
|
+
"@mastra/core": "1.46.0-alpha.5"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://mastra.ai",
|
|
53
53
|
"repository": {
|