@mastra/mcp-docs-server 0.13.19-alpha.0 → 0.13.19-alpha.1
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/organized/changelogs/%40mastra%2Fclient-js.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +8 -0
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +8 -8
- package/.docs/organized/changelogs/create-mastra.md +7 -7
- package/.docs/organized/changelogs/mastra.md +14 -14
- package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -0
- package/.docs/raw/auth/jwt.mdx +2 -2
- package/.docs/raw/auth/supabase.mdx +128 -0
- package/.docs/raw/deployment/overview.mdx +7 -7
- package/.docs/raw/getting-started/mcp-docs-server.mdx +52 -48
- package/.docs/raw/memory/overview.mdx +2 -2
- package/.docs/raw/reference/auth/jwt.mdx +2 -3
- package/.docs/raw/reference/auth/supabase.mdx +62 -0
- package/.docs/raw/reference/{agents → core}/getAgent.mdx +1 -2
- package/.docs/raw/reference/core/getAgentById.mdx +43 -0
- package/.docs/raw/reference/core/getAgents.mdx +35 -0
- package/.docs/raw/reference/core/getDeployer.mdx +35 -0
- package/.docs/raw/reference/core/getLogger.mdx +35 -0
- package/.docs/raw/reference/core/getLogs.mdx +92 -0
- package/.docs/raw/reference/core/getLogsByRunId.mdx +84 -0
- package/.docs/raw/reference/core/getMCPServer.mdx +49 -0
- package/.docs/raw/reference/core/getMCPServers.mdx +35 -0
- package/.docs/raw/reference/core/getMemory.mdx +35 -0
- package/.docs/raw/reference/core/getServer.mdx +35 -0
- package/.docs/raw/reference/core/getStorage.mdx +35 -0
- package/.docs/raw/reference/core/getTelemetry.mdx +35 -0
- package/.docs/raw/reference/core/getVector.mdx +43 -0
- package/.docs/raw/reference/core/getVectors.mdx +35 -0
- package/.docs/raw/reference/core/getWorkflow.mdx +49 -0
- package/.docs/raw/reference/core/getWorkflows.mdx +44 -0
- package/.docs/raw/reference/core/mastra-class.mdx +14 -178
- package/.docs/raw/reference/core/setLogger.mdx +47 -0
- package/.docs/raw/reference/core/setStorage.mdx +39 -0
- package/.docs/raw/reference/core/setTelemetry.mdx +35 -0
- package/.docs/raw/workflows/control-flow.mdx +2 -2
- package/.docs/raw/workflows/overview.mdx +8 -8
- package/.docs/raw/workflows/suspend-and-resume.mdx +4 -4
- package/CHANGELOG.md +10 -0
- package/package.json +5 -5
- package/.docs/raw/reference/workflows/execute.mdx +0 -131
- /package/.docs/raw/reference/workflows/{branch.mdx → workflow-methods/branch.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{commit.mdx → workflow-methods/commit.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{create-run.mdx → workflow-methods/create-run.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{dountil.mdx → workflow-methods/dountil.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{dowhile.mdx → workflow-methods/dowhile.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{foreach.mdx → workflow-methods/foreach.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{map.mdx → workflow-methods/map.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{parallel.mdx → workflow-methods/parallel.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{sendEvent.mdx → workflow-methods/sendEvent.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{sleep.mdx → workflow-methods/sleep.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{sleepUntil.mdx → workflow-methods/sleepUntil.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{then.mdx → workflow-methods/then.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{waitForEvent.mdx → workflow-methods/waitForEvent.mdx} +0 -0
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "MCP Docs Server | Getting Started | Mastra Docs"
|
|
3
3
|
description: "Learn how to use the Mastra MCP documentation server in your IDE to turn it into an agentic Mastra expert."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
import YouTube from "@/components/youtube";
|
|
7
7
|
import { Tabs } from "nextra/components";
|
|
8
8
|
|
|
9
|
-
# Mastra
|
|
9
|
+
# Mastra Docs Server
|
|
10
10
|
|
|
11
|
-
`@mastra/mcp-docs-server` provides direct access to Mastra
|
|
12
|
-
|
|
13
|
-
It has access to documentation, code examples, technical blog posts / feature announcements, and package changelogs which your IDE can read to help you build with Mastra.
|
|
11
|
+
The `@mastra/mcp-docs-server` package provides direct access to Mastra’s full knowledge base, including documentation, code examples, blog posts, and changelogs, via the MCP protocol. It works with Cursor, Windsurf, Cline, Claude Code, or any tool that supports MCP.
|
|
14
12
|
|
|
15
13
|
<YouTube id="vciV57lF0og" />
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
These tools are designed to help agents retrieve precise, task-specific information—whether you're adding a feature to an agent, scaffolding a new project, or exploring how something works.
|
|
18
16
|
|
|
19
17
|
## How it works
|
|
20
18
|
|
|
21
|
-
Once
|
|
19
|
+
Once installed you can write prompts and assume the agent will understand everything about Mastra.
|
|
22
20
|
|
|
23
21
|
### Add features
|
|
24
22
|
|
|
@@ -41,18 +39,18 @@ Once it's installed in your IDE you can write prompts and assume the agent will
|
|
|
41
39
|
|
|
42
40
|
**And more** - if you have a question, try asking your IDE and let it look it up for you.
|
|
43
41
|
|
|
44
|
-
## Automatic
|
|
42
|
+
## Automatic installation
|
|
45
43
|
|
|
46
44
|
For **new** projects, the MCP Docs Server can be added during installation either through the [interactive](/docs/getting-started/installation#interactive) setup prompts, or by specifying the `-m` flag using the [non-interactive](/docs/getting-started/installation#non-interactive) command.
|
|
47
45
|
|
|
48
|
-
## Manual
|
|
46
|
+
## Manual installation
|
|
49
47
|
|
|
50
48
|
To add the MCP Docs Server to an existing project, install it manually.
|
|
51
49
|
|
|
52
50
|
- **Cursor**: Edit `.cursor/mcp.json` in your project root, or `~/.cursor/mcp.json` for global configuration
|
|
53
51
|
- **Windsurf**: Edit `~/.codeium/windsurf/mcp_config.json` (only supports global configuration)
|
|
54
|
-
- **VSCode**: Either move the created `.vscode` folder into the top-level of your workspace or open the created folder as your new workspace root. Edit `~/.vscode/mcp.json` in your project root.
|
|
55
|
-
|
|
52
|
+
- **VSCode**: Either move the created `.vscode` folder into the top-level of your workspace or open the created folder as your new workspace root. Edit `~/.vscode/mcp.json` in your project root. Add the following configuration:
|
|
53
|
+
- **Claude Code**: Run the `claude mcp add` command as shown below.
|
|
56
54
|
|
|
57
55
|
### MacOS/Linux
|
|
58
56
|
|
|
@@ -63,7 +61,7 @@ The tabs help users find the correct configuration format for their IDE (Cursor,
|
|
|
63
61
|
Each tab shows the exact JSON structure and file paths needed for that IDE's MCP configuration.
|
|
64
62
|
*/}
|
|
65
63
|
|
|
66
|
-
<Tabs items={["Cursor", "Windsurf", "VSCode"]}>
|
|
64
|
+
<Tabs items={["Cursor", "Windsurf", "VSCode", "Claude Code"]}>
|
|
67
65
|
<Tabs.Tab>
|
|
68
66
|
```json
|
|
69
67
|
{
|
|
@@ -99,6 +97,11 @@ Each tab shows the exact JSON structure and file paths needed for that IDE's MCP
|
|
|
99
97
|
}
|
|
100
98
|
}
|
|
101
99
|
}
|
|
100
|
+
```
|
|
101
|
+
</Tabs.Tab>
|
|
102
|
+
<Tabs.Tab>
|
|
103
|
+
```bash
|
|
104
|
+
claude mcp add mastra -- npx -y @mastra/mcp-docs-server
|
|
102
105
|
```
|
|
103
106
|
</Tabs.Tab>
|
|
104
107
|
</Tabs>
|
|
@@ -113,7 +116,7 @@ Each tab shows the Windows-specific command structure needed for that IDE's MCP
|
|
|
113
116
|
On latest Windsurf and Cursor the direct npx command works, while it's still unconfirmed if this has been fixed for VSCode.
|
|
114
117
|
*/}
|
|
115
118
|
|
|
116
|
-
<Tabs items={["Cursor", "Windsurf", "VSCode"]}>
|
|
119
|
+
<Tabs items={["Cursor", "Windsurf", "VSCode", "Claude Code"]}>
|
|
117
120
|
<Tabs.Tab>
|
|
118
121
|
```json
|
|
119
122
|
{
|
|
@@ -149,11 +152,16 @@ On latest Windsurf and Cursor the direct npx command works, while it's still unc
|
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
154
|
}
|
|
155
|
+
```
|
|
156
|
+
</Tabs.Tab>
|
|
157
|
+
<Tabs.Tab>
|
|
158
|
+
```bash
|
|
159
|
+
claude mcp add mastra -- npx -y @mastra/mcp-docs-server
|
|
152
160
|
```
|
|
153
161
|
</Tabs.Tab>
|
|
154
162
|
</Tabs>
|
|
155
163
|
|
|
156
|
-
## After
|
|
164
|
+
## After configuration
|
|
157
165
|
|
|
158
166
|
### Cursor
|
|
159
167
|
|
|
@@ -167,25 +175,23 @@ If you followed the automatic installation, you'll see a popup when you open cur
|
|
|
167
175
|
|
|
168
176
|
Otherwise, for manual installation, do the following.
|
|
169
177
|
|
|
170
|
-
1. Open Cursor settings
|
|
171
|
-
2. Navigate to MCP settings
|
|
172
|
-
3. Click "enable" on the Mastra MCP server
|
|
173
|
-
4. If you have an agent chat open, you'll need to re-open it or start a new chat to use the MCP server
|
|
178
|
+
1. Open Cursor settings.
|
|
179
|
+
2. Navigate to MCP settings.
|
|
180
|
+
3. Click "enable" on the Mastra MCP server.
|
|
181
|
+
4. If you have an agent chat open, you'll need to re-open it or start a new chat to use the MCP server.
|
|
174
182
|
|
|
175
183
|
### Windsurf
|
|
176
184
|
|
|
177
|
-
1. Fully quit and re-open Windsurf
|
|
185
|
+
1. Fully quit and re-open Windsurf.
|
|
178
186
|
2. If tool calls start failing, go to Windsurfs MCP settings and re-start the MCP server. This is a common Windsurf MCP issue and isn't related to Mastra. Right now Cursor's MCP implementation is more stable than Windsurfs is.
|
|
179
187
|
|
|
180
188
|
In both IDEs it may take a minute for the MCP server to start the first time as it needs to download the package from npm.
|
|
181
189
|
|
|
182
190
|
### VSCode
|
|
183
191
|
|
|
184
|
-
1. Open VSCode settings
|
|
185
|
-
2. Navigate to MCP settings
|
|
186
|
-
3. Click "enable" on the Chat > MCP option
|
|
187
|
-
|
|
188
|
-
<br />
|
|
192
|
+
1. Open VSCode settings.
|
|
193
|
+
2. Navigate to MCP settings.
|
|
194
|
+
3. Click "enable" on the Chat > MCP option.
|
|
189
195
|
|
|
190
196
|
<img
|
|
191
197
|
src="/image/vscode-mcp-setting.png"
|
|
@@ -196,7 +202,6 @@ In both IDEs it may take a minute for the MCP server to start the first time as
|
|
|
196
202
|
|
|
197
203
|
MCP only works in Agent mode in VSCode. Once you are in agent mode, open the `mcp.json` file and click the "start" button. Note that the "start" button will only appear if the `.vscode` folder containing `mcp.json` is in your workspace root, or the highest level of the in-editor file explorer.
|
|
198
204
|
|
|
199
|
-
<br />
|
|
200
205
|
<img
|
|
201
206
|
src="/image/vscode-start-mcp.png"
|
|
202
207
|
alt="Settings page of VSCode to enable MCP"
|
|
@@ -206,7 +211,6 @@ MCP only works in Agent mode in VSCode. Once you are in agent mode, open the `mc
|
|
|
206
211
|
|
|
207
212
|
After starting the mcp server, click the tools button in the copilot pane to see available tools.
|
|
208
213
|
|
|
209
|
-
<br />
|
|
210
214
|
<img
|
|
211
215
|
src="/image/vscode-mcp-running.png"
|
|
212
216
|
alt="Tools page of VSCode to see available tools"
|
|
@@ -214,49 +218,49 @@ After starting the mcp server, click the tools button in the copilot pane to see
|
|
|
214
218
|
className="rounded-lg"
|
|
215
219
|
/>
|
|
216
220
|
|
|
217
|
-
## Available
|
|
221
|
+
## Available agent tools
|
|
218
222
|
|
|
219
223
|
### Documentation
|
|
220
224
|
|
|
221
225
|
Access Mastra's complete documentation:
|
|
222
226
|
|
|
223
|
-
- Getting started / installation
|
|
224
|
-
- Guides and tutorials
|
|
225
|
-
- API references
|
|
227
|
+
- Getting started / installation.
|
|
228
|
+
- Guides and tutorials.
|
|
229
|
+
- API references.
|
|
226
230
|
|
|
227
231
|
### Examples
|
|
228
232
|
|
|
229
233
|
Browse code examples:
|
|
230
234
|
|
|
231
|
-
- Complete project structures
|
|
232
|
-
- Implementation patterns
|
|
233
|
-
- Best practices
|
|
235
|
+
- Complete project structures.
|
|
236
|
+
- Implementation patterns.
|
|
237
|
+
- Best practices.
|
|
234
238
|
|
|
235
|
-
### Blog
|
|
239
|
+
### Blog posts
|
|
236
240
|
|
|
237
241
|
Search the blog for:
|
|
238
242
|
|
|
239
|
-
- Technical posts
|
|
240
|
-
- Changelog and feature announcements
|
|
241
|
-
- AI news and updates
|
|
243
|
+
- Technical posts.
|
|
244
|
+
- Changelog and feature announcements.
|
|
245
|
+
- AI news and updates.
|
|
242
246
|
|
|
243
|
-
### Package
|
|
247
|
+
### Package changes
|
|
244
248
|
|
|
245
249
|
Track updates for Mastra and `@mastra/*` packages:
|
|
246
250
|
|
|
247
|
-
- Bug fixes
|
|
248
|
-
- New features
|
|
249
|
-
- Breaking changes
|
|
251
|
+
- Bug fixes.
|
|
252
|
+
- New features.
|
|
253
|
+
- Breaking changes.
|
|
250
254
|
|
|
251
|
-
## Common
|
|
255
|
+
## Common issues
|
|
252
256
|
|
|
253
257
|
1. **Server Not Starting**
|
|
254
258
|
|
|
255
|
-
- Ensure [npx](https://docs.npmjs.com/cli/v11/commands/npx) is installed and working
|
|
256
|
-
- Check for conflicting MCP servers
|
|
257
|
-
- Verify your configuration file syntax
|
|
258
|
-
- On Windows, make sure to use the Windows-specific configuration
|
|
259
|
+
- Ensure [npx](https://docs.npmjs.com/cli/v11/commands/npx) is installed and working.
|
|
260
|
+
- Check for conflicting MCP servers.
|
|
261
|
+
- Verify your configuration file syntax.
|
|
262
|
+
- On Windows, make sure to use the Windows-specific configuration.
|
|
259
263
|
|
|
260
264
|
2. **Tool Calls Failing**
|
|
261
|
-
- Restart the MCP server and/or your IDE
|
|
262
|
-
- Update to the latest version of your IDE
|
|
265
|
+
- Restart the MCP server and/or your IDE.
|
|
266
|
+
- Update to the latest version of your IDE.
|
|
@@ -133,7 +133,7 @@ const memory = new Memory({
|
|
|
133
133
|
});
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
**Important:** Only send the newest user message in each agent call. Mastra handles retrieving and injecting the necessary history. Sending the full history yourself will cause duplication. See the [AI SDK Memory Example](../../
|
|
136
|
+
**Important:** Only send the newest user message in each agent call. Mastra handles retrieving and injecting the necessary history. Sending the full history yourself will cause duplication. See the [AI SDK Memory Example](../../docs/frameworks/agentic-uis/ai-sdk.mdx) for how to handle this with when using the `useChat` frontend hooks.
|
|
137
137
|
|
|
138
138
|
### Storage Configuration
|
|
139
139
|
|
|
@@ -176,4 +176,4 @@ For more details on enabling and configuring tracing, see [Tracing](../observabi
|
|
|
176
176
|
|
|
177
177
|
Now that you understand the core concepts, continue to [semantic recall](./semantic-recall.mdx) to learn how to add RAG memory to your Mastra agents.
|
|
178
178
|
|
|
179
|
-
Alternatively you can visit the [configuration reference](../../reference/memory/Memory.mdx) for available options
|
|
179
|
+
Alternatively you can visit the [configuration reference](../../reference/memory/Memory.mdx) for available options.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "MastraJwtAuth"
|
|
2
|
+
title: "MastraJwtAuth Class"
|
|
3
3
|
description: "API reference for the MastraJwtAuth class, which authenticates Mastra applications using JSON Web Tokens."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# MastraJwtAuth
|
|
6
|
+
# MastraJwtAuth Class
|
|
7
7
|
|
|
8
8
|
The `MastraJwtAuth` class provides a lightweight authentication mechanism for Mastra using JSON Web Tokens (JWTs). It verifies incoming requests based on a shared secret and integrates with the Mastra server using the `experimental_auth` option.
|
|
9
9
|
|
|
@@ -36,7 +36,6 @@ export const mastra = new Mastra({
|
|
|
36
36
|
]}
|
|
37
37
|
/>
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
## Related
|
|
41
40
|
|
|
42
41
|
[MastraJwtAuth](/docs/auth/jwt.mdx)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MastraAuthSupabase Class"
|
|
3
|
+
description: "API reference for the MastraAuthSupabase class, which authenticates Mastra applications using Supabase Auth."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MastraAuthSupabase Class
|
|
7
|
+
|
|
8
|
+
The `MastraAuthSupabase` class provides authentication for Mastra using Supabase Auth. It verifies incoming requests using Supabase's authentication system and integrates with the Mastra server using the `experimental_auth` option.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
13
|
+
import { Mastra } from "@mastra/core/mastra";
|
|
14
|
+
import { MastraAuthSupabase } from '@mastra/auth-supabase';
|
|
15
|
+
|
|
16
|
+
export const mastra = new Mastra({
|
|
17
|
+
// ..
|
|
18
|
+
server: {
|
|
19
|
+
experimental_auth: new MastraAuthSupabase({
|
|
20
|
+
url: process.env.SUPABASE_URL,
|
|
21
|
+
anonKey: process.env.SUPABASE_ANON_KEY
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Constructor parameters
|
|
28
|
+
|
|
29
|
+
<PropertiesTable
|
|
30
|
+
content={[
|
|
31
|
+
{
|
|
32
|
+
name: "url",
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "The URL of your Supabase project. Can be found in your Supabase project settings.",
|
|
35
|
+
isOptional: true,
|
|
36
|
+
defaultValue: "process.env.SUPABASE_URL"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "anonKey",
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "The anonymous/public key for your Supabase project. Used for client-side authentication.",
|
|
42
|
+
isOptional: true,
|
|
43
|
+
defaultValue: "process.env.SUPABASE_ANON_KEY"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "name",
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Custom name for the auth provider instance.",
|
|
49
|
+
isOptional: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "authorizeUser",
|
|
53
|
+
type: "(user: User, request: HoneRequest) => Promise<boolean> | boolean",
|
|
54
|
+
description: "Custom authorization function to determine if a user should be granted access. Called after token verification. By default, checks the 'isAdmin' column in the 'users' table.",
|
|
55
|
+
isOptional: true,
|
|
56
|
+
},
|
|
57
|
+
]}
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
## Related
|
|
61
|
+
|
|
62
|
+
[MastraAuthSupabase](/docs/auth/supabase.mdx)
|
|
@@ -3,7 +3,7 @@ title: "Reference: Agent.getAgent() | Agents | Mastra Docs"
|
|
|
3
3
|
description: "Documentation for the `Agent.getAgent()` method in Mastra, which retrieves an agent by name."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Mastra.getAgent()
|
|
7
7
|
|
|
8
8
|
The `.getAgent()` method is used to retrieve an agent. The method accepts a single `string` parameter for the agent's name.
|
|
9
9
|
|
|
@@ -13,7 +13,6 @@ The `.getAgent()` method is used to retrieve an agent. The method accepts a sing
|
|
|
13
13
|
mastra.getAgent("testAgent");
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
## Parameters
|
|
18
17
|
|
|
19
18
|
<PropertiesTable
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getAgentById() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getAgentById()` method in Mastra, which retrieves an agent by its ID."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getAgentById()
|
|
7
|
+
|
|
8
|
+
The `.getAgentById()` method is used to retrieve an agent by its ID. The method accepts a single `string` parameter for the agent's ID.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getAgentById("test-agent-123");
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "id",
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "The ID of the agent to retrieve. The method will first search for an agent with this ID, and if not found, will attempt to use it as a name to call getAgent().",
|
|
24
|
+
},
|
|
25
|
+
]}
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
<PropertiesTable
|
|
31
|
+
content={[
|
|
32
|
+
{
|
|
33
|
+
name: "agent",
|
|
34
|
+
type: "Agent",
|
|
35
|
+
description: "The agent instance with the specified ID. Throws an error if the agent is not found.",
|
|
36
|
+
},
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
## Related
|
|
41
|
+
|
|
42
|
+
- [Agents overview](../../docs/agents/overview.mdx)
|
|
43
|
+
- [Dynamic agents](../../docs/agents/dynamic-agents.mdx)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getAgents() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getAgents()` method in Mastra, which retrieves all configured agents."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getAgents()
|
|
7
|
+
|
|
8
|
+
The `.getAgents()` method is used to retrieve all agents that have been configured in the Mastra instance.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getAgents();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
This method does not accept any parameters.
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
<PropertiesTable
|
|
23
|
+
content={[
|
|
24
|
+
{
|
|
25
|
+
name: "agents",
|
|
26
|
+
type: "TAgents",
|
|
27
|
+
description: "A record of all configured agents, where keys are agent names and values are agent instances.",
|
|
28
|
+
},
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Agents overview](../../docs/agents/overview.mdx)
|
|
35
|
+
- [Dynamic agents](../../docs/agents/dynamic-agents.mdx)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getDeployer() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getDeployer()` method in Mastra, which retrieves the configured deployer instance."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getDeployer()
|
|
7
|
+
|
|
8
|
+
The `.getDeployer()` method is used to retrieve the deployer instance that has been configured in the Mastra instance.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getDeployer();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
This method does not accept any parameters.
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
<PropertiesTable
|
|
23
|
+
content={[
|
|
24
|
+
{
|
|
25
|
+
name: "deployer",
|
|
26
|
+
type: "MastraDeployer | undefined",
|
|
27
|
+
description: "The configured deployer instance, or undefined if no deployer has been configured.",
|
|
28
|
+
},
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Deployment overview](../../docs/deployment/overview.mdx)
|
|
35
|
+
- [Deployer reference](../../reference/deployer/deployer.mdx)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getLogger() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getLogger()` method in Mastra, which retrieves the configured logger instance."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getLogger()
|
|
7
|
+
|
|
8
|
+
The `.getLogger()` method is used to retrieve the logger instance that has been configured in the Mastra instance.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getLogger();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
This method does not accept any parameters.
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
<PropertiesTable
|
|
23
|
+
content={[
|
|
24
|
+
{
|
|
25
|
+
name: "logger",
|
|
26
|
+
type: "TLogger",
|
|
27
|
+
description: "The configured logger instance used for logging across all components (agents, workflows, etc.).",
|
|
28
|
+
},
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Logging overview](../../docs/observability/logging.mdx)
|
|
35
|
+
- [Logger reference](../../reference/observability/logger.mdx)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getLogs() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getLogs()` method in Mastra, which retrieves all logs for a specific transport ID."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getLogs()
|
|
7
|
+
|
|
8
|
+
The `.getLogs()` method is used to retrieve all logs for a specific transport ID. This method requires a configured logger that supports the `getLogs` operation.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getLogs("456");
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "transportId",
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "The transport ID to retrieve logs from.",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "options",
|
|
27
|
+
type: "object",
|
|
28
|
+
description: "Optional parameters for filtering and pagination. See Options section below for details.",
|
|
29
|
+
optional: true,
|
|
30
|
+
},
|
|
31
|
+
]}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
### Options
|
|
35
|
+
|
|
36
|
+
<PropertiesTable
|
|
37
|
+
content={[
|
|
38
|
+
{
|
|
39
|
+
name: "fromDate",
|
|
40
|
+
type: "Date",
|
|
41
|
+
description: "Optional start date for filtering logs. e.g., new Date('2024-01-01').",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "toDate",
|
|
46
|
+
type: "Date",
|
|
47
|
+
description: "Optional end date for filtering logs. e.g., new Date('2024-01-31').",
|
|
48
|
+
optional: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "logLevel",
|
|
52
|
+
type: "LogLevel",
|
|
53
|
+
description: "Optional log level to filter by.",
|
|
54
|
+
optional: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "filters",
|
|
58
|
+
type: "Record<string, any>",
|
|
59
|
+
description: "Optional additional filters to apply to the log query.",
|
|
60
|
+
optional: true,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "page",
|
|
64
|
+
type: "number",
|
|
65
|
+
description: "Optional page number for pagination.",
|
|
66
|
+
optional: true,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "perPage",
|
|
70
|
+
type: "number",
|
|
71
|
+
description: "Optional number of logs per page for pagination.",
|
|
72
|
+
optional: true,
|
|
73
|
+
},
|
|
74
|
+
]}
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
## Returns
|
|
78
|
+
|
|
79
|
+
<PropertiesTable
|
|
80
|
+
content={[
|
|
81
|
+
{
|
|
82
|
+
name: "logs",
|
|
83
|
+
type: "Promise<any>",
|
|
84
|
+
description: "A promise that resolves to the logs for the specified transport ID.",
|
|
85
|
+
},
|
|
86
|
+
]}
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
## Related
|
|
90
|
+
|
|
91
|
+
- [Logging overview](../../docs/observability/logging.mdx)
|
|
92
|
+
- [Logger reference](../../reference/observability/logger.mdx)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getLogsByRunId() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getLogsByRunId()` method in Mastra, which retrieves logs for a specific run ID and transport ID."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getLogsByRunId()
|
|
7
|
+
|
|
8
|
+
The `.getLogsByRunId()` method is used to retrieve logs for a specific run ID and transport ID. This method requires a configured logger that supports the `getLogsByRunId` operation.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getLogsByRunId({ runId: "123", transportId: "456" });
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "runId",
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "The run ID to retrieve logs for.",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "transportId",
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "The transport ID to retrieve logs from.",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "fromDate",
|
|
32
|
+
type: "Date",
|
|
33
|
+
description: "Optional start date for filtering logs. e.g., new Date('2024-01-01').",
|
|
34
|
+
optional: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "toDate",
|
|
38
|
+
type: "Date",
|
|
39
|
+
description: "Optional end date for filtering logs. e.g., new Date('2024-01-31').",
|
|
40
|
+
optional: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "logLevel",
|
|
44
|
+
type: "LogLevel",
|
|
45
|
+
description: "Optional log level to filter by.",
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "filters",
|
|
50
|
+
type: "Record<string, any>",
|
|
51
|
+
description: "Optional additional filters to apply to the log query.",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "page",
|
|
56
|
+
type: "number",
|
|
57
|
+
description: "Optional page number for pagination.",
|
|
58
|
+
optional: true,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "perPage",
|
|
62
|
+
type: "number",
|
|
63
|
+
description: "Optional number of logs per page for pagination.",
|
|
64
|
+
optional: true,
|
|
65
|
+
},
|
|
66
|
+
]}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
## Returns
|
|
70
|
+
|
|
71
|
+
<PropertiesTable
|
|
72
|
+
content={[
|
|
73
|
+
{
|
|
74
|
+
name: "logs",
|
|
75
|
+
type: "Promise<any>",
|
|
76
|
+
description: "A promise that resolves to the logs for the specified run ID and transport ID.",
|
|
77
|
+
},
|
|
78
|
+
]}
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
## Related
|
|
82
|
+
|
|
83
|
+
- [Logging overview](../../docs/observability/logging.mdx)
|
|
84
|
+
- [Logger reference](../../reference/observability/logger.mdx)
|