@mastra/mcp-docs-server 0.13.19-alpha.0 → 0.13.19-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +9 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +21 -21
  3. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +10 -10
  4. package/.docs/organized/changelogs/%40mastra%2Fcore.md +31 -31
  5. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +16 -0
  6. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +19 -19
  7. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +11 -11
  8. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +18 -18
  9. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +10 -10
  10. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
  11. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +13 -13
  12. package/.docs/organized/changelogs/%40mastra%2Fserver.md +19 -19
  13. package/.docs/organized/changelogs/create-mastra.md +7 -7
  14. package/.docs/organized/changelogs/mastra.md +14 -14
  15. package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
  16. package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -0
  17. package/.docs/raw/agents/dynamic-agents.mdx +5 -5
  18. package/.docs/raw/agents/runtime-context.mdx +103 -0
  19. package/.docs/raw/auth/jwt.mdx +2 -2
  20. package/.docs/raw/auth/supabase.mdx +128 -0
  21. package/.docs/raw/deployment/overview.mdx +7 -7
  22. package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +1 -1
  23. package/.docs/raw/getting-started/mcp-docs-server.mdx +52 -48
  24. package/.docs/raw/memory/overview.mdx +2 -2
  25. package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +1 -1
  26. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +1 -1
  27. package/.docs/raw/reference/agents/getDefaultVNextStreamOptions.mdx +1 -1
  28. package/.docs/raw/reference/agents/getInstructions.mdx +1 -1
  29. package/.docs/raw/reference/agents/getLLM.mdx +1 -1
  30. package/.docs/raw/reference/agents/getMemory.mdx +1 -1
  31. package/.docs/raw/reference/agents/getModel.mdx +1 -1
  32. package/.docs/raw/reference/agents/getScorers.mdx +1 -1
  33. package/.docs/raw/reference/agents/streamVNext.mdx +120 -29
  34. package/.docs/raw/reference/auth/jwt.mdx +2 -3
  35. package/.docs/raw/reference/auth/supabase.mdx +62 -0
  36. package/.docs/raw/reference/{agents → core}/getAgent.mdx +1 -2
  37. package/.docs/raw/reference/core/getAgentById.mdx +43 -0
  38. package/.docs/raw/reference/core/getAgents.mdx +35 -0
  39. package/.docs/raw/reference/core/getDeployer.mdx +35 -0
  40. package/.docs/raw/reference/core/getLogger.mdx +35 -0
  41. package/.docs/raw/reference/core/getLogs.mdx +92 -0
  42. package/.docs/raw/reference/core/getLogsByRunId.mdx +84 -0
  43. package/.docs/raw/reference/core/getMCPServer.mdx +49 -0
  44. package/.docs/raw/reference/core/getMCPServers.mdx +35 -0
  45. package/.docs/raw/reference/core/getMemory.mdx +35 -0
  46. package/.docs/raw/reference/core/getServer.mdx +35 -0
  47. package/.docs/raw/reference/core/getStorage.mdx +35 -0
  48. package/.docs/raw/reference/core/getTelemetry.mdx +35 -0
  49. package/.docs/raw/reference/core/getVector.mdx +43 -0
  50. package/.docs/raw/reference/core/getVectors.mdx +35 -0
  51. package/.docs/raw/reference/core/getWorkflow.mdx +49 -0
  52. package/.docs/raw/reference/core/getWorkflows.mdx +44 -0
  53. package/.docs/raw/reference/core/mastra-class.mdx +14 -178
  54. package/.docs/raw/reference/core/setLogger.mdx +47 -0
  55. package/.docs/raw/reference/core/setStorage.mdx +39 -0
  56. package/.docs/raw/reference/core/setTelemetry.mdx +35 -0
  57. package/.docs/raw/reference/tools/create-tool.mdx +1 -1
  58. package/.docs/raw/reference/tools/graph-rag-tool.mdx +2 -2
  59. package/.docs/raw/reference/tools/vector-query-tool.mdx +2 -2
  60. package/.docs/raw/tools-mcp/runtime-context.mdx +63 -0
  61. package/.docs/raw/workflows/control-flow.mdx +2 -2
  62. package/.docs/raw/workflows/overview.mdx +8 -8
  63. package/.docs/raw/workflows/suspend-and-resume.mdx +4 -4
  64. package/CHANGELOG.md +17 -0
  65. package/package.json +5 -5
  66. package/.docs/raw/agents/runtime-variables.mdx +0 -116
  67. package/.docs/raw/reference/workflows/execute.mdx +0 -131
  68. package/.docs/raw/tools-mcp/dynamic-context.mdx +0 -131
  69. /package/.docs/raw/reference/workflows/{branch.mdx → workflow-methods/branch.mdx} +0 -0
  70. /package/.docs/raw/reference/workflows/{commit.mdx → workflow-methods/commit.mdx} +0 -0
  71. /package/.docs/raw/reference/workflows/{create-run.mdx → workflow-methods/create-run.mdx} +0 -0
  72. /package/.docs/raw/reference/workflows/{dountil.mdx → workflow-methods/dountil.mdx} +0 -0
  73. /package/.docs/raw/reference/workflows/{dowhile.mdx → workflow-methods/dowhile.mdx} +0 -0
  74. /package/.docs/raw/reference/workflows/{foreach.mdx → workflow-methods/foreach.mdx} +0 -0
  75. /package/.docs/raw/reference/workflows/{map.mdx → workflow-methods/map.mdx} +0 -0
  76. /package/.docs/raw/reference/workflows/{parallel.mdx → workflow-methods/parallel.mdx} +0 -0
  77. /package/.docs/raw/reference/workflows/{sendEvent.mdx → workflow-methods/sendEvent.mdx} +0 -0
  78. /package/.docs/raw/reference/workflows/{sleep.mdx → workflow-methods/sleep.mdx} +0 -0
  79. /package/.docs/raw/reference/workflows/{sleepUntil.mdx → workflow-methods/sleepUntil.mdx} +0 -0
  80. /package/.docs/raw/reference/workflows/{then.mdx → workflow-methods/then.mdx} +0 -0
  81. /package/.docs/raw/reference/workflows/{waitForEvent.mdx → workflow-methods/waitForEvent.mdx} +0 -0
