@mastra/mcp-docs-server 1.3.9-alpha.1 → 1.3.9-alpha.4
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/mastra-platform/connect/channels.md +14 -2
- package/.docs/docs/mastra-platform/connect/overview.md +1 -1
- package/.docs/docs/mastra-platform/connect/providers.md +1 -0
- package/.docs/docs/mastra-platform/connect/tools.md +25 -3
- package/.docs/docs/memory/semantic-recall.md +2 -0
- package/.docs/models/environment-variables.md +2 -0
- package/.docs/models/gateways/netlify.md +2 -1
- package/.docs/models/gateways/openrouter.md +2 -1
- package/.docs/models/gateways/vercel.md +2 -2
- package/.docs/models/index.md +3 -1
- package/.docs/models/providers/302ai.md +2 -1
- package/.docs/models/providers/aimlapi.md +3 -3
- package/.docs/models/providers/commandcode.md +147 -0
- package/.docs/models/providers/cortecs.md +1 -2
- package/.docs/models/providers/databricks.md +2 -1
- package/.docs/models/providers/edenai.md +7 -5
- package/.docs/models/providers/engy.md +2 -2
- package/.docs/models/providers/kilo.md +14 -12
- package/.docs/models/providers/llmgateway-providers.md +1 -7
- package/.docs/models/providers/llmgateway.md +1 -4
- package/.docs/models/providers/nano-gpt.md +9 -2
- package/.docs/models/providers/ofox.md +24 -24
- package/.docs/models/providers/opencode-go.md +6 -6
- package/.docs/models/providers/opencode.md +8 -6
- package/.docs/models/providers/pioneer.md +120 -119
- package/.docs/models/providers/prime.md +2 -1
- package/.docs/models/providers/reflection.md +77 -0
- package/.docs/models/providers/requesty.md +3 -2
- package/.docs/models/providers/scaleway.md +2 -1
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers.md +2 -0
- package/.docs/reference/agent-controller/session.md +3 -2
- package/.docs/reference/agents/durable-agent.md +3 -1
- package/.docs/reference/agents/inngest-agent.md +4 -4
- package/.docs/reference/classifier/classifier.md +2 -2
- package/.docs/reference/cli/mastra.md +4 -2
- package/.docs/reference/client-js/observability.md +44 -0
- package/.docs/reference/connect/channels.md +2 -2
- package/.docs/reference/connect/providers.md +38 -3
- package/.docs/reference/connect/tools.md +21 -2
- package/.docs/reference/datasets/list.md +9 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +3 -3
- package/.docs/reference/observability/metrics/queries.md +1 -0
- package/.docs/reference/observability/tracing/interfaces.md +6 -0
- package/.docs/reference/streaming/agents/stream.md +18 -0
- package/package.json +5 -5
|
@@ -65,6 +65,50 @@ const selected = await mastraClient.getTrace(list.spans[0].traceId)
|
|
|
65
65
|
|
|
66
66
|
It accepts the same filtering, ordering and delta-polling arguments as `listTraces()`. Use `listTraces()` when you actually need the full span payloads.
|
|
67
67
|
|
|
68
|
+
## Querying spans
|
|
69
|
+
|
|
70
|
+
`querySpans()` returns completed span summaries across traces. It requires a positive ISO timestamp range over span start time and supports cursor pagination:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
const result = await mastraClient.querySpans({
|
|
74
|
+
timeRange: {
|
|
75
|
+
from: '2026-10-01T00:00:00.000Z',
|
|
76
|
+
to: '2026-10-02T00:00:00.000Z',
|
|
77
|
+
},
|
|
78
|
+
where: {
|
|
79
|
+
op: 'and',
|
|
80
|
+
args: [
|
|
81
|
+
{ op: 'eq', left: { path: 'threadId' }, right: { literal: 'thread-123' } },
|
|
82
|
+
{ op: 'gte', left: { path: 'durationMs' }, right: { literal: 1000 } },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
orderBy: [{ field: 'startedAt', direction: 'desc' }],
|
|
86
|
+
page: { limit: 100 },
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// Pass result.page.next as page.after to continue with the same filters and ordering.
|
|
90
|
+
console.log(result.spans)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Pages default to 100 rows and allow at most 1,000. The response is `{ spans, page: { next } }`, without a total count. Ordering accepts exactly one of `startedAt` or `endedAt`, ascending or descending, and defaults to descending start time.
|
|
94
|
+
|
|
95
|
+
| Fields | Operators |
|
|
96
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
97
|
+
| `traceId`, `spanId`, `parentSpanId`, `threadId` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
|
|
98
|
+
| `organizationId`, `resourceId`, `runId`, `sessionId`, `userId`, `requestId`, `serviceName`, `experimentId`, `environment`, `executionSource` | Same string operators |
|
|
99
|
+
| Entity, parent entity and root entity `Type`, `Id`, `Name`, `VersionId` fields, such as `parentEntityId` | Same string operators |
|
|
100
|
+
| `name`, `spanType`, `status` | Same string operators; `name` also accepts `matches` / `notMatches` for normalized whole words and phrases |
|
|
101
|
+
| `startedAt`, `endedAt`, `durationMs` | Comparisons, membership and presence |
|
|
102
|
+
| `error` | `exists`, `notExists` |
|
|
103
|
+
|
|
104
|
+
Combine predicates with `and`, `or` and `not`. Membership uses `{ op: 'in', value: { path: 'spanType' }, set: ['agent_run', 'tool_call'] }`. A span's status is `error` when it has an error and `success` otherwise.
|
|
105
|
+
|
|
106
|
+
Each summary includes identity, context, entity lineage, status, timestamps, `durationMs`, model/provider and input/output/error previews. Model/provider are available in returned rows but aren't filterable.
|
|
107
|
+
|
|
108
|
+
The additional identity, context and parent/root entity filters require an updated storage adapter. With an older adapter, requests using these filters return a structured `422` error.
|
|
109
|
+
|
|
110
|
+
DuckDB returns `null` for parent/root entity type, ID and name, and for `executionSource`. Equality filters on these fields match no spans. Parent/root entity version IDs remain available.
|
|
111
|
+
|
|
68
112
|
## Querying traces
|
|
69
113
|
|
|
70
114
|
`queryTraces()` finds completed logical traces using trace fields and conditions over related spans. Every query requires an ISO timestamp range.
|
|
@@ -18,9 +18,9 @@ export const mastra = new Mastra({
|
|
|
18
18
|
|
|
19
19
|
Returns: `Promise<ChannelsResolver>`. See [The resolver](#the-resolver).
|
|
20
20
|
|
|
21
|
-
The [documented channel setup](https://mastra.ai/docs/mastra-platform/connect/channels) covers Slack, Telegram, and
|
|
21
|
+
The [documented channel setup](https://mastra.ai/docs/mastra-platform/connect/channels) covers Slack, Telegram, Discord, and Microsoft Teams. Their implementations come from `@mastra/slack`, `@mastra/telegram`, `@mastra/discord`, and `@mastra/teams`, loaded on demand. Use those packages directly to configure a channel outside the platform connection flow.
|
|
22
22
|
|
|
23
|
-
The
|
|
23
|
+
The Teams provider encrypts stored bot secrets with `MASTRA_ENCRYPTION_KEY` when set. When it isn't, the key is derived from the platform access token and a warning is logged while a Teams connection is active. Rotating the platform access token makes stored bot credentials unreadable (disconnect and reconnect to re-provision). Projects without a Teams connection are unaffected.
|
|
24
24
|
|
|
25
25
|
## Parameters
|
|
26
26
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Provider toolsets
|
|
6
6
|
|
|
7
|
-
This page documents generated toolsets for
|
|
7
|
+
This page documents generated toolsets for 22 providers (910 tools in this version of `@mastra/connect`). It isn't an exhaustive list of providers registered in the SDK or available in the platform catalog. [`tools()`](https://mastra.ai/reference/connect/tools) exposes a provider's toolset when the project has an active connection for its provider ID.
|
|
8
8
|
|
|
9
9
|
Tool keys are stable identifiers of the form `<provider>_<action>` and are the values accepted by `allowTools` and `disallowTools`. Toolsets are versioned with the package: the exact list depends on the installed `@mastra/connect` version, and this page reflects the version it was generated from.
|
|
10
10
|
|
|
@@ -18,13 +18,14 @@ MCP providers (Attio, Canva, Clay, Neon, Render, Robinhood, and Sanity) serve th
|
|
|
18
18
|
|  [GitHub](#github) | `github` | 49 |
|
|
19
19
|
|  [Google Calendar](#google-calendar) | `google-calendar` | 43 |
|
|
20
20
|
|  [Google Docs](#google-docs) | `google-docs` | 37 |
|
|
21
|
-
|  [Google Drive](#google-drive) | `google-drive` |
|
|
21
|
+
|  [Google Drive](#google-drive) | `google-drive` | 32 |
|
|
22
22
|
|  [Gmail](#gmail) | `google-mail` | 52 |
|
|
23
23
|
|  [Google Sheets](#google-sheets) | `google-sheet` | 18 |
|
|
24
24
|
|  [HubSpot](#hubspot) | `hubspot` | 50 |
|
|
25
25
|
|  [incident.io](#incidentio) | `incident-io` | 66 |
|
|
26
26
|
|  [Jira](#jira) | `jira` | 38 |
|
|
27
27
|
|  [Linear](#linear) | `linear` | 46 |
|
|
28
|
+
|  [Microsoft Teams](#microsoft-teams) | `microsoft-teams` | 25 |
|
|
28
29
|
|  [Notion](#notion) | `notion` | 44 |
|
|
29
30
|
|  [OpenAI](#openai) | `openai` | 26 |
|
|
30
31
|
|  [PostHog](#posthog) | `posthog` | 67 |
|
|
@@ -310,7 +311,7 @@ Provider ID: `google-docs` · 37 tools
|
|
|
310
311
|
|
|
311
312
|
## Google Drive
|
|
312
313
|
|
|
313
|
-
Provider ID: `google-drive` ·
|
|
314
|
+
Provider ID: `google-drive` · 32 tools
|
|
314
315
|
|
|
315
316
|
| Tool | Description |
|
|
316
317
|
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
@@ -323,6 +324,7 @@ Provider ID: `google-drive` · 30 tools
|
|
|
323
324
|
| `google_drive_delete_permission` | Remove a permission from a file |
|
|
324
325
|
| `google_drive_delete_shared_drive` | Delete a shared drive |
|
|
325
326
|
| `google_drive_empty_trash` | Permanently delete all trashed files |
|
|
327
|
+
| `google_drive_export_file` | Export a Google Workspace file (Doc, Sheet, Slide, etc.) to the specified MIME type. |
|
|
326
328
|
| `google_drive_find_file` | Search for files by name or query in Google Drive |
|
|
327
329
|
| `google_drive_find_folder` | Search for a folder by name or query |
|
|
328
330
|
| `google_drive_get_about` | Get the user's drive info and storage quota |
|
|
@@ -337,6 +339,7 @@ Provider ID: `google-drive` · 30 tools
|
|
|
337
339
|
| `google_drive_list_drives` | List shared drives the user can access, with cursor pagination and drive metadata like hidden, capabilities, and restrictions. |
|
|
338
340
|
| `google_drive_list_files_non_unified` | List immediate files and folders for a folder ID, or root when omitted, with cursor pagination and shared-drive support. |
|
|
339
341
|
| `google_drive_list_permissions` | List permissions on a file |
|
|
342
|
+
| `google_drive_list_revisions` | List the revision history for a Drive file. |
|
|
340
343
|
| `google_drive_move_file` | Move a file to a different folder |
|
|
341
344
|
| `google_drive_unhide_shared_drive` | Restore a hidden shared drive to default view |
|
|
342
345
|
| `google_drive_update_comment` | Update a comment on a file |
|
|
@@ -657,6 +660,38 @@ Provider ID: `linear` · 46 tools
|
|
|
657
660
|
| `linear_update_issue_relation` | Update fields on an existing Linear issue relation. |
|
|
658
661
|
| `linear_update_project` | Update an existing Linear project. |
|
|
659
662
|
|
|
663
|
+
## Microsoft Teams
|
|
664
|
+
|
|
665
|
+
Provider ID: `microsoft-teams` · 25 tools
|
|
666
|
+
|
|
667
|
+
| Tool | Description |
|
|
668
|
+
| ------------------------------------------ | ------------------------------------------------ |
|
|
669
|
+
| `microsoft_teams_add_team_member` | Add a member to a team |
|
|
670
|
+
| `microsoft_teams_create_channel` | Create a channel in a team. |
|
|
671
|
+
| `microsoft_teams_create_channel_message` | Post a root message in a channel |
|
|
672
|
+
| `microsoft_teams_create_channel_tab` | Add a tab to a channel. |
|
|
673
|
+
| `microsoft_teams_create_chat` | Create a one-on-one or group chat. |
|
|
674
|
+
| `microsoft_teams_create_chat_message` | Send a message in a chat |
|
|
675
|
+
| `microsoft_teams_create_team` | Create a team from a template or existing group. |
|
|
676
|
+
| `microsoft_teams_delete_channel` | Delete a channel from a team |
|
|
677
|
+
| `microsoft_teams_get_channel` | Retrieve a channel by ID. |
|
|
678
|
+
| `microsoft_teams_get_channel_message` | Retrieve a channel message by ID. |
|
|
679
|
+
| `microsoft_teams_get_chat` | Retrieve a chat by ID. |
|
|
680
|
+
| `microsoft_teams_get_chat_message` | Retrieve a chat message by ID. |
|
|
681
|
+
| `microsoft_teams_get_team` | Retrieve a team by ID. |
|
|
682
|
+
| `microsoft_teams_list_channel_messages` | List root messages in a channel. |
|
|
683
|
+
| `microsoft_teams_list_channel_replies` | List replies under a channel message thread |
|
|
684
|
+
| `microsoft_teams_list_channel_tabs` | List tabs configured on a channel. |
|
|
685
|
+
| `microsoft_teams_list_channels` | List channels in a team. |
|
|
686
|
+
| `microsoft_teams_list_chat_members` | List members in a chat |
|
|
687
|
+
| `microsoft_teams_list_chat_messages` | List messages in a chat. |
|
|
688
|
+
| `microsoft_teams_list_chats` | List chats for a user. |
|
|
689
|
+
| `microsoft_teams_list_joined_teams` | List teams the user has joined |
|
|
690
|
+
| `microsoft_teams_list_team_members` | List members in a team. |
|
|
691
|
+
| `microsoft_teams_remove_team_member` | Remove a member from a team. |
|
|
692
|
+
| `microsoft_teams_reply_to_channel_message` | Reply to a channel message thread. |
|
|
693
|
+
| `microsoft_teams_update_channel` | Update mutable channel properties. |
|
|
694
|
+
|
|
660
695
|
## Notion
|
|
661
696
|
|
|
662
697
|
Provider ID: `notion` · 44 tools
|
|
@@ -25,7 +25,7 @@ See [Connect](https://mastra.ai/docs/mastra-platform/connect/overview) to get st
|
|
|
25
25
|
|
|
26
26
|
## Parameters
|
|
27
27
|
|
|
28
|
-
**options** (`ToolsOptions`): Optional discovery and client configuration.
|
|
28
|
+
**options** (`ToolsOptions | ((ctx?: ToolsResolverContext) => ToolsOptions | Promise<ToolsOptions>)`): Optional discovery and client configuration, or a callback returning it per request. See Per-request options below.
|
|
29
29
|
|
|
30
30
|
**options.projectId** (`string`): Platform project whose connections to discover. Falls back to MASTRA\_PROJECT\_ID.
|
|
31
31
|
|
|
@@ -41,6 +41,25 @@ See [Connect](https://mastra.ai/docs/mastra-platform/connect/overview) to get st
|
|
|
41
41
|
|
|
42
42
|
**options.ttlMs** (`number`): How long a resolved snapshot stays fresh, in milliseconds. Default 30000. 0 revalidates on every resolution.
|
|
43
43
|
|
|
44
|
+
### Per-request options
|
|
45
|
+
|
|
46
|
+
Pass a callback instead of an options object to vary options per request, for example role-based filters or approval policies. The callback runs on every resolution (sync or async) and receives the same context Mastra passes the resolver (`requestContext` is populated when the resolver is an agent's `tools` option):
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
const connected = tools(ctx => ({
|
|
50
|
+
providers: {
|
|
51
|
+
linear:
|
|
52
|
+
ctx?.requestContext?.get('role') === 'viewer'
|
|
53
|
+
? { allowTools: ['linear_list_*'] }
|
|
54
|
+
: { requireApproval: ['linear_delete_*'] },
|
|
55
|
+
},
|
|
56
|
+
}))
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The resolver memoizes snapshots per distinct options value, so requests producing the same options share one cached snapshot with the usual `ttlMs` and stale-while-revalidate semantics. Structurally equal options returned from different calls count as the same value; non-serializable values such as a custom `client.fetch` compare by identity. The resolver keeps caches for at most 32 distinct options values and evicts the least recently used one (closing its MCP transports) past that, so derive options from a small, closed set of inputs such as roles, not from unbounded per-request data.
|
|
60
|
+
|
|
61
|
+
With the callback form, option validation runs at the first resolution that produces a given options value rather than at `tools()` time, and a validation error fails that resolution. `refresh()` fetches for the options the callback returns without a context (the same variant a direct `await connected()` call uses), and `disconnect()` closes every memoized variant.
|
|
62
|
+
|
|
44
63
|
### Per-provider options
|
|
45
64
|
|
|
46
65
|
Each value in the `providers` record form is `true`, `false`, or a `ToolsProviderOptions`:
|
|
@@ -89,7 +108,7 @@ The resolver also exposes methods for manual control:
|
|
|
89
108
|
|
|
90
109
|
Errors fall into four groups:
|
|
91
110
|
|
|
92
|
-
- Configuration errors (missing project ID or token, a malformed provider ID, both `allowTools` and `disallowTools` at one level, invalid `ttlMs`) throw when you call `tools()`.
|
|
111
|
+
- Configuration errors (missing project ID or token, a malformed provider ID, both `allowTools` and `disallowTools` at one level, invalid `ttlMs`) throw when you call `tools()`. With [the callback form](#per-request-options), they fail the first resolution that produces the invalid options instead.
|
|
93
112
|
- An enabled provider ID that the platform catalog confirms is unknown fails the resolution with `invalid_options`. An unknown tool key or zero-match glob in a per-provider filter does the same. If the catalog can't be reached, an unknown ID downgrades to a warning and is skipped.
|
|
94
113
|
- If a background refresh fails while a snapshot is cached, the resolver keeps serving the cached toolsets and warns. It rejects only when nothing was ever cached.
|
|
95
114
|
- A problem with one provider, such as a connection that needs reauthorization, logs a warning and skips that provider. The other providers' tools still load.
|
|
@@ -32,13 +32,19 @@ const filtered = await mastra.datasets.list({
|
|
|
32
32
|
const forAgents = await mastra.datasets.list({
|
|
33
33
|
filters: { targetIds: ['agent-a', 'agent-b'] },
|
|
34
34
|
})
|
|
35
|
+
|
|
36
|
+
// Fetch specific datasets by ID, all on one page
|
|
37
|
+
const byId = await mastra.datasets.list({
|
|
38
|
+
perPage: false,
|
|
39
|
+
filters: { datasetIds: ['dataset-1', 'dataset-2'] },
|
|
40
|
+
})
|
|
35
41
|
```
|
|
36
42
|
|
|
37
43
|
## Parameters
|
|
38
44
|
|
|
39
45
|
**page** (`number`): Page number. Defaults to 0.
|
|
40
46
|
|
|
41
|
-
**perPage** (`number`): Number of datasets per page. Defaults to 20.
|
|
47
|
+
**perPage** (`number | false`): Number of datasets per page, or false to return every match on one page. Defaults to 20.
|
|
42
48
|
|
|
43
49
|
**filters** (`object`): Optional filters applied at the storage layer.
|
|
44
50
|
|
|
@@ -54,6 +60,8 @@ const forAgents = await mastra.datasets.list({
|
|
|
54
60
|
|
|
55
61
|
**filters.targetIds** (`string[]`): Restrict to datasets whose targetIds intersect this list (any-overlap match). Empty array is treated as no filter.
|
|
56
62
|
|
|
63
|
+
**filters.datasetIds** (`string[]`): Restrict to datasets with these IDs. Empty array matches no datasets. Pass perPage: false to get every match on one page.
|
|
64
|
+
|
|
57
65
|
**filters.name** (`string`): Case-insensitive substring match on dataset name. Empty string is treated as no filter.
|
|
58
66
|
|
|
59
67
|
## Returns
|
|
@@ -10,7 +10,7 @@ For setup instructions, see the [Metrics overview](https://mastra.ai/docs/observ
|
|
|
10
10
|
|
|
11
11
|
## When Mastra emits automatic metrics
|
|
12
12
|
|
|
13
|
-
Metrics are extracted from spans when they end. The observability layer inspects each completed span, calculates duration, and
|
|
13
|
+
Metrics are extracted from spans when they end. The observability layer inspects each completed span, calculates duration, and reads token usage data from model generation and classifier evaluation spans. No manual instrumentation is needed.
|
|
14
14
|
|
|
15
15
|
### What affects whether a metric is available
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@ Duration metrics record execution time in milliseconds, calculated from the span
|
|
|
35
35
|
|
|
36
36
|
## Token usage metrics
|
|
37
37
|
|
|
38
|
-
Token metrics are emitted
|
|
38
|
+
Token metrics are emitted from `MODEL_GENERATION` and `CLASSIFIER_EVALUATION` spans that include `usage` data. Token metrics require usage data from the provider.
|
|
39
39
|
|
|
40
40
|
### Input token metrics
|
|
41
41
|
|
|
@@ -142,7 +142,7 @@ When you spot a spike in latency or token usage on the Metrics dashboard, correl
|
|
|
142
142
|
|
|
143
143
|
### Token metrics are missing
|
|
144
144
|
|
|
145
|
-
- **Span is a model generation**: Token metrics are only emitted from `MODEL_GENERATION` spans.
|
|
145
|
+
- **Span is a model generation or classifier evaluation**: Token metrics are only emitted from `MODEL_GENERATION` and `CLASSIFIER_EVALUATION` spans.
|
|
146
146
|
- **Provider reports usage**: The model provider must include `usage` data in its response. Usage data is required to emit token metrics.
|
|
147
147
|
|
|
148
148
|
## Related
|
|
@@ -110,6 +110,7 @@ All metric operations accept the same optional `filters` object. Raw list reques
|
|
|
110
110
|
| `userId` | `string` | User ID |
|
|
111
111
|
| `organizationId` | `string` | Organization ID |
|
|
112
112
|
| `experimentId` | `string` | Experiment or evaluation run ID |
|
|
113
|
+
| `experimentIds` | `string[]` | One to 1,000 experiment IDs |
|
|
113
114
|
| `serviceName` | `string` | Service name |
|
|
114
115
|
| `environment` | `string` | Environment name |
|
|
115
116
|
| `resourceId` | `string` | Resource ID |
|
|
@@ -542,6 +542,9 @@ interface AgentRunAttributes {
|
|
|
542
542
|
|
|
543
543
|
/** Maximum steps allowed */
|
|
544
544
|
maxSteps?: number
|
|
545
|
+
|
|
546
|
+
/** When the run's model streamed its first chunk, copied from the agent's own first generation */
|
|
547
|
+
completionStartTime?: Date
|
|
545
548
|
}
|
|
546
549
|
```
|
|
547
550
|
|
|
@@ -639,6 +642,9 @@ interface ModelStepAttributes {
|
|
|
639
642
|
|
|
640
643
|
/** Result warnings */
|
|
641
644
|
warnings?: Record<string, any>
|
|
645
|
+
|
|
646
|
+
/** When the step's first inference streamed its first chunk */
|
|
647
|
+
completionStartTime?: Date
|
|
642
648
|
}
|
|
643
649
|
```
|
|
644
650
|
|
|
@@ -248,6 +248,24 @@ const stream = await agent.stream('message for agent')
|
|
|
248
248
|
|
|
249
249
|
**spanId** (`string`): The root span ID associated with this execution when Tracing is enabled. Use this for span-level lookup and correlation.
|
|
250
250
|
|
|
251
|
+
## `stopWhen` errors
|
|
252
|
+
|
|
253
|
+
If a `stopWhen` predicate throws, `fullStream` rejects with that error. The stream does not emit a `step-finish`, `finish`, or `error` chunk for the failure. Catch the rejection around stream consumption:
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
async function consumeStream() {
|
|
257
|
+
try {
|
|
258
|
+
for await (const chunk of stream.fullStream) {
|
|
259
|
+
console.log(chunk)
|
|
260
|
+
}
|
|
261
|
+
} catch (error) {
|
|
262
|
+
console.error('stopWhen failed', error)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Durable transports reconstruct cross-process errors from their serialized name and message. The original stack, cause, and subclass identity are not available to the stream consumer.
|
|
268
|
+
|
|
251
269
|
## Signal visibility
|
|
252
270
|
|
|
253
271
|
Signals, including reactive reminders, appear in `fullStream` by default. Set `hideSignals` to omit selected signal chunks from your stream:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.9-alpha.
|
|
3
|
+
"version": "1.3.9-alpha.4",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
|
|
27
27
|
"local-pkg": "^1.1.2",
|
|
28
28
|
"zod": "^4.6.4",
|
|
29
|
-
"@mastra/
|
|
30
|
-
"@mastra/
|
|
29
|
+
"@mastra/mcp": "^2.4.2-alpha.0",
|
|
30
|
+
"@mastra/core": "1.79.0-alpha.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hono/node-server": "^2.0.0",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"tsx": "^4.23.1",
|
|
44
44
|
"typescript": "^7.0.2",
|
|
45
45
|
"vitest": "4.1.11",
|
|
46
|
-
"@internal/lint": "0.0.144",
|
|
47
46
|
"@internal/types-builder": "0.0.119",
|
|
48
|
-
"@
|
|
47
|
+
"@internal/lint": "0.0.144",
|
|
48
|
+
"@mastra/core": "1.79.0-alpha.2"
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://mastra.ai",
|
|
51
51
|
"repository": {
|