@mastra/mcp-docs-server 0.13.38 → 0.13.39
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/%40internal%2Fchangeset-cli.md +2 -0
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +2 -0
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +9 -9
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +2 -0
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fauth.md +12 -0
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +69 -69
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +12 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +43 -43
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Frag.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Freact.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +18 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +12 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +19 -9
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +19 -19
- package/.docs/organized/changelogs/create-mastra.md +13 -13
- package/.docs/organized/changelogs/mastra.md +35 -35
- package/.docs/raw/agents/overview.mdx +2 -2
- package/.docs/raw/auth/jwt.mdx +2 -2
- package/.docs/raw/auth/supabase.mdx +2 -2
- package/.docs/raw/auth/workos.mdx +2 -2
- package/.docs/raw/course/02-agent-tools-mcp/04-initializing-mcp-tools.md +2 -2
- package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +1 -1
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +24 -8
- package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +1 -1
- package/.docs/raw/frameworks/servers/express.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +34 -18
- package/.docs/raw/getting-started/installation.mdx +7 -7
- package/.docs/raw/getting-started/mcp-docs-server.mdx +1 -1
- package/.docs/raw/getting-started/studio.mdx +27 -17
- package/.docs/raw/getting-started/templates.mdx +12 -4
- package/.docs/raw/index.mdx +1 -1
- package/.docs/raw/mastra-cloud/dashboard.mdx +6 -6
- package/.docs/raw/mastra-cloud/observability.mdx +2 -2
- package/.docs/raw/mastra-cloud/overview.mdx +1 -1
- package/.docs/raw/mastra-cloud/setting-up.mdx +1 -1
- package/.docs/raw/memory/overview.mdx +1 -1
- package/.docs/raw/memory/semantic-recall.mdx +2 -4
- package/.docs/raw/memory/threads-and-resources.mdx +1 -1
- package/.docs/raw/memory/working-memory.mdx +1 -1
- package/.docs/raw/observability/ai-tracing/exporters/default.mdx +6 -6
- package/.docs/raw/observability/ai-tracing/overview.mdx +7 -7
- package/.docs/raw/observability/overview.mdx +1 -1
- package/.docs/raw/reference/agents/agent.mdx +2 -2
- package/.docs/raw/reference/agents/listScorers.mdx +69 -0
- package/.docs/raw/reference/agents/listTools.mdx +69 -0
- package/.docs/raw/reference/agents/listWorkflows.mdx +69 -0
- package/.docs/raw/reference/cli/mastra.mdx +1 -1
- package/.docs/raw/reference/client-js/agents.mdx +1 -1
- package/.docs/raw/reference/client-js/logs.mdx +1 -1
- package/.docs/raw/reference/client-js/mastra-client.mdx +7 -7
- package/.docs/raw/reference/client-js/memory.mdx +1 -1
- package/.docs/raw/reference/client-js/tools.mdx +1 -1
- package/.docs/raw/reference/client-js/workflows.mdx +1 -1
- package/.docs/raw/reference/core/getScorerByName.mdx +1 -1
- package/.docs/raw/reference/core/listAgents.mdx +35 -0
- package/.docs/raw/reference/core/listLogs.mdx +96 -0
- package/.docs/raw/reference/core/listLogsByRunId.mdx +87 -0
- package/.docs/raw/reference/core/listScorers.mdx +43 -0
- package/.docs/raw/reference/core/listWorkflows.mdx +45 -0
- package/.docs/raw/reference/memory/memory-class.mdx +2 -1
- package/.docs/raw/reference/observability/ai-tracing/ai-tracing.mdx +0 -1
- package/.docs/raw/reference/observability/ai-tracing/interfaces.mdx +1 -1
- package/.docs/raw/reference/observability/otel-tracing/providers/keywordsai.mdx +1 -1
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +10 -14
- package/.docs/raw/reference/processors/language-detector.mdx +20 -32
- package/.docs/raw/reference/processors/moderation-processor.mdx +46 -30
- package/.docs/raw/reference/processors/pii-detector.mdx +47 -32
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +20 -30
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +24 -29
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +14 -23
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +12 -14
- package/.docs/raw/reference/rag/document.mdx +1 -1
- package/.docs/raw/reference/scorers/run-experiment.mdx +1 -1
- package/.docs/raw/reference/storage/mssql.mdx +3 -3
- package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +1 -1
- package/.docs/raw/reference/tools/mcp-client.mdx +8 -8
- package/.docs/raw/reference/voice/google-gemini-live.mdx +1 -1
- package/.docs/raw/reference/workflows/step.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +72 -2
- package/.docs/raw/reference/workflows/workflow.mdx +0 -14
- package/.docs/raw/scorers/overview.mdx +5 -5
- package/.docs/raw/server-db/middleware.mdx +4 -4
- package/.docs/raw/tools-mcp/overview.mdx +2 -2
- package/.docs/raw/workflows/agents-and-tools.mdx +2 -6
- package/.docs/raw/workflows/control-flow.mdx +208 -165
- package/.docs/raw/workflows/inngest-workflow.mdx +2 -2
- package/.docs/raw/workflows/overview.mdx +106 -54
- package/.docs/raw/workflows/suspend-and-resume.mdx +1 -9
- package/CHANGELOG.md +20 -0
- package/package.json +5 -5
- package/.docs/raw/workflows/input-data-mapping.mdx +0 -107
|
@@ -69,7 +69,7 @@ To persist and recall information between conversations, memory requires a stora
|
|
|
69
69
|
|
|
70
70
|
Supported options include [LibSQL](/docs/memory/storage/memory-with-libsql), [MongoDB](/examples/memory/memory-with-mongodb), [Postgres](/docs/memory/storage/memory-with-pg), and [Upstash](/docs/memory/storage/memory-with-upstash)
|
|
71
71
|
|
|
72
|
-
We use LibSQL out of the box because it is file-based or in-memory, so it is easy to install and works well with
|
|
72
|
+
We use LibSQL out of the box because it is file-based or in-memory, so it is easy to install and works well with Studio.
|
|
73
73
|
|
|
74
74
|
## Dedicated storage
|
|
75
75
|
|
|
@@ -49,7 +49,7 @@ The three main parameters that control semantic recall behavior are:
|
|
|
49
49
|
|
|
50
50
|
1. **topK**: How many semantically similar messages to retrieve
|
|
51
51
|
2. **messageRange**: How much surrounding context to include with each match
|
|
52
|
-
3. **scope**: Whether to search within the current thread or across all threads owned by a resource
|
|
52
|
+
3. **scope**: Whether to search within the current thread or across all threads owned by a resource (the default is resource scope).
|
|
53
53
|
|
|
54
54
|
```typescript {5-7}
|
|
55
55
|
const agent = new Agent({
|
|
@@ -58,15 +58,13 @@ const agent = new Agent({
|
|
|
58
58
|
semanticRecall: {
|
|
59
59
|
topK: 3, // Retrieve 3 most similar messages
|
|
60
60
|
messageRange: 2, // Include 2 messages before and after each match
|
|
61
|
-
scope:
|
|
61
|
+
scope: "resource", // Search across all threads for this user (default setting if omitted)
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
}),
|
|
65
65
|
});
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Note: currently, `scope: 'resource'` for semantic recall is supported by the following storage adapters: LibSQL, Postgres, and Upstash.
|
|
69
|
-
|
|
70
68
|
### Storage configuration
|
|
71
69
|
|
|
72
70
|
Semantic recall relies on a [storage and vector db](/reference/memory/memory-class) to store messages and their embeddings.
|
|
@@ -27,7 +27,7 @@ Even with memory configured, agents won’t store or recall information unless b
|
|
|
27
27
|
|
|
28
28
|
:::
|
|
29
29
|
|
|
30
|
-
>
|
|
30
|
+
> Studio sets `thread` and `resource` IDs automatically. In your own application, you must provide them manually as part of each `.generate()` or `.stream()` call.
|
|
31
31
|
|
|
32
32
|
### Thread title generation
|
|
33
33
|
|
|
@@ -3,7 +3,7 @@ title: "Working Memory | Memory | Mastra Docs"
|
|
|
3
3
|
description: "Learn how to configure working memory in Mastra to store persistent user data, preferences."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import YouTube from "@site/src/components/YouTube-player";
|
|
7
7
|
|
|
8
8
|
# Working Memory
|
|
9
9
|
|
|
@@ -5,7 +5,7 @@ description: "Store traces locally for development and debugging"
|
|
|
5
5
|
|
|
6
6
|
# Default Exporter
|
|
7
7
|
|
|
8
|
-
The `DefaultExporter` persists traces to your configured storage backend, making them accessible through
|
|
8
|
+
The `DefaultExporter` persists traces to your configured storage backend, making them accessible through Studio. It's automatically enabled when using the default observability configuration and requires no external services.
|
|
9
9
|
|
|
10
10
|
## When to Use DefaultExporter
|
|
11
11
|
|
|
@@ -14,14 +14,14 @@ DefaultExporter is ideal for:
|
|
|
14
14
|
- **Local development** - Debug and analyze traces offline
|
|
15
15
|
- **Data ownership** - Complete control over your trace data
|
|
16
16
|
- **Zero dependencies** - No external services required
|
|
17
|
-
- **
|
|
17
|
+
- **Studio integration** - View traces in Studio
|
|
18
18
|
|
|
19
19
|
## Configuration
|
|
20
20
|
|
|
21
21
|
### Prerequisites
|
|
22
22
|
|
|
23
23
|
1. **Storage Backend**: Configure a storage provider (LibSQL, PostgreSQL, etc.)
|
|
24
|
-
2. **
|
|
24
|
+
2. **Studio**: Install for viewing traces locally
|
|
25
25
|
|
|
26
26
|
### Basic Setup
|
|
27
27
|
|
|
@@ -62,11 +62,11 @@ export const mastra = new Mastra({
|
|
|
62
62
|
|
|
63
63
|
## Viewing Traces
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### Studio
|
|
66
66
|
|
|
67
|
-
Access your traces through
|
|
67
|
+
Access your traces through Studio:
|
|
68
68
|
|
|
69
|
-
1. Start
|
|
69
|
+
1. Start Studio
|
|
70
70
|
2. Navigate to Observability
|
|
71
71
|
3. Filter and search your local traces
|
|
72
72
|
4. Inspect detailed span information
|
|
@@ -79,7 +79,7 @@ Exporters determine where your AI trace data is sent and how it's stored. Choosi
|
|
|
79
79
|
|
|
80
80
|
Mastra provides two built-in exporters that work out of the box:
|
|
81
81
|
|
|
82
|
-
- **[Default](/docs/observability/ai-tracing/exporters/default)** - Persists traces to local storage for viewing in
|
|
82
|
+
- **[Default](/docs/observability/ai-tracing/exporters/default)** - Persists traces to local storage for viewing in Studio
|
|
83
83
|
- **[Cloud](/docs/observability/ai-tracing/exporters/cloud)** - Sends traces to Mastra Cloud for production monitoring and collaboration
|
|
84
84
|
|
|
85
85
|
### External Exporters
|
|
@@ -316,9 +316,9 @@ observability: {
|
|
|
316
316
|
}
|
|
317
317
|
```
|
|
318
318
|
|
|
319
|
-
#### Maintaining
|
|
319
|
+
#### Maintaining Studio and Cloud Access
|
|
320
320
|
|
|
321
|
-
When creating a custom config with external exporters, you might lose access to
|
|
321
|
+
When creating a custom config with external exporters, you might lose access to Studio and Cloud. To maintain access while adding external exporters, include the default exporters in your custom config:
|
|
322
322
|
|
|
323
323
|
```ts title="src/mastra/index.ts" showLineNumbers copy
|
|
324
324
|
import { DefaultExporter, CloudExporter } from "@mastra/core/ai-tracing";
|
|
@@ -336,7 +336,7 @@ export const mastra = new Mastra({
|
|
|
336
336
|
endpoint: process.env.PHOENIX_ENDPOINT,
|
|
337
337
|
apiKey: process.env.PHOENIX_API_KEY,
|
|
338
338
|
}),
|
|
339
|
-
new DefaultExporter(), // Keep
|
|
339
|
+
new DefaultExporter(), // Keep Studio access
|
|
340
340
|
new CloudExporter(), // Keep Cloud access
|
|
341
341
|
],
|
|
342
342
|
},
|
|
@@ -348,7 +348,7 @@ export const mastra = new Mastra({
|
|
|
348
348
|
This configuration sends traces to all three destinations simultaneously:
|
|
349
349
|
|
|
350
350
|
- **Arize Phoenix/AX** for external observability
|
|
351
|
-
- **DefaultExporter** for
|
|
351
|
+
- **DefaultExporter** for Studio
|
|
352
352
|
- **CloudExporter** for Mastra Cloud dashboard
|
|
353
353
|
|
|
354
354
|
:::info
|
|
@@ -643,7 +643,7 @@ console.log("Trace ID:", finalState.traceId);
|
|
|
643
643
|
|
|
644
644
|
Once you have a trace ID, you can:
|
|
645
645
|
|
|
646
|
-
1. **Look up traces in
|
|
646
|
+
1. **Look up traces in Studio**: Navigate to the traces view and search by ID
|
|
647
647
|
2. **Query traces in external platforms**: Use the ID in Langfuse, Braintrust, or your observability platform
|
|
648
648
|
3. **Correlate with logs**: Include the trace ID in your application logs for cross-referencing
|
|
649
649
|
4. **Share for debugging**: Provide trace IDs to support teams or developers for investigation
|
|
@@ -778,7 +778,7 @@ Mastra automatically creates spans for:
|
|
|
778
778
|
|
|
779
779
|
Traces are available in multiple locations:
|
|
780
780
|
|
|
781
|
-
- **
|
|
781
|
+
- **Studio** - Local development environment
|
|
782
782
|
- **Mastra Cloud** - Production monitoring dashboard
|
|
783
783
|
- **Arize Phoenix / Arize AX** - When using Arize exporter
|
|
784
784
|
- **Braintrust Console** - When using Braintrust exporter
|
|
@@ -58,7 +58,7 @@ export const mastra = new Mastra({
|
|
|
58
58
|
});
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
With this basic setup, you will see Traces and Logs in both
|
|
61
|
+
With this basic setup, you will see Traces and Logs in both Studio and in Mastra Cloud.
|
|
62
62
|
|
|
63
63
|
We also support various external tracing providers like Langfuse, Braintrust, and any OpenTelemetry-compatible platform (Datadog, New Relic, SigNoz, etc.). See more about this in the [AI Tracing](/docs/observability/ai-tracing/overview) documentation.
|
|
64
64
|
|
|
@@ -124,8 +124,8 @@ export const agent = new Agent({
|
|
|
124
124
|
name: "instructions",
|
|
125
125
|
type: "SystemMessage | ({ runtimeContext: RuntimeContext }) => SystemMessage | Promise<SystemMessage>",
|
|
126
126
|
isOptional: false,
|
|
127
|
-
description: `Instructions that guide the agent's behavior. Can be a string, array of strings, system message object,
|
|
128
|
-
array of system messages, or a function that returns any of these types dynamically.
|
|
127
|
+
description: `Instructions that guide the agent's behavior. Can be a string, array of strings, system message object,
|
|
128
|
+
array of system messages, or a function that returns any of these types dynamically.
|
|
129
129
|
SystemMessage types: string | string[] | CoreSystemMessage | CoreSystemMessage[] | SystemModelMessage | SystemModelMessage[]`,
|
|
130
130
|
},
|
|
131
131
|
{
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Agent.listScorers() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.listScorers()` method in Mastra agents, which retrieves the scoring configuration."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent.listScorers()
|
|
7
|
+
|
|
8
|
+
The `.listScorers()` method retrieves the scoring configuration configured for an agent, resolving it if it's a function. This method provides access to the scoring system used for evaluating agent responses and performance.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.listScorers();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "options",
|
|
22
|
+
type: "{ runtimeContext?: RuntimeContext }",
|
|
23
|
+
isOptional: true,
|
|
24
|
+
defaultValue: "{}",
|
|
25
|
+
description: "Optional configuration object containing request context.",
|
|
26
|
+
},
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "scorers",
|
|
36
|
+
type: "MastraScorers | Promise<MastraScorers>",
|
|
37
|
+
description:
|
|
38
|
+
"The scoring configuration configured for the agent, either as a direct object or a promise that resolves to the scorers.",
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
## Extended usage example
|
|
44
|
+
|
|
45
|
+
```typescript copy
|
|
46
|
+
await agent.listScorers({
|
|
47
|
+
runtimeContext: new RuntimeContext(),
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Options parameters
|
|
52
|
+
|
|
53
|
+
<PropertiesTable
|
|
54
|
+
content={[
|
|
55
|
+
{
|
|
56
|
+
name: "runtimeContext",
|
|
57
|
+
type: "RuntimeContext",
|
|
58
|
+
isOptional: true,
|
|
59
|
+
defaultValue: "new RuntimeContext()",
|
|
60
|
+
description:
|
|
61
|
+
"Request Context for dependency injection and contextual information.",
|
|
62
|
+
},
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
## Related
|
|
67
|
+
|
|
68
|
+
- [Agents overview](/docs/agents/overview)
|
|
69
|
+
- [Runtime Context](/docs/server-db/runtime-context)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Agent.listTools() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.listTools()` method in Mastra agents, which retrieves the tools that the agent can use."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent.listTools()
|
|
7
|
+
|
|
8
|
+
The `.listTools()` method retrieves the tools configured for an agent, resolving them if they're a function. These tools extend the agent's capabilities, allowing it to perform specific actions or access external systems.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.listTools();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "options",
|
|
22
|
+
type: "{ runtimeContext?: RuntimeContext }",
|
|
23
|
+
isOptional: true,
|
|
24
|
+
defaultValue: "{}",
|
|
25
|
+
description: "Optional configuration object containing request context.",
|
|
26
|
+
},
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "tools",
|
|
36
|
+
type: "TTools | Promise<TTools>",
|
|
37
|
+
description:
|
|
38
|
+
"The tools configured for the agent, either as a direct object or a promise that resolves to the tools.",
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
## Extended usage example
|
|
44
|
+
|
|
45
|
+
```typescript copy
|
|
46
|
+
await agent.listTools({
|
|
47
|
+
runtimeContext: new RuntimeContext(),
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Options parameters
|
|
52
|
+
|
|
53
|
+
<PropertiesTable
|
|
54
|
+
content={[
|
|
55
|
+
{
|
|
56
|
+
name: "runtimeContext",
|
|
57
|
+
type: "RuntimeContext",
|
|
58
|
+
isOptional: true,
|
|
59
|
+
defaultValue: "new RuntimeContext()",
|
|
60
|
+
description:
|
|
61
|
+
"Request Context for dependency injection and contextual information.",
|
|
62
|
+
},
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
## Related
|
|
67
|
+
|
|
68
|
+
- [Using tools with agents](/docs/agents/using-tools)
|
|
69
|
+
- [Creating tools](/docs/tools-mcp/overview)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Agent.listWorkflows() | Agents | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Agent.listWorkflows()` method in Mastra agents, which retrieves the workflows that the agent can execute."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent.listWorkflows()
|
|
7
|
+
|
|
8
|
+
The `.listWorkflows()` method retrieves the workflows configured for an agent, resolving them if they're a function. These workflows enable the agent to execute complex, multi-step processes with defined execution paths.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
await agent.listWorkflows();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "options",
|
|
22
|
+
type: "{ runtimeContext?: RuntimeContext }",
|
|
23
|
+
isOptional: true,
|
|
24
|
+
defaultValue: "{}",
|
|
25
|
+
description: "Optional configuration object containing request context.",
|
|
26
|
+
},
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
<PropertiesTable
|
|
33
|
+
content={[
|
|
34
|
+
{
|
|
35
|
+
name: "workflows",
|
|
36
|
+
type: "Promise<Record<string, Workflow>>",
|
|
37
|
+
description:
|
|
38
|
+
"A promise that resolves to a record of workflow names to their corresponding Workflow instances.",
|
|
39
|
+
},
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
## Extended usage example
|
|
44
|
+
|
|
45
|
+
```typescript copy
|
|
46
|
+
await agent.listWorkflows({
|
|
47
|
+
runtimeContext: new RuntimeContext(),
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Options parameters
|
|
52
|
+
|
|
53
|
+
<PropertiesTable
|
|
54
|
+
content={[
|
|
55
|
+
{
|
|
56
|
+
name: "runtimeContext",
|
|
57
|
+
type: "RuntimeContext",
|
|
58
|
+
isOptional: true,
|
|
59
|
+
defaultValue: "new RuntimeContext()",
|
|
60
|
+
description:
|
|
61
|
+
"Request Context for dependency injection and contextual information.",
|
|
62
|
+
},
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
## Related
|
|
67
|
+
|
|
68
|
+
- [Agents overview](/docs/agents/overview)
|
|
69
|
+
- [Workflows overview](/docs/workflows/overview)
|
|
@@ -9,7 +9,7 @@ You can use the Command-Line Interface (CLI) provided by Mastra to develop, buil
|
|
|
9
9
|
|
|
10
10
|
## `mastra dev`
|
|
11
11
|
|
|
12
|
-
Starts a server which exposes
|
|
12
|
+
Starts a server which exposes [Studio](/docs/getting-started/studio) and REST endpoints for your agents, tools, and workflows. You can visit [http://localhost:4111/swagger-ui](http://localhost:4111/swagger-ui) for an overview of all available endpoints once `mastra dev` is running.
|
|
13
13
|
|
|
14
14
|
You can also [configure the server](/docs/getting-started/studio#configuration).
|
|
15
15
|
|
|
@@ -12,7 +12,7 @@ The Agents API provides methods to interact with Mastra AI agents, including gen
|
|
|
12
12
|
Retrieve a list of all available agents:
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
|
-
const agents = await mastraClient.
|
|
15
|
+
const agents = await mastraClient.listAgents();
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Working with a Specific Agent
|
|
@@ -12,7 +12,7 @@ The Logs API provides methods to access and query system logs and debugging info
|
|
|
12
12
|
Retrieve system logs with optional filtering:
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
|
-
const logs = await mastraClient.
|
|
15
|
+
const logs = await mastraClient.listLogs({
|
|
16
16
|
transportId: "transport-1",
|
|
17
17
|
});
|
|
18
18
|
```
|
|
@@ -74,7 +74,7 @@ export const mastraClient = new MastraClient({
|
|
|
74
74
|
<PropertiesTable
|
|
75
75
|
content={[
|
|
76
76
|
{
|
|
77
|
-
name: "
|
|
77
|
+
name: "listAgents()",
|
|
78
78
|
type: "Promise<Record<string, GetAgentResponse>>",
|
|
79
79
|
description: "Returns all available agent instances.",
|
|
80
80
|
},
|
|
@@ -95,8 +95,8 @@ export const mastraClient = new MastraClient({
|
|
|
95
95
|
description: "Creates a new memory thread with the given parameters.",
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
|
-
name: "getMemoryThread(threadId)",
|
|
99
|
-
type: "
|
|
98
|
+
name: "getMemoryThread({ threadId, agentId })",
|
|
99
|
+
type: "MemoryThread",
|
|
100
100
|
description: "Fetches a specific memory thread by ID.",
|
|
101
101
|
},
|
|
102
102
|
{
|
|
@@ -110,7 +110,7 @@ export const mastraClient = new MastraClient({
|
|
|
110
110
|
description: "Returns the current status of the memory system.",
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
|
-
name: "
|
|
113
|
+
name: "listTools()",
|
|
114
114
|
type: "Record<string, Tool>",
|
|
115
115
|
description: "Returns all available tools.",
|
|
116
116
|
},
|
|
@@ -120,7 +120,7 @@ export const mastraClient = new MastraClient({
|
|
|
120
120
|
description: "Retrieves a specific tool instance by ID.",
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
|
-
name: "
|
|
123
|
+
name: "listWorkflows()",
|
|
124
124
|
type: "Record<string, Workflow>",
|
|
125
125
|
description: "Returns all available workflow instances.",
|
|
126
126
|
},
|
|
@@ -135,7 +135,7 @@ export const mastraClient = new MastraClient({
|
|
|
135
135
|
description: "Returns a vector store instance by name.",
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
|
-
name: "
|
|
138
|
+
name: "listLogs(params)",
|
|
139
139
|
type: "Promise<LogEntry[]>",
|
|
140
140
|
description: "Fetches system logs matching the provided filters.",
|
|
141
141
|
},
|
|
@@ -145,7 +145,7 @@ export const mastraClient = new MastraClient({
|
|
|
145
145
|
description: "Retrieves a specific log entry by ID or filter.",
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
|
-
name: "
|
|
148
|
+
name: "listLogTransports()",
|
|
149
149
|
type: "string[]",
|
|
150
150
|
description: "Returns the list of configured log transport types.",
|
|
151
151
|
},
|
|
@@ -36,7 +36,7 @@ const thread = await mastraClient.createMemoryThread({
|
|
|
36
36
|
Get an instance of a specific memory thread:
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
|
-
const thread = mastraClient.getMemoryThread("thread-id", "agent-id");
|
|
39
|
+
const thread = mastraClient.getMemoryThread({ threadId: "thread-id", agentId: "agent-id" });
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
## Thread Methods
|
|
@@ -12,7 +12,7 @@ The Tools API provides methods to interact with and execute tools available in t
|
|
|
12
12
|
Retrieve a list of all available tools:
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
|
-
const tools = await mastraClient.
|
|
15
|
+
const tools = await mastraClient.listTools();
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Working with a Specific Tool
|
|
@@ -12,7 +12,7 @@ The Workflows API provides methods to interact with and execute automated workfl
|
|
|
12
12
|
Retrieve a list of all available workflows:
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
|
-
const workflows = await mastraClient.
|
|
15
|
+
const workflows = await mastraClient.listWorkflows();
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Working with a Specific Workflow
|
|
@@ -74,5 +74,5 @@ try {
|
|
|
74
74
|
## Related
|
|
75
75
|
|
|
76
76
|
- [getScorer()](../../reference/core/getScorer) - Get a scorer by its registration key
|
|
77
|
-
- [
|
|
77
|
+
- [listScorers()](../../reference/core/listScorers) - Get all registered scorers
|
|
78
78
|
- [createScorer()](../../reference/scorers/create-scorer) - Learn how to create scorers with names
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.listAgents() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.listAgents()` method in Mastra, which retrieves all configured agents."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.listAgents()
|
|
7
|
+
|
|
8
|
+
The `.listAgents()` 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.listAgents();
|
|
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:
|
|
28
|
+
"A record of all configured agents, where keys are agent names and values are agent instances.",
|
|
29
|
+
},
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
## Related
|
|
34
|
+
|
|
35
|
+
- [Agents overview](/docs/agents/overview)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.listLogs() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.listLogs()` method in Mastra, which retrieves all logs for a specific transport ID."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.listLogs()
|
|
7
|
+
|
|
8
|
+
The `.listLogs()` method is used to retrieve all logs for a specific transport ID. This method requires a configured logger that supports the `listLogs` operation.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.listLogs("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:
|
|
29
|
+
"Optional parameters for filtering and pagination. See Options section below for details.",
|
|
30
|
+
optional: true,
|
|
31
|
+
},
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
### Options
|
|
36
|
+
|
|
37
|
+
<PropertiesTable
|
|
38
|
+
content={[
|
|
39
|
+
{
|
|
40
|
+
name: "fromDate",
|
|
41
|
+
type: "Date",
|
|
42
|
+
description:
|
|
43
|
+
"Optional start date for filtering logs. e.g., new Date('2024-01-01').",
|
|
44
|
+
optional: true,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "toDate",
|
|
48
|
+
type: "Date",
|
|
49
|
+
description:
|
|
50
|
+
"Optional end date for filtering logs. e.g., new Date('2024-01-31').",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "logLevel",
|
|
55
|
+
type: "LogLevel",
|
|
56
|
+
description: "Optional log level to filter by.",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "filters",
|
|
61
|
+
type: "Record<string, any>",
|
|
62
|
+
description: "Optional additional filters to apply to the log query.",
|
|
63
|
+
optional: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "page",
|
|
67
|
+
type: "number",
|
|
68
|
+
description: "Optional page number for pagination.",
|
|
69
|
+
optional: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "perPage",
|
|
73
|
+
type: "number",
|
|
74
|
+
description: "Optional number of logs per page for pagination.",
|
|
75
|
+
optional: true,
|
|
76
|
+
},
|
|
77
|
+
]}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
## Returns
|
|
81
|
+
|
|
82
|
+
<PropertiesTable
|
|
83
|
+
content={[
|
|
84
|
+
{
|
|
85
|
+
name: "logs",
|
|
86
|
+
type: "Promise<any>",
|
|
87
|
+
description:
|
|
88
|
+
"A promise that resolves to the logs for the specified transport ID.",
|
|
89
|
+
},
|
|
90
|
+
]}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
## Related
|
|
94
|
+
|
|
95
|
+
- [Logging overview](/docs/observability/logging)
|
|
96
|
+
- [Logger reference](/reference/observability/logging/pino-logger)
|