@mastra/mcp-docs-server 1.2.7-alpha.8 → 1.2.8-alpha.0
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/integrations.md +44 -2
- package/.docs/docs/agent-builder/skill-registries.md +1 -3
- package/.docs/docs/agent-controller/overview.md +1 -1
- package/.docs/docs/agent-controller/session.md +1 -3
- package/.docs/docs/agents/code-mode.md +17 -1
- package/.docs/docs/agents/guardrails.md +8 -8
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +9 -3
- package/.docs/docs/agents/skills.md +2 -4
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +1 -3
- package/.docs/docs/agents/using-tools.md +4 -4
- package/.docs/docs/browser/agent-browser.md +1 -3
- package/.docs/docs/browser/browser-viewer.md +1 -3
- package/.docs/docs/browser/stagehand.md +1 -1
- package/.docs/docs/capabilities/channels/overview.md +1 -3
- package/.docs/docs/deployment/mastra-server.md +2 -4
- package/.docs/docs/editor/overview.md +2 -6
- package/.docs/docs/editor/prompts.md +1 -1
- package/.docs/docs/editor/tools.md +3 -5
- package/.docs/docs/evals/custom-scorers.md +1 -3
- package/.docs/docs/evals/datasets/overview.md +4 -4
- package/.docs/docs/evals/datasets/running-experiments.md +4 -2
- package/.docs/docs/evals/evals-with-memory.md +1 -3
- package/.docs/docs/evals/gates-and-verdicts.md +17 -2
- package/.docs/docs/evals/quick-checks.md +1 -3
- package/.docs/docs/getting-started/file-based-agents.md +9 -4
- package/.docs/docs/long-running-agents/background-tasks.md +1 -1
- package/.docs/docs/long-running-agents/durable-agents.md +3 -5
- package/.docs/docs/long-running-agents/goals.md +1 -3
- package/.docs/docs/long-running-agents/signal-providers.md +1 -3
- package/.docs/docs/long-running-agents/signals.md +7 -21
- package/.docs/docs/mastra-platform/configuration.md +15 -22
- package/.docs/docs/mastra-platform/database.md +50 -6
- package/.docs/docs/mastra-platform/deploy.md +142 -0
- package/.docs/docs/mastra-platform/environments.md +103 -0
- package/.docs/docs/mastra-platform/github.md +2 -2
- package/.docs/docs/mastra-platform/overview.md +5 -5
- package/.docs/docs/mastra-platform/server.md +2 -0
- package/.docs/docs/mastra-platform/studio.md +5 -3
- package/.docs/docs/mcp/mcp-apps.md +3 -3
- package/.docs/docs/mcp/overview.md +6 -10
- package/.docs/docs/memory/overview.md +4 -4
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -3
- package/.docs/docs/observability/logging.md +3 -1
- package/.docs/docs/observability/metrics/querying.md +2 -0
- package/.docs/docs/observability/tracing/overview.md +3 -1
- package/.docs/docs/server/auth/auth0.md +1 -1
- package/.docs/docs/server/auth/better-auth.md +2 -2
- package/.docs/docs/server/auth/clerk.md +1 -1
- package/.docs/docs/server/auth/firebase.md +1 -1
- package/.docs/docs/server/auth/google.md +2 -2
- package/.docs/docs/server/auth/jwt.md +2 -2
- package/.docs/docs/server/auth/okta.md +2 -2
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +4 -4
- package/.docs/docs/server/server-adapters.md +8 -8
- package/.docs/docs/studio/auth.md +1 -3
- package/.docs/docs/workflows/agents-and-tools.md +3 -5
- package/.docs/docs/workflows/control-flow.md +1 -1
- package/.docs/docs/workflows/overview.md +5 -5
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/overview.md +1 -1
- package/.docs/guides/concepts/streaming.md +3 -3
- package/.docs/guides/guide/chef-michel.md +1 -1
- package/.docs/guides/guide/coding-agent.md +392 -0
- package/.docs/guides/migrations/mastra-cloud.md +5 -12
- package/.docs/models/environment-variables.md +14 -2
- package/.docs/models/gateways/azure-openai.md +15 -15
- package/.docs/models/gateways/mastra.md +2 -2
- package/.docs/models/gateways/openrouter.md +4 -7
- package/.docs/models/gateways/vercel.md +5 -10
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/abacus.md +44 -14
- package/.docs/models/providers/ai-router.md +77 -0
- package/.docs/models/providers/ambient.md +10 -6
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/blueclaw.md +74 -0
- package/.docs/models/providers/crossmodel.md +8 -2
- package/.docs/models/providers/daoxe.md +81 -0
- package/.docs/models/providers/databricks.md +7 -2
- package/.docs/models/providers/deepinfra.md +2 -2
- package/.docs/models/providers/deepseek.md +2 -2
- package/.docs/models/providers/ebcloud.md +76 -0
- package/.docs/models/providers/empiriolabs.md +108 -0
- package/.docs/models/providers/google.md +4 -0
- package/.docs/models/providers/hpc-ai.md +16 -10
- package/.docs/models/providers/inferx.md +78 -0
- package/.docs/models/providers/llmgateway.md +2 -8
- package/.docs/models/providers/lynkr.md +73 -0
- package/.docs/models/providers/model-oracle-ai.md +87 -0
- package/.docs/models/providers/neon.md +1 -1
- package/.docs/models/providers/nvidia.md +1 -3
- package/.docs/models/providers/openai.md +12 -3
- package/.docs/models/providers/opencode.md +5 -2
- package/.docs/models/providers/pioneer.md +148 -0
- package/.docs/models/providers/routing-run.md +4 -1
- package/.docs/models/providers/snowflake-cortex.md +4 -1
- package/.docs/models/providers/stepfun-ai-step-plan.md +75 -0
- package/.docs/models/providers/stepfun-ai.md +6 -6
- package/.docs/models/providers/stepfun-step-plan.md +76 -0
- package/.docs/models/providers/stepfun.md +5 -5
- package/.docs/models/providers/unorouter.md +95 -0
- package/.docs/models/providers/vivgrid.md +5 -2
- package/.docs/models/providers/wafer.ai.md +9 -12
- package/.docs/models/providers/xai.md +1 -1
- package/.docs/models/providers/zenmux.md +5 -1
- package/.docs/models/providers.md +14 -2
- package/.docs/reference/agents/generateLegacy.md +8 -2
- package/.docs/reference/cli/mastra.md +131 -10
- package/.docs/reference/code-sdk/mount-agent-controller.md +2 -0
- package/.docs/reference/coding-agent/create-coding-agent.md +5 -4
- package/.docs/reference/evals/create-scorer.md +63 -0
- package/.docs/reference/evals/run-evals.md +2 -2
- package/.docs/reference/file-based-agents/logger.md +26 -0
- package/.docs/reference/file-based-agents/scorers.md +54 -0
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/mastra-platform/api.md +1 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +8 -8
- package/.docs/reference/observability/tracing/exporters/braintrust.md +1 -0
- package/.docs/reference/observability/tracing/exporters/datadog.md +10 -9
- package/.docs/reference/observability/tracing/exporters/langsmith.md +8 -7
- package/.docs/reference/observability/tracing/exporters/posthog.md +13 -12
- package/.docs/reference/observability/tracing/exporters/sentry.md +1 -0
- package/.docs/reference/observability/tracing/interfaces.md +9 -0
- package/.docs/reference/processors/stream-error-retry-processor.md +39 -2
- package/.docs/reference/pubsub/base.md +10 -0
- package/.docs/reference/pubsub/caching-pubsub.md +8 -0
- package/.docs/reference/pubsub/redis-streams.md +12 -0
- package/.docs/reference/server/express-adapter.md +1 -3
- package/.docs/reference/server/fastify-adapter.md +1 -3
- package/.docs/reference/server/hono-adapter.md +1 -3
- package/.docs/reference/server/koa-adapter.md +1 -3
- package/.docs/reference/server/nestjs-adapter.md +1 -3
- package/.docs/reference/server/register-api-route.md +5 -4
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/mcp-client.md +22 -0
- package/.docs/reference/tools/mcp-server.md +161 -4
- package/.docs/reference/voice/google.md +48 -8
- package/.docs/reference/voice/speechify.md +10 -6
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +1 -3
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -3
- package/.docs/reference/workspace/apple-container-sandbox.md +1 -3
- package/.docs/reference/workspace/archil-filesystem.md +1 -3
- package/.docs/reference/workspace/azure-blob-filesystem.md +1 -3
- package/.docs/reference/workspace/blaxel-sandbox.md +1 -3
- package/.docs/reference/workspace/daytona-sandbox.md +1 -3
- package/.docs/reference/workspace/docker-sandbox.md +1 -3
- package/.docs/reference/workspace/e2b-sandbox.md +20 -3
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -3
- package/.docs/reference/workspace/gcs-filesystem.md +1 -3
- package/.docs/reference/workspace/google-drive-filesystem.md +1 -3
- package/.docs/reference/workspace/local-filesystem.md +1 -3
- package/.docs/reference/workspace/local-sandbox.md +1 -3
- package/.docs/reference/workspace/modal-sandbox.md +1 -3
- package/.docs/reference/workspace/railway-sandbox.md +1 -3
- package/.docs/reference/workspace/s3-filesystem.md +1 -3
- package/.docs/reference/workspace/vercel-sandbox.md +5 -7
- package/.docs/reference/workspace/vercel-serverless.md +1 -3
- package/CHANGELOG.md +79 -0
- package/package.json +10 -10
|
@@ -8,6 +8,17 @@ Tool providers let Builder-created agents call tools from third-party apps such
|
|
|
8
8
|
|
|
9
9
|
This page covers what's specific to the Builder: setting up connections, choosing a connection scope, and managing connections. To register a provider and enable its toolkits, see [Tools](https://mastra.ai/docs/editor/tools).
|
|
10
10
|
|
|
11
|
+
## Setup at a glance
|
|
12
|
+
|
|
13
|
+
To connect a toolkit like Gmail and use it from a Builder agent:
|
|
14
|
+
|
|
15
|
+
1. [Register a tool provider](#register-a-tool-provider) on `MastraEditor` with your Composio API key.
|
|
16
|
+
2. [Set up a Composio auth config](#set-up-a-composio-auth-config) for the toolkit and enable it.
|
|
17
|
+
3. [Connect the toolkit](#connect-a-toolkit) from the Builder and complete the OAuth flow.
|
|
18
|
+
4. [Choose a connection scope](#connection-scope) if the default author-owned account isn't what you want.
|
|
19
|
+
|
|
20
|
+
The rest of this page covers each step in detail.
|
|
21
|
+
|
|
11
22
|
## Prerequisites
|
|
12
23
|
|
|
13
24
|
Before agents can use integration tools in the Builder:
|
|
@@ -42,6 +53,8 @@ export const mastra = new Mastra({
|
|
|
42
53
|
|
|
43
54
|
Each provider's toolkits become available in the Builder once it's registered. Use `allowedToolkits` to restrict which toolkits the provider exposes — by slug, such as `gmail` or `googlecalendar`. Omit it to expose every toolkit the provider offers. To add another provider, import it and add another entry to `toolProviders`. For the full list of providers and their options, see [Tools — Integration providers](https://mastra.ai/docs/editor/tools).
|
|
44
55
|
|
|
56
|
+
`ComposioToolProvider` needs a Composio **project** API key (the `x-api-key` type from a project's settings in the [Composio dashboard](https://dashboard.composio.dev)). Store it in an environment variable, as shown with `COMPOSIO_API_KEY` above.
|
|
57
|
+
|
|
45
58
|
## Set up a Composio auth config
|
|
46
59
|
|
|
47
60
|
Each toolkit a user can connect needs its own auth config in the [Composio dashboard](https://dashboard.composio.dev). An auth config defines how Composio authenticates with an app — its OAuth client, scopes, and credentials. Each toolkit needs its own because requirements vary by app: some share common OAuth methods, while others need extra setup. Without an enabled config, the connection flow fails.
|
|
@@ -52,7 +65,7 @@ Each toolkit a user can connect needs its own auth config in the [Composio dashb
|
|
|
52
65
|
|
|
53
66
|
Keep exactly one auth config enabled per toolkit. When a user connects the toolkit, the provider resolves the single enabled config for that toolkit and starts the OAuth flow against it.
|
|
54
67
|
|
|
55
|
-
> **Warning:** The provider throws if a toolkit has zero enabled auth configs or more than one. Enable exactly one auth config per toolkit you expose in the Builder.
|
|
68
|
+
> **Warning:** The provider throws if a toolkit has zero enabled auth configs or more than one. With no enabled config, the connection flow fails with an error like `No ENABLED auth config for toolkit "github"` — enable one in the Composio dashboard to fix it. Enable exactly one auth config per toolkit you expose in the Builder.
|
|
56
69
|
|
|
57
70
|
## Connect a toolkit
|
|
58
71
|
|
|
@@ -65,7 +78,36 @@ The connected account is bound to the agent, and its tools are ready to use on t
|
|
|
65
78
|
|
|
66
79
|
## Connection scope
|
|
67
80
|
|
|
68
|
-
|
|
81
|
+
Each connection determines which account a tool call uses at runtime, and its _scope_ controls who shares that credential. A scope maps each call to a _bucket_ — the identity partition that a connected account is stored under. Scope is a tenancy decision made by you, the app author, not by the end user connecting an account — so you set it on the provider, not in the Builder UI.
|
|
82
|
+
|
|
83
|
+
- `per-author` (default): the connection belongs to the agent's author. Any invoker runs the agent with the author's account. Use this for personal agents or a single shared team account.
|
|
84
|
+
- `shared`: every caller uses one shared bucket, regardless of who invokes the agent. Use this for a platform-owned account that all users should share.
|
|
85
|
+
- `caller-supplied`: each call is bucketed by the caller's `resourceId`, read from the request context. Use this for multi-tenant SaaS, where the host app authenticates the end user upstream and each tenant should use their own connected account.
|
|
86
|
+
|
|
87
|
+
Set `defaultScope` on the provider to apply a scope to every connection authorized against it:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
const composio = new ComposioToolProvider({
|
|
91
|
+
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
92
|
+
allowedToolkits: ['github'],
|
|
93
|
+
defaultScope: 'caller-supplied',
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
With `caller-supplied`, the host app must forward a `resourceId` on every request so each tenant lands in its own bucket. Set `mapUserToResourceId` on the server's auth config to derive the `resourceId` from the authenticated user, so every request carries it automatically:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
export const mastra = new Mastra({
|
|
101
|
+
server: {
|
|
102
|
+
auth: {
|
|
103
|
+
authenticateToken: async token => verifyToken(token),
|
|
104
|
+
mapUserToResourceId: user => user.id,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
> **Warning:** When a `caller-supplied` connection runs without a `resourceId`, every tenant falls back to a single shared `default` bucket. All callers then share one set of credentials, which can expose one tenant's connected account to another. Always wire `mapUserToResourceId` (or otherwise set `resourceId` on the request context) for multi-tenant deployments.
|
|
69
111
|
|
|
70
112
|
## Related
|
|
71
113
|
|
|
@@ -23,9 +23,7 @@ new MastraEditor({
|
|
|
23
23
|
})
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
The Builder library tab now exposes a **Browse** view backed by skills.sh. End users can preview a skill, then install it into an agent.
|
|
27
|
-
|
|
28
|
-
> **Note:** See the [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) for the full `registries` schema.
|
|
26
|
+
The Builder library tab now exposes a **Browse** view backed by skills.sh. End users can preview a skill, then install it into an agent. See the [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) for the full `registries` schema.
|
|
29
27
|
|
|
30
28
|
## Related
|
|
31
29
|
|
|
@@ -88,7 +88,7 @@ await agentController.selectOrCreateThread()
|
|
|
88
88
|
await agentController.sendMessage({ content: 'Hello!' })
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Visit the [AgentController reference](https://mastra.ai/reference/agent-controller/agent-controller-class) for the full constructor parameters and method signatures.
|
|
92
92
|
|
|
93
93
|
## Architecture
|
|
94
94
|
|
|
@@ -133,9 +133,7 @@ agentController.subscribe(event => {
|
|
|
133
133
|
})
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
This is the recommended pattern for most UIs. Subscribe to individual typed events only when you need to react to a specific transition rather than re-render the whole view.
|
|
137
|
-
|
|
138
|
-
> **Note:** Visit the [Session reference](https://mastra.ai/reference/agent-controller/session) for the full list of sub-objects and method signatures.
|
|
136
|
+
This is the recommended pattern for most UIs. Subscribe to individual typed events only when you need to react to a specific transition rather than re-render the whole view. Visit the [Session reference](https://mastra.ai/reference/agent-controller/session) for the full list of sub-objects and method signatures.
|
|
139
137
|
|
|
140
138
|
## Related
|
|
141
139
|
|
|
@@ -94,7 +94,7 @@ For `createCodeMode()` to work well, keep these tips in mind:
|
|
|
94
94
|
- Keep tools focused, so each does one thing well and the model composes them in code.
|
|
95
95
|
- Code mode helps most when calls can be parallelized with `Promise.all`.
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
Visit the [`createCodeMode()` reference](https://mastra.ai/reference/tools/create-code-mode) for configuration options, return values, result shape, and instructions inspection.
|
|
98
98
|
|
|
99
99
|
## Scoping tools across multiple code tools
|
|
100
100
|
|
|
@@ -126,6 +126,22 @@ const agent = new Agent({
|
|
|
126
126
|
|
|
127
127
|
The generated code for `sales_code` can't call an inventory tool, and the reverse holds too. Use this for least-privilege scoping and to keep each tool's prompt surface small.
|
|
128
128
|
|
|
129
|
+
## Remote sandboxes
|
|
130
|
+
|
|
131
|
+
By default, code mode uses a transport that writes the program to the host filesystem and runs `node` against it. That works for `LocalSandbox`, which shares the host, but not for remote sandboxes that run in their own micro-VM (such as [E2B](https://mastra.ai/reference/workspace/e2b-sandbox)), where the host paths don't exist.
|
|
132
|
+
|
|
133
|
+
Remote sandboxes need a transport that writes the program into the sandbox filesystem. For E2B, pass the shipped `E2BCodeModeTransport` as the second argument to `createCodeMode`:
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import { createCodeMode } from '@mastra/core/tools'
|
|
137
|
+
import { E2BSandbox, E2BCodeModeTransport } from '@mastra/e2b'
|
|
138
|
+
|
|
139
|
+
const { tool, instructions } = createCodeMode(
|
|
140
|
+
{ tools, sandbox: new E2BSandbox() },
|
|
141
|
+
new E2BCodeModeTransport(),
|
|
142
|
+
)
|
|
143
|
+
```
|
|
144
|
+
|
|
129
145
|
## Related
|
|
130
146
|
|
|
131
147
|
- [createCodeMode() reference](https://mastra.ai/reference/tools/create-code-mode)
|
|
@@ -29,7 +29,7 @@ export const normalizedAgent = new Agent({
|
|
|
29
29
|
})
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Visit [`UnicodeNormalizer()`](https://mastra.ai/reference/processors/unicode-normalizer) reference for a full list of configuration options.
|
|
33
33
|
|
|
34
34
|
### Prevent prompt injection
|
|
35
35
|
|
|
@@ -52,7 +52,7 @@ export const secureAgent = new Agent({
|
|
|
52
52
|
})
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Visit [`PromptInjectionDetector()`](https://mastra.ai/reference/processors/prompt-injection-detector) reference for a full list of configuration options.
|
|
56
56
|
|
|
57
57
|
### Detect and translate language
|
|
58
58
|
|
|
@@ -75,7 +75,7 @@ export const multilingualAgent = new Agent({
|
|
|
75
75
|
})
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Visit [`LanguageDetector()`](https://mastra.ai/reference/processors/language-detector) reference for a full list of configuration options.
|
|
79
79
|
|
|
80
80
|
## Output processors
|
|
81
81
|
|
|
@@ -101,7 +101,7 @@ export const batchedAgent = new Agent({
|
|
|
101
101
|
})
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
Visit [`BatchPartsProcessor()`](https://mastra.ai/reference/processors/batch-parts-processor) reference for a full list of configuration options.
|
|
105
105
|
|
|
106
106
|
### Scrub system prompts
|
|
107
107
|
|
|
@@ -128,7 +128,7 @@ const scrubbedAgent = new Agent({
|
|
|
128
128
|
})
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
Visit [`SystemPromptScrubber()`](https://mastra.ai/reference/processors/system-prompt-scrubber) reference for a full list of configuration options.
|
|
132
132
|
|
|
133
133
|
> **Note:** When streaming responses over HTTP, Mastra redacts sensitive request data (system prompts, tool definitions, API keys) from stream chunks at the server level by default. See [Stream data redaction](https://mastra.ai/docs/server/mastra-server) for details.
|
|
134
134
|
|
|
@@ -158,7 +158,7 @@ export const moderatedAgent = new Agent({
|
|
|
158
158
|
})
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
Visit [`ModerationProcessor()`](https://mastra.ai/reference/processors/moderation-processor) reference for a full list of configuration options.
|
|
162
162
|
|
|
163
163
|
### Detect and redact PII
|
|
164
164
|
|
|
@@ -184,7 +184,7 @@ export const privateAgent = new Agent({
|
|
|
184
184
|
})
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
Visit [`PIIDetector()`](https://mastra.ai/reference/processors/pii-detector) reference for a full list of configuration options.
|
|
188
188
|
|
|
189
189
|
### Enforce cost limits
|
|
190
190
|
|
|
@@ -206,7 +206,7 @@ export const budgetedAgent = new Agent({
|
|
|
206
206
|
})
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
Visit [`CostGuardProcessor()`](https://mastra.ai/reference/processors/cost-guard-processor) reference for scoping modes, time windows, metric persistence delays, and the `onViolation` callback. Requires observability storage with `getMetricAggregate` support.
|
|
210
210
|
|
|
211
211
|
## Processor strategies
|
|
212
212
|
|
|
@@ -151,9 +151,9 @@ export const mastra = new Mastra({
|
|
|
151
151
|
|
|
152
152
|
Once registered, it can be called from workflows, tools, or other agents, and has access to shared resources such as memory, logging, and observability features.
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
Visit the [agent reference](https://mastra.ai/reference/agents/agent) for more information on available properties and configurations.
|
|
155
155
|
|
|
156
|
-
> **
|
|
156
|
+
> **Tip:** Use [Studio](https://mastra.ai/docs/studio/overview) to test your agent with different messages, inspect tool calls and responses, and debug agent behavior.
|
|
157
157
|
|
|
158
158
|
## Use your agent
|
|
159
159
|
|
|
@@ -850,10 +850,16 @@ const agent = new Agent({
|
|
|
850
850
|
|
|
851
851
|
The retry mechanism:
|
|
852
852
|
|
|
853
|
-
-
|
|
853
|
+
- Works in `processOutputStep()` and `processInputStep()` methods
|
|
854
854
|
- Replays the step with the abort reason added as context for the LLM
|
|
855
855
|
- Tracks retry count via the `retryCount` parameter
|
|
856
|
-
-
|
|
856
|
+
- Requires an explicit `maxProcessorRetries` limit on the agent or call
|
|
857
|
+
|
|
858
|
+
### Error processor retry limits
|
|
859
|
+
|
|
860
|
+
`processAPIError()` has a separate default: when `errorProcessors` are configured and `maxProcessorRetries` is omitted, the runtime allows up to `10` retries. Set the limit explicitly when you need a bounded retry budget.
|
|
861
|
+
|
|
862
|
+
For `StreamErrorRetryProcessor`, also set its `maxRetries` to the same value. Its own default is `1`, which can otherwise be lower than the agent cap. Keep model retries at `0` when the processor is the only retry mechanism for a request.
|
|
857
863
|
|
|
858
864
|
### Violation callbacks
|
|
859
865
|
|
|
@@ -908,7 +914,7 @@ For `agent.generate()`, the result exposes the same information as `result.tripw
|
|
|
908
914
|
|
|
909
915
|
`abort` accepts a second options argument:
|
|
910
916
|
|
|
911
|
-
- `retry: true` asks the agent to retry instead of ending.
|
|
917
|
+
- `retry: true` asks the agent to retry instead of ending. Input and output processor retries require `maxProcessorRetries` to be set on the agent or call.
|
|
912
918
|
- `metadata` attaches structured data to the `tripwire` chunk so downstream consumers can branch on categories like `pii`, `quality`, or `moderation`.
|
|
913
919
|
|
|
914
920
|
## API error handling
|
|
@@ -69,9 +69,7 @@ export const releaseChecklist = createSkill({
|
|
|
69
69
|
})
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
The `references` field bundles supporting documents that the agent can read with the `skill_read` tool, like `references/` files in a filesystem skill.
|
|
73
|
-
|
|
74
|
-
> **Note:** Visit [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill) for the full API.
|
|
72
|
+
The `references` field bundles supporting documents that the agent can read with the `skill_read` tool, like `references/` files in a filesystem skill. Visit [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill) for the full API.
|
|
75
73
|
|
|
76
74
|
## Filesystem path skills
|
|
77
75
|
|
|
@@ -179,7 +177,7 @@ for (const meta of allSkills) {
|
|
|
179
177
|
}
|
|
180
178
|
```
|
|
181
179
|
|
|
182
|
-
|
|
180
|
+
Visit [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill) and [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills) for the full API.
|
|
183
181
|
|
|
184
182
|
## Related
|
|
185
183
|
|
|
@@ -103,7 +103,7 @@ const response = await testAgent.generate('Help me plan my day.', {
|
|
|
103
103
|
console.log(response.object)
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
Visit [`.generate()`](https://mastra.ai/reference/agents/generate) for a full list of configuration options.
|
|
107
107
|
|
|
108
108
|
**Example output:** The `response.object` will contain the structured data as defined by the schema.
|
|
109
109
|
|
|
@@ -226,9 +226,7 @@ How it works:
|
|
|
226
226
|
2. **Scoped memory saves**: Only the delegation prompt and the subagent's response are saved to the subagent's memory
|
|
227
227
|
3. **Fresh thread per invocation**: Each delegation uses a unique thread ID, ensuring clean separation
|
|
228
228
|
|
|
229
|
-
This ensures subagents have the context they need without cluttering their memory with the entire supervisor conversation.
|
|
230
|
-
|
|
231
|
-
> **Note:** Visit [memory in multi-agent systems](https://mastra.ai/docs/memory/overview) for more details.
|
|
229
|
+
This ensures subagents have the context they need without cluttering their memory with the entire supervisor conversation. Visit [memory in multi-agent systems](https://mastra.ai/docs/memory/overview) for more details.
|
|
232
230
|
|
|
233
231
|
## Tool approval propagation
|
|
234
232
|
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Agents use tools to call APIs, query databases, or run custom functions from your codebase. Tools give agents capabilities beyond language generation by providing structured access to data and performing clearly defined operations. You can also load tools from remote [MCP servers](https://mastra.ai/docs/mcp/overview) to expand an agent's capabilities.
|
|
6
6
|
|
|
7
|
+
**For AI agents:** Run `npx mastra api tool execute weather-tool '{"location":"San Francisco"}'` to test this tool directly instead of writing a temporary script. The command requires a running Mastra server; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api tool execute --schema` before constructing different input. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
8
|
+
|
|
7
9
|
## When to use tools
|
|
8
10
|
|
|
9
11
|
Use tools when an agent needs additional context or information from remote resources, or when it needs to run code that performs a specific operation. This includes tasks a model can't reliably handle on its own, such as fetching live data or returning consistent, well-defined outputs.
|
|
@@ -38,9 +40,7 @@ export const weatherTool = createTool({
|
|
|
38
40
|
})
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
When creating tools, keep descriptions concise and focused on what the tool does, emphasizing its primary use case. Descriptive schema names can also help guide the agent on how to use the tool.
|
|
42
|
-
|
|
43
|
-
> **Note:** Visit the [`createTool`](https://mastra.ai/reference/tools/create-tool) reference for more information on available properties, configurations, and examples.
|
|
43
|
+
When creating tools, keep descriptions concise and focused on what the tool does, emphasizing its primary use case. Descriptive schema names can also help guide the agent on how to use the tool. Visit the [`createTool`](https://mastra.ai/reference/tools/create-tool) reference for more information on available properties, configurations, and examples.
|
|
44
44
|
|
|
45
45
|
To make a tool available to an agent, add it to the `tools` property on the `Agent` class. Mentioning available tools and their general purpose in the agent's system prompt helps the agent decide when to call a tool and when not to.
|
|
46
46
|
|
|
@@ -359,7 +359,7 @@ await agent.generate('Check the forecast', {
|
|
|
359
359
|
})
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
-
|
|
362
|
+
See the [`Agent.generate()` reference](https://mastra.ai/reference/agents/generate) for all runtime options including `toolsets`, `clientTools`, and `prepareStep`.
|
|
363
363
|
|
|
364
364
|
## Control `toolName` in stream responses
|
|
365
365
|
|
|
@@ -99,9 +99,7 @@ const browser = new AgentBrowser({
|
|
|
99
99
|
})
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
This adds `browser_record` and `browser_record_caption` to the agent's toolset. See [Browser recording (alpha)](https://mastra.ai/docs/browser/recording) for details.
|
|
103
|
-
|
|
104
|
-
> **Note:** See [AgentBrowser reference](https://mastra.ai/reference/browser/agent-browser) for all configuration options and tool details.
|
|
102
|
+
This adds `browser_record` and `browser_record_caption` to the agent's toolset. See [Browser recording (alpha)](https://mastra.ai/docs/browser/recording) for details. See [AgentBrowser reference](https://mastra.ai/reference/browser/agent-browser) for all configuration options and tool details.
|
|
105
103
|
|
|
106
104
|
## Related
|
|
107
105
|
|
|
@@ -140,9 +140,7 @@ npm install -g browse
|
|
|
140
140
|
browse skills install
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
CDP flag: `--ws`
|
|
144
|
-
|
|
145
|
-
> **Note:** See [BrowserViewer reference](https://mastra.ai/reference/browser/browser-viewer) for all configuration options, advanced connection modes, and method details.
|
|
143
|
+
CDP flag: `--ws` See [BrowserViewer reference](https://mastra.ai/reference/browser/browser-viewer) for all configuration options, advanced connection modes, and method details.
|
|
146
144
|
|
|
147
145
|
## Related
|
|
148
146
|
|
|
@@ -146,7 +146,7 @@ const browser = new StagehandBrowser({
|
|
|
146
146
|
})
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
See [StagehandBrowser reference](https://mastra.ai/reference/browser/stagehand-browser) for all configuration options.
|
|
150
150
|
|
|
151
151
|
## Recording
|
|
152
152
|
|
|
@@ -194,9 +194,7 @@ With this configuration:
|
|
|
194
194
|
- A user pastes a YouTube link and the agent watches and discusses the video.
|
|
195
195
|
- A user pastes an imgur link and the agent sees the image directly.
|
|
196
196
|
|
|
197
|
-
By default, only images are sent inline (`inlineMedia: ['image/*']`). Unsupported types are described as text summaries so the agent knows about the file without failing on models that reject them.
|
|
198
|
-
|
|
199
|
-
> **Note:** See [Channels reference](https://mastra.ai/reference/agents/channels) for all `inlineMedia` patterns and [inlineLinks reference](https://mastra.ai/reference/agents/channels) for domain matching, HEAD detection, and forced MIME types.
|
|
197
|
+
By default, only images are sent inline (`inlineMedia: ['image/*']`). Unsupported types are described as text summaries so the agent knows about the file without failing on models that reject them. See [Channels reference](https://mastra.ai/reference/agents/channels) for all `inlineMedia` patterns and [inlineLinks reference](https://mastra.ai/reference/agents/channels) for domain matching, HEAD detection, and forced MIME types.
|
|
200
198
|
|
|
201
199
|
## Serverless deployment
|
|
202
200
|
|
|
@@ -14,9 +14,7 @@ Run the build command from your project root:
|
|
|
14
14
|
mastra build
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
This creates a `.mastra` directory containing your production-ready server.
|
|
18
|
-
|
|
19
|
-
> **Info:** Read the [`mastra build`](https://mastra.ai/reference/cli/mastra) reference for all available flags.
|
|
17
|
+
This creates a `.mastra` directory containing your production-ready server. Read the [`mastra build`](https://mastra.ai/reference/cli/mastra) reference for all available flags.
|
|
20
18
|
|
|
21
19
|
## Build output
|
|
22
20
|
|
|
@@ -59,7 +57,7 @@ The `mastra start` command provides additional features:
|
|
|
59
57
|
- Provides helpful error messages for missing modules
|
|
60
58
|
- Handles process signals for graceful shutdown
|
|
61
59
|
|
|
62
|
-
|
|
60
|
+
Read the [`mastra start`](https://mastra.ai/reference/cli/mastra) reference for all available flags.
|
|
63
61
|
|
|
64
62
|
## Build configuration
|
|
65
63
|
|
|
@@ -64,9 +64,7 @@ export const mastra = new Mastra({
|
|
|
64
64
|
})
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Once registered, you can manage agents through [Studio](https://mastra.ai/docs/studio/overview) or programmatically through the server API and Client SDK.
|
|
68
|
-
|
|
69
|
-
> **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
|
|
67
|
+
Once registered, you can manage agents through [Studio](https://mastra.ai/docs/studio/overview) or programmatically through the server API and Client SDK. See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
|
|
70
68
|
|
|
71
69
|
## Code and database sources
|
|
72
70
|
|
|
@@ -173,9 +171,7 @@ Because stored agents are data, you can build automation loops that tune agents
|
|
|
173
171
|
- Re-run the experiment against the draft and compare scores to the baseline.
|
|
174
172
|
- Promote the draft to the published version when the scores improve.
|
|
175
173
|
|
|
176
|
-
This turns agent tuning into a closed feedback loop. One agent owns the production configuration, another agent iterates on it, and every change is versioned so you can roll back if a round of automated edits makes things worse. Combine this with [version targeting](#version-targeting-and-experimentation) to keep production traffic on the published version while the draft is being tested.
|
|
177
|
-
|
|
178
|
-
> **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full namespace API.
|
|
174
|
+
This turns agent tuning into a closed feedback loop. One agent owns the production configuration, another agent iterates on it, and every change is versioned so you can roll back if a round of automated edits makes things worse. Combine this with [version targeting](#version-targeting-and-experimentation) to keep production traffic on the published version while the draft is being tested. See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full namespace API.
|
|
179
175
|
|
|
180
176
|
## What can be overridden
|
|
181
177
|
|
|
@@ -122,7 +122,7 @@ await editor.agent.update({
|
|
|
122
122
|
})
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full `editor.prompt` API.
|
|
126
126
|
|
|
127
127
|
## Versioning
|
|
128
128
|
|
|
@@ -52,7 +52,7 @@ Integration providers connect external tool platforms to the editor. Once regist
|
|
|
52
52
|
|
|
53
53
|
[Composio](https://composio.dev) gives access to hundreds of integration tools organized into toolkits (GitHub, Slack, Gmail, and others).
|
|
54
54
|
|
|
55
|
-
1. Get
|
|
55
|
+
1. Get a **project** API key (the `x-api-key` type) from your [Composio dashboard](https://dashboard.composio.dev).
|
|
56
56
|
|
|
57
57
|
2. Register the provider in your Editor configuration:
|
|
58
58
|
|
|
@@ -75,7 +75,7 @@ Integration providers connect external tool platforms to the editor. Once regist
|
|
|
75
75
|
})
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Composio tool slugs use a format like `GITHUB_CREATE_ISSUE`.
|
|
78
|
+
Composio tool slugs use a format like `GITHUB_CREATE_ISSUE`. By default, tool calls use the connection pinned by the agent's author. To route calls to each end user's own account instead, see [connection scope](https://mastra.ai/docs/agent-builder/integrations) in the Agent Builder docs.
|
|
79
79
|
|
|
80
80
|
### Arcade
|
|
81
81
|
|
|
@@ -142,9 +142,7 @@ When an agent runs, tools from all sources are merged in this order:
|
|
|
142
142
|
2. Integration tools
|
|
143
143
|
3. MCP tools
|
|
144
144
|
|
|
145
|
-
If a tool ID exists in multiple sources, later sources take precedence. Description overrides set at the agent level always take priority over the original tool description.
|
|
146
|
-
|
|
147
|
-
> **Note:** See the [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider) for the full provider API.
|
|
145
|
+
If a tool ID exists in multiple sources, later sources take precedence. Description overrides set at the agent level always take priority over the original tool description. See the [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider) for the full provider API.
|
|
148
146
|
|
|
149
147
|
## Related
|
|
150
148
|
|
|
@@ -341,9 +341,7 @@ A custom scorer in Mastra uses `createScorer` with four core components:
|
|
|
341
341
|
3. [**Score Generation**](#score-generation)
|
|
342
342
|
4. [**Reason Generation**](#reason-generation)
|
|
343
343
|
|
|
344
|
-
Together, these components allow you to define custom evaluation logic using LLMs as judges.
|
|
345
|
-
|
|
346
|
-
> **Info:** Visit [createScorer](https://mastra.ai/reference/evals/create-scorer) for the full API and configuration options.
|
|
344
|
+
Together, these components allow you to define custom evaluation logic using LLMs as judges. Visit [createScorer](https://mastra.ai/reference/evals/create-scorer) for the full API and configuration options.
|
|
347
345
|
|
|
348
346
|
```typescript
|
|
349
347
|
import { createScorer } from '@mastra/core/evals'
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
Datasets are collections of test cases that you run experiments against to measure how well your agents and workflows perform. Each mutation creates a new version, so you can reproduce past experiments exactly. Pair datasets with [scorers](https://mastra.ai/docs/evals/overview) to track quality across prompts, models, or code changes.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api dataset create '{"name":"translation-pairs"}'` to create a dataset directly instead of opening Studio or writing a temporary script. The command requires a running Mastra server with a storage adapter that supports datasets; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api dataset create --schema` before adding different dataset fields. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## Usage
|
|
10
12
|
|
|
11
13
|
### Configure storage
|
|
@@ -41,7 +43,7 @@ const existing = await datasets.get({ id: 'dataset-id' })
|
|
|
41
43
|
const { datasets: all } = await datasets.list()
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
Visit the [`DatasetsManager` reference](https://mastra.ai/reference/datasets/datasets-manager) for the full list of methods.
|
|
45
47
|
|
|
46
48
|
## Studio
|
|
47
49
|
|
|
@@ -196,9 +198,7 @@ Fetch the exact items that existed at a past version:
|
|
|
196
198
|
const items = await dataset.listItems({ version: 2 })
|
|
197
199
|
```
|
|
198
200
|
|
|
199
|
-
You can also pin experiments to a version, see [running experiments](https://mastra.ai/docs/evals/datasets/running-experiments).
|
|
200
|
-
|
|
201
|
-
> **Info:** Visit the [`Dataset` reference](https://mastra.ai/reference/datasets/dataset) for the full list of methods and parameters.
|
|
201
|
+
You can also pin experiments to a version, see [running experiments](https://mastra.ai/docs/evals/datasets/running-experiments). Visit the [`Dataset` reference](https://mastra.ai/reference/datasets/dataset) for the full list of methods and parameters.
|
|
202
202
|
|
|
203
203
|
## Related
|
|
204
204
|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
An experiment runs every item in a dataset through a target (an agent, a workflow, or a scorer) and then optionally scores the outputs. Use a scorer as the target when you want to evaluate an LLM judge itself. Results are persisted to storage so you can compare runs across different prompts, models, or code changes.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api experiment run dataset_123 '{"name":"translation-baseline"}'` to start an experiment directly instead of opening Studio or writing a temporary script. Use a dataset ID returned by `npx mastra api dataset list` in place of the sample ID. The command requires a running Mastra server with dataset storage and registered experiment targets; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api experiment run --schema` before constructing different input, and get user approval before starting an experiment because it can make model calls. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## Basic experiment
|
|
10
12
|
|
|
11
13
|
Call [`startExperiment()`](https://mastra.ai/reference/datasets/startExperiment) with a target and scorers:
|
|
@@ -127,7 +129,7 @@ for (const item of summary.results) {
|
|
|
127
129
|
}
|
|
128
130
|
```
|
|
129
131
|
|
|
130
|
-
|
|
132
|
+
Visit the [Scorers overview](https://mastra.ai/docs/evals/overview) for details on available and custom scorers.
|
|
131
133
|
|
|
132
134
|
## Tool mocks
|
|
133
135
|
|
|
@@ -344,7 +346,7 @@ for (const result of results) {
|
|
|
344
346
|
- `completedWithErrors` is `true` when the experiment finished but some items failed.
|
|
345
347
|
- Items cancelled via `signal` appear in `skippedCount`.
|
|
346
348
|
|
|
347
|
-
|
|
349
|
+
Visit the [`startExperiment` reference](https://mastra.ai/reference/datasets/startExperiment) for the full parameter and return type documentation.
|
|
348
350
|
|
|
349
351
|
## Related
|
|
350
352
|
|
|
@@ -136,9 +136,7 @@ const summary = await dataset.startExperiment({
|
|
|
136
136
|
})
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
The inline `task` receives the item's `metadata`, so each row can drive its own thread without changing the agent or any scorer.
|
|
140
|
-
|
|
141
|
-
> **Note:** Visit [runEvals reference](https://mastra.ai/reference/evals/run-evals) and [Dataset reference](https://mastra.ai/reference/datasets/dataset) for full configuration.
|
|
139
|
+
The inline `task` receives the item's `metadata`, so each row can drive its own thread without changing the agent or any scorer. Visit [runEvals reference](https://mastra.ai/reference/evals/run-evals) and [Dataset reference](https://mastra.ai/reference/datasets/dataset) for full configuration.
|
|
142
140
|
|
|
143
141
|
## Related
|
|
144
142
|
|
|
@@ -64,9 +64,24 @@ const result = await runEvals({
|
|
|
64
64
|
// result.gateResults: [{ id: 'check-called-tool', passed: true, score: 1 }]
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Any scorer works as a gate. Quick Checks are a natural fit because they return binary 1/0 scores.
|
|
67
|
+
Any scorer works as a gate. Quick Checks are a natural fit because they return binary 1/0 scores. Visit [runEvals() reference](https://mastra.ai/reference/evals/run-evals) for the full parameter and return type documentation.
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
### Gate-only runs
|
|
70
|
+
|
|
71
|
+
`scorers` is optional when at least one gate is provided. This is useful for deterministic CI checks where you only care about pass/fail gates and don't need to track any quality metrics.
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { runEvals } from '@mastra/core/evals'
|
|
75
|
+
import { checks } from '@mastra/evals/checks'
|
|
76
|
+
|
|
77
|
+
const result = await runEvals({
|
|
78
|
+
data: [{ input: 'What is the weather in Brooklyn?' }],
|
|
79
|
+
target: weatherAgent,
|
|
80
|
+
gates: [checks.calledTool('get_weather'), checks.noToolErrors()],
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
You must provide at least one scorer or gate — a run with neither throws an error.
|
|
70
85
|
|
|
71
86
|
## Thresholds
|
|
72
87
|
|
|
@@ -127,9 +127,7 @@ Each check is a standard `createScorer()` instance with a `preprocess` step and
|
|
|
127
127
|
1. **preprocess**: Extracts and normalizes relevant data from the agent run (text content, tool calls)
|
|
128
128
|
2. **generateScore**: Converts the preprocessed result into a score (typically binary 1 or 0)
|
|
129
129
|
|
|
130
|
-
Because checks skip the `analyze` and `generateReason` steps and make no LLM calls, they run in microseconds.
|
|
131
|
-
|
|
132
|
-
> **Note:** Visit the [Quick Checks reference](https://mastra.ai/reference/evals/checks) for the full API, including all parameters and options for each check.
|
|
130
|
+
Because checks skip the `analyze` and `generateReason` steps and make no LLM calls, they run in microseconds. Visit the [Quick Checks reference](https://mastra.ai/reference/evals/checks) for the full API, including all parameters and options for each check.
|
|
133
131
|
|
|
134
132
|
## Related
|
|
135
133
|
|