@@ -41,7 +41,7 @@ const aiSdkStream = await agent.streamVNext("message for agent", {
41
41
  ]}
42
42
  />
43
43
 
44
- ### Options parameters
44
+ ### Options
45
45
 
46
46
  <PropertiesTable
47
47
  content={[
@@ -52,16 +52,99 @@ const aiSdkStream = await agent.streamVNext("message for agent", {
52
52
  defaultValue: "'mastra'",
53
53
  description: "Determines the output stream format. Use 'mastra' for Mastra's native format (default) or 'aisdk' for AI SDK v5 compatibility.",
54
54
  },
55
+ {
56
+ name: "maxSteps",
57
+ type: "number",
58
+ isOptional: true,
59
+ description: "Maximum number of steps to run during execution.",
60
+ },
61
+ {
62
+ name: "scorers",
63
+ type: "MastraScorers | Record<string, { scorer: MastraScorer['name']; sampling?: ScoringSamplingConfig }>",
64
+ isOptional: true,
65
+ description: "Evaluation scorers to run on the execution results.",
66
+ properties: [
67
+ {
68
+ parameters: [{
69
+ name: "scorer",
70
+ type: "string",
71
+ isOptional: false,
72
+ description: "Name of the scorer to use."
73
+ }]
74
+ },
75
+ {
76
+ parameters: [{
77
+ name: "sampling",
78
+ type: "ScoringSamplingConfig",
79
+ isOptional: true,
80
+ description: "Sampling configuration for the scorer.",
81
+ properties: [
82
+ {
83
+ parameters: [{
84
+ name: "type",
85
+ type: "'none' | 'ratio'",
86
+ isOptional: false,
87
+ description: "Type of sampling strategy. Use 'none' to disable sampling or 'ratio' for percentage-based sampling."
88
+ }]
89
+ },
90
+ {
91
+ parameters: [{
92
+ name: "rate",
93
+ type: "number",
94
+ isOptional: true,
95
+ description: "Sampling rate (0-1). Required when type is 'ratio'."
96
+ }]
97
+ }
98
+ ]
99
+ }]
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ name: "tracingContext",
105
+ type: "TracingContext",
106
+ isOptional: true,
107
+ description: "AI tracing context for span hierarchy and metadata.",
108
+ },
109
+ {
110
+ name: "returnScorerData",
111
+ type: "boolean",
112
+ isOptional: true,
113
+ description: "Whether to return detailed scoring data in the response.",
114
+ },
115
+ {
116
+ name: "onChunk",
117
+ type: "(chunk: ChunkType) => Promise<void> | void",
118
+ isOptional: true,
119
+ description: "Callback function called for each chunk during streaming."
120
+ },
121
+ {
122
+ name: "onError",
123
+ type: "({ error }: { error: Error | string }) => Promise<void> | void",
124
+ isOptional: true,
125
+ description: "Callback function called when an error occurs during streaming."
126
+ },
127
+ {
128
+ name: "onAbort",
129
+ type: "(event: any) => Promise<void> | void",
130
+ isOptional: true,
131
+ description: "Callback function called when the stream is aborted."
132
+ },
55
133
  {
56
134
  name: "abortSignal",
57
135
  type: "AbortSignal",
58
136
  isOptional: true,
59
- description:
60
- "Signal object that allows you to abort the agent's execution. When the signal is aborted, all ongoing operations will be terminated.",
137
+ description: "Signal object that allows you to abort the agent's execution. When the signal is aborted, all ongoing operations will be terminated."
138
+ },
139
+ {
140
+ name: "activeTools",
141
+ type: "Array<keyof ToolSet> | undefined",
142
+ isOptional: true,
143
+ description: "Array of active tool names that can be used during execution."
61
144
  },
62
145
  {
63
146
  name: "context",
64
- type: "CoreMessage[]",
147
+ type: "ModelMessage[]",
65
148
  isOptional: true,
66
149
  description: "Additional context messages to provide to the agent.",
67
150
  },
@@ -83,8 +166,8 @@ const aiSdkStream = await agent.streamVNext("message for agent", {
83
166
  parameters: [{
84
167
  name: "model",
85
168
  type: "MastraLanguageModel",
86
- isOptional: false,
87
- description: "Model to use for the internal structuring agent."
169
+ isOptional: true,
170
+ description: "Model to use for the internal structuring agent. If not provided, falls back to the agent's model."
88
171
  }]
89
172
  },
90
173
  {
@@ -178,13 +261,6 @@ const aiSdkStream = await agent.streamVNext("message for agent", {
178
261
  }
179
262
  ]
180
263
  },
181
- {
182
- name: "maxRetries",
183
- type: "number",
184
- isOptional: true,
185
- defaultValue: "2",
186
- description: "Maximum number of retries. Set to 0 to disable retries.",
187
- },
188
264
  {
189
265
  name: "memoryOptions",
190
266
  type: "MemoryConfig",
@@ -271,10 +347,10 @@ const aiSdkStream = await agent.streamVNext("message for agent", {
271
347
  },
272
348
  {
273
349
  parameters: [{
274
- name: "maxTokens",
350
+ name: "maxRetries",
275
351
  type: "number",
276
352
  isOptional: true,
277
- description: "Maximum number of tokens to generate."
353
+ description: "Maximum number of retries for failed requests."
278
354
  }]
279
355
  },
280
356
  {
@@ -317,14 +393,6 @@ const aiSdkStream = await agent.streamVNext("message for agent", {
317
393
  description: "Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated."
318
394
  }]
319
395
  },
320
- {
321
- parameters: [{
322
- name: "seed",
323
- type: "number",
324
- isOptional: true,
325
- description: "The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results."
326
- }]
327
- }
328
396
  ]
329
397
  },
330
398
  {
@@ -443,12 +511,6 @@ const aiSdkStream = await agent.streamVNext("message for agent", {
443
511
  isOptional: true,
444
512
  description: "Runtime context for dependency injection and contextual information.",
445
513
  },
446
- {
447
- name: "experimental_generateMessageId",
448
- type: "IDGenerator",
449
- isOptional: true,
450
- description: "Generate a unique ID for each message.",
451
- },
452
514
  {
453
515
  name: "stopWhen",
454
516
  type: "StopCondition | StopCondition[]",
@@ -523,6 +585,35 @@ for await (const part of stream.fullStream) {
523
585
  return stream.toUIMessageStreamResponse();
524
586
  ```
525
587
 
588
+ ### Using Callbacks
589
+
590
+ All callback functions are now available as top-level properties for a cleaner API experience.
591
+
592
+ ```typescript showLineNumbers copy
593
+ const stream = await agent.streamVNext("Tell me a story", {
594
+ onFinish: (result) => {
595
+ console.log('Streaming finished:', result);
596
+ },
597
+ onStepFinish: (step) => {
598
+ console.log('Step completed:', step);
599
+ },
600
+ onChunk: (chunk) => {
601
+ console.log('Received chunk:', chunk);
602
+ },
603
+ onError: ({ error }) => {
604
+ console.error('Streaming error:', error);
605
+ },
606
+ onAbort: (event) => {
607
+ console.log('Stream aborted:', event);
608
+ },
609
+ });
610
+
611
+ // Process the stream
612
+ for await (const chunk of stream.textStream) {
613
+ console.log(chunk);
614
+ }
615
+ ```
616
+
526
617
  ### Advanced Example with Options
527
618
 
528
619
  ```typescript showLineNumbers copy
@@ -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
- # Agent.getAgent()
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)
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: "Reference: Mastra.getMCPServer() | Core | Mastra Docs"
3
+ description: "Documentation for the `Mastra.getMCPServer()` method in Mastra, which retrieves a specific MCP server instance by ID and optional version."
4
+ ---
5
+
6
+ # Mastra.getMCPServer()
7
+
8
+ The `.getMCPServer()` method is used to retrieve a specific MCP server instance by its logical ID and optional version. If a version is provided, it attempts to find the server with that exact logical ID and version. If no version is provided, it returns the server with the specified logical ID that has the most recent releaseDate.
9
+
10
+ ## Usage example
11
+
12
+ ```typescript copy
13
+ mastra.getMCPServer("1.2.0");
14
+ ```
15
+
16
+ ## Parameters
17
+
18
+ <PropertiesTable
19
+ content={[
20
+ {
21
+ name: "serverId",
22
+ type: "string",
23
+ description: "The logical ID of the MCP server to retrieve. Should match the `id` property of the MCPServer instance.",
24
+ },
25
+ {
26
+ name: "version",
27
+ type: "string",
28
+ description: "Optional specific version of the MCP server to retrieve. If not provided, returns the server with the most recent releaseDate.",
29
+ optional: true,
30
+ },
31
+ ]}
32
+ />
33
+
34
+ ## Returns
35
+
36
+ <PropertiesTable
37
+ content={[
38
+ {
39
+ name: "server",
40
+ type: "MCPServerBase | undefined",
41
+ description: "The MCP server instance with the specified ID and version, or undefined if not found or if the specific version is not found.",
42
+ },
43
+ ]}
44
+ />
45
+
46
+ ## Related
47
+
48
+ - [MCP overview](../../docs/tools-mcp/mcp-overview.mdx)
49
+ - [MCP server reference](../../reference/tools/mcp-server.mdx)