@mastra/mcp-docs-server 1.3.5-alpha.1 → 1.3.5-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/.docs/docs/agents/code-mode.md +0 -2
  2. package/.docs/docs/channels.md +5 -1
  3. package/.docs/docs/develop.md +1 -3
  4. package/.docs/docs/guides/context-engineering.md +0 -2
  5. package/.docs/docs/harness/agent-controller.md +0 -2
  6. package/.docs/docs/harness/durable-agents.md +2 -0
  7. package/.docs/docs/harness/goals.md +1 -3
  8. package/.docs/docs/harness/schedules.md +0 -2
  9. package/.docs/docs/harness/signal-providers.md +1 -3
  10. package/.docs/docs/harness/signals.md +15 -3
  11. package/.docs/docs/memory/observational-memory.md +1 -1
  12. package/.docs/docs/memory/semantic-recall.md +35 -1
  13. package/.docs/docs/storage.md +1 -0
  14. package/.docs/docs/workflows/error-handling.md +2 -0
  15. package/.docs/docs/workflows/scheduled-workflows.md +2 -2
  16. package/.docs/integrations/databases/clickhouse-managed-postgres.md +82 -0
  17. package/.docs/integrations.md +1 -0
  18. package/.docs/models/environment-variables.md +1 -0
  19. package/.docs/models/gateways/merge-gateway.md +3 -1
  20. package/.docs/models/gateways/neon.md +2 -1
  21. package/.docs/models/gateways/netlify.md +3 -1
  22. package/.docs/models/gateways/openrouter.md +2 -1
  23. package/.docs/models/gateways/vercel.md +1 -1
  24. package/.docs/models/index.md +2 -1
  25. package/.docs/models/providers/aiand.md +17 -15
  26. package/.docs/models/providers/blueclaw.md +8 -9
  27. package/.docs/models/providers/coralbricks.md +6 -4
  28. package/.docs/models/providers/cortecs.md +5 -11
  29. package/.docs/models/providers/crossmodel.md +2 -1
  30. package/.docs/models/providers/deepinfra.md +57 -60
  31. package/.docs/models/providers/deepseek.md +1 -1
  32. package/.docs/models/providers/edenai.md +5 -3
  33. package/.docs/models/providers/engy.md +84 -0
  34. package/.docs/models/providers/kilo.md +17 -16
  35. package/.docs/models/providers/llmgateway-providers.md +12 -3
  36. package/.docs/models/providers/llmgateway.md +2 -2
  37. package/.docs/models/providers/nano-gpt.md +7 -5
  38. package/.docs/models/providers/opencode.md +2 -1
  39. package/.docs/models/providers/privatemode-ai.md +5 -5
  40. package/.docs/models/providers/requesty.md +2 -1
  41. package/.docs/models/providers/subconscious.md +8 -8
  42. package/.docs/models/providers/synthetic.md +2 -1
  43. package/.docs/models/providers/togetherai.md +21 -28
  44. package/.docs/models/providers/umans-ai-coding-plan.md +2 -1
  45. package/.docs/models/providers/umans-ai.md +2 -1
  46. package/.docs/models/providers/xai.md +3 -2
  47. package/.docs/models/providers.md +1 -0
  48. package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
  49. package/.docs/reference/agent-controller/session.md +8 -2
  50. package/.docs/reference/agents/channels.md +2 -1
  51. package/.docs/reference/agents/durable-agent.md +12 -7
  52. package/.docs/reference/client-js/agents.md +1 -1
  53. package/.docs/reference/client-js/observability.md +28 -0
  54. package/.docs/reference/code-sdk/acp-server.md +19 -2
  55. package/.docs/reference/code-sdk/mount-agent-controller.md +0 -2
  56. package/.docs/reference/configuration.md +1 -1
  57. package/.docs/reference/editor/mastra-editor.md +28 -0
  58. package/.docs/reference/file-based-agents/config.md +0 -2
  59. package/.docs/reference/file-based-agents/instructions.md +0 -2
  60. package/.docs/reference/file-based-agents/logger.md +0 -2
  61. package/.docs/reference/file-based-agents/memory.md +0 -2
  62. package/.docs/reference/file-based-agents/observability.md +0 -2
  63. package/.docs/reference/file-based-agents/processors.md +0 -2
  64. package/.docs/reference/file-based-agents/schedules.md +2 -4
  65. package/.docs/reference/file-based-agents/scorers.md +0 -2
  66. package/.docs/reference/file-based-agents/server.md +0 -2
  67. package/.docs/reference/file-based-agents/skills.md +0 -2
  68. package/.docs/reference/file-based-agents/storage.md +0 -2
  69. package/.docs/reference/file-based-agents/studio.md +0 -2
  70. package/.docs/reference/file-based-agents/subagents.md +0 -2
  71. package/.docs/reference/file-based-agents/tools.md +0 -2
  72. package/.docs/reference/file-based-agents/workflows.md +0 -2
  73. package/.docs/reference/file-based-agents/workspace.md +0 -2
  74. package/.docs/reference/memory/observational-memory.md +2 -2
  75. package/.docs/reference/observability/tracing/interfaces.md +62 -2
  76. package/.docs/reference/observability/tracing/trace-query.md +113 -2
  77. package/.docs/reference/schedules/overview.md +3 -5
  78. package/.docs/reference/server/elysia-adapter.md +18 -0
  79. package/.docs/reference/signals/create-notification-inbox-tool.md +0 -2
  80. package/.docs/reference/signals/signal-provider.md +1 -3
  81. package/.docs/reference/signals/task-signal-provider.md +1 -1
  82. package/.docs/reference/signals/webhook-signal-provider.md +1 -3
  83. package/.docs/reference/streaming/ChunkType.md +2 -0
  84. package/.docs/reference/tools/create-code-mode.md +0 -2
  85. package/.docs/reference/tools/mcp-client.md +17 -0
  86. package/package.json +5 -5
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Memory
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A file-based agent gets [memory](https://mastra.ai/docs/memory/overview) from a `memory.ts` file that default-exports a [`Memory`](https://mastra.ai/reference/memory/memory-class) instance. Use this page for the file-based convention; use the memory docs for message history, semantic recall, storage, and processors.
10
8
 
11
9
  Without `memory.ts` or `config.memory`, the agent has no memory by default. Each `generate()` or `stream()` call starts without remembered conversation state unless you pass the prior context yourself.
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Observability
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  Mastra configures [observability](https://mastra.ai/docs/observability/overview) from an `observability.ts` file directly under `src/mastra/`. The file default-exports an `Observability` instance that sets up tracing, logging, metrics, and feedback for the project.
10
8
 
11
9
  Use this page for the file-based convention. For the signal model, exporters, storage, and multi-config setup, see the [observability overview](https://mastra.ai/docs/observability/overview) and [observability configuration](https://mastra.ai/docs/observability/overview).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Processors
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A file-based agent discovers [processors](https://mastra.ai/docs/agents/processors) from its `processors/` directory. Use this page for the file-based convention; use the processors guide for built-in processors, custom processors, streaming behavior, and advanced patterns.
10
8
 
11
9
  Files under `processors/input/` run before messages reach the model. Files under `processors/output/` run after the model responds. Each file default-exports one [`Processor`](https://mastra.ai/reference/processors/processor-interface), and the filename becomes its discovery key.
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Schedules
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A file-based agent discovers **schedules** from its `schedules/` directory. Each file declares one recurring task: a cron expression plus what the agent should do when it fires. Mastra registers them into schedule storage at startup. A scheduled agent needs no runtime registration code.
10
8
 
11
9
  Use this page for the file-based convention. To create schedules at runtime instead, see [Schedules](https://mastra.ai/reference/schedules/overview).
@@ -118,7 +116,7 @@ Frontmatter accepts every option below except `handler`, which needs a function
118
116
 
119
117
  ## Options
120
118
 
121
- **cron** (`string`): Standard five-field cron expression. Required. The scheduler evaluates schedules on a tick loop, so the effective granularity is one minute. Sub-minute fields are not supported.
119
+ **cron** (`string`): A 5-, 6-, or 7-part cron expression. Required.
122
120
 
123
121
  **prompt** (`string`): Message the agent runs on each fire. Set this or handler, not both.
124
122
 
@@ -144,7 +142,7 @@ Frontmatter accepts every option below except `handler`, which needs a function
144
142
 
145
143
  **ifIdle** (`ScheduleIfIdle`): What to do when the target thread is idle: wake, persist, or discard. Threaded schedules only.
146
144
 
147
- **status** (`'active' | 'paused'`): Status the row is created with. Applies on first create only, because the sync never patches status so that pausing through the API survives a redeploy. Changing this value in code later has no effect on an existing schedule. (Default: `'active'`)
145
+ **status** (`'active' | 'paused'`): Status the row is created with. Applies on first create, because a redeploy that leaves the cadence unchanged never patches status, so pausing through the API survives it. Changing this value in code later has no effect on an existing schedule. A cadence with no future occurrence is registered as completed, and a later cadence edit that can fire reactivates a completed row. (Default: `'active'`)
148
146
 
149
147
  **metadata** (`Record<string, unknown>`): Arbitrary JSON-safe data stored alongside the schedule row.
150
148
 
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Scorers
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A file-based agent discovers [scorers](https://mastra.ai/docs/evals/overview) from its `scorers/` directory. Use this page for the file-based convention; use the scorers guide for built-in scorers, custom scorers, and sampling.
10
8
 
11
9
  Each file under `scorers/` default-exports one scorer, and the filename becomes its key. The default export is either a [`MastraScorer`](https://mastra.ai/reference/evals/create-scorer) or a `{ scorer, sampling }` entry.
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Server
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  Mastra configures its HTTP [server](https://mastra.ai/docs/server/overview) from a `server.ts` file directly under `src/mastra/`. The server exposes agents, workflows, and other registered primitives as REST endpoints, and the file default-exports the same `ServerConfig` shape you'd pass to [`new Mastra()`](https://mastra.ai/reference/core/mastra-class).
10
8
 
11
9
  Use this page for the file-based convention. For server features, middleware, custom routes, generated API docs, and deployment behavior, see [Server overview](https://mastra.ai/docs/server/overview).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Skills
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A file-based agent discovers skills from its `skills/` directory and bundles them at build time. Skills are reusable procedures or reference material that the agent can load when relevant, instead of putting every detail into the always-on prompt.
10
8
 
11
9
  Use this page for the file-based convention. For code-defined skills, see [Agent skills](https://mastra.ai/docs/skills). For the `SKILL.md` package format, see [Workspace skills](https://mastra.ai/docs/sandbox/skills).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Storage
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  Mastra sets the project's default [storage](https://mastra.ai/docs/storage) from a `storage.ts` file directly under `src/mastra/`. The file default-exports a store, which replaces the built-in in-memory store used for memory, workflows, observability, and other storage domains.
10
8
 
11
9
  Use this page for the file-based convention. For backend choice, storage domains, retention, and provider details, see [storage overview](https://mastra.ai/docs/storage).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Studio
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  Mastra configures [Studio](https://mastra.ai/docs/studio/overview) from a `studio.ts` file directly under `src/mastra/`. The file default-exports a `StudioConfig` object for Studio authentication and authorization: who can access Studio, and what authenticated users can do.
10
8
 
11
9
  Use this page for the file-based convention. For auth providers, role-based access control (RBAC), and fine-grained authorization (FGA), see [Studio auth](https://mastra.ai/docs/studio/auth).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Subagents
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A file-based agent can declare **subagents**, specialist child agents it delegates to. The parent model sees each subagent as a delegation tool named after the subagent directory and calls that tool to hand off a task. The subagent's result returns to the parent conversation.
10
8
 
11
9
  Use this page for the file-based convention. For broader delegation patterns, hooks, memory isolation, tool approval propagation, and scoring, see [Supervisor agents](https://mastra.ai/docs/subagents).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Tools
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A file-based agent discovers tools from `.ts` and `.js` files directly under its `tools/` directory. Each discovered file is imported at build time, the file must default-export a [`createTool()`](https://mastra.ai/reference/tools/create-tool) result, and the filename without its extension becomes the tool key the model can call.
10
8
 
11
9
  Use this page for the file-based convention. For tool schemas, execution options, output shaping, and approval options, see the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Workflows
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  Mastra discovers project-level workflows from `.ts` and `.js` files under `src/mastra/workflows/`. This convention isn't scoped to one agent: every file with a default export becomes a registered workflow, and the filename becomes the workflow key.
10
8
 
11
9
  Use this page for the file-based convention. For steps, schemas, control flow, streaming, state, and workflow execution, see [Workflows overview](https://mastra.ai/docs/workflows/overview).
@@ -4,8 +4,6 @@
4
4
 
5
5
  # Workspace
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
-
9
7
  A [workspace](https://mastra.ai/docs/sandbox/overview) assembles capabilities such as filesystem access and command execution. The configured backends determine which tools are available. File-based agents get a default workspace automatically when discovered through `mastra dev` or `mastra build`. This default includes filesystem access and command execution, so agents can read and write files and run shell commands without extra configuration.
10
8
 
11
9
  Use this page for the file-based convention. For workspace providers, tools, search, lifecycle, and sandbox details, see [Sandbox](https://mastra.ai/docs/sandbox/overview).
@@ -95,7 +95,7 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
95
95
 
96
96
  **observation.activateOnProviderChange** (`boolean`): Force buffered observations to activate when the actor provider or model changes. If unset, the top-level activateOnProviderChange value is used for observations. Currently only applied when using the standalone ObservationalMemory class; new Memory(...) applies the top-level activateOnProviderChange only.
97
97
 
98
- **observation.blockAfter** (`number`): Safety net for when background buffering can't keep up. Values from 1 up to (but not including) 100 are multipliers of messageTokens: 1.2 resolves to 120% of the threshold (36k tokens with the default 30k). Values of 100 or more are absolute token counts and must be greater than messageTokens. Above this point, activation uses the smallest set of buffered chunks that reaches the retention target, even when that overshoots the target by more than the usual safeguard allows. It never activates more chunks than are needed to reach the retention target, so it removes only slightly more history than a normal activation. It changes the result only when the retention floor is above roughly 20,000 tokens; with the default bufferActivation (a 6k floor) it has no observable effect. Activation usually keeps a minimum remaining context (the smaller of 1000 tokens or the retention floor), but a single buffered chunk that covers the whole pending window still activates and can leave less. Crossing blockAfter does not trigger a blocking observation. A synchronous (blocking) observation runs when the messageTokens threshold is reached and buffered activation did not happen. Only relevant when bufferTokens is set. Defaults to 1.2 when async buffering is enabled.
98
+ **observation.blockAfter** (`number`): Safety net for when background buffering can't keep up. Values from 1 up to (but not including) 100 are multipliers of messageTokens: 1.2 resolves to 120% of the threshold (36k tokens with the default 30k). Values of 100 or more are absolute token counts and must be greater than messageTokens. Above this point, activation uses the smallest set of buffered chunks that reaches the retention target, even when that overshoots the target by more than the usual safeguard allows. It never activates more chunks than are needed to reach the retention target, so it removes only slightly more history than a normal activation. It changes the result only when the retention floor is above roughly 20,000 tokens; with the default bufferActivation (a 6k floor) it has no observable effect. Activation usually keeps a minimum remaining context (the smaller of 1000 tokens or the retention floor), but a single buffered chunk that covers the whole pending window still activates and can leave less. Crossing blockAfter does not trigger a blocking observation. A synchronous (blocking) observation runs when the messageTokens threshold is reached and activating buffered chunks doesn't bring pending tokens back under it, for example when a large tool result arrives after buffering has stopped. All remaining buffered chunks are activated first, so the synchronous observation only covers messages no chunk has observed. Only relevant when bufferTokens is set. Defaults to 1.2 when async buffering is enabled.
99
99
 
100
100
  **observation.previousObserverTokens** (`number | false`): Optional token budget for the observer's previous-observations context. When set to a number, the observations passed to the Observer agent are tail-truncated to fit within this budget while keeping the newest observations and preserving highlighted 🔴 items when possible. When a buffered reflection is pending, the already-reflected observation lines are automatically replaced with the reflection summary before truncation. Set to 0 to omit previous observations entirely, or false to disable truncation explicitly.
101
101
 
@@ -367,7 +367,7 @@ export const agent = new Agent({
367
367
 
368
368
  Async buffering is **enabled by default**. It pre-computes observations in the background as the conversation grows: when the `messageTokens` threshold is reached, buffered observations activate instantly with no blocking LLM call.
369
369
 
370
- The lifecycle follows **buffer → activate → remove messages → repeat**. Background Observer calls run at `bufferTokens` intervals and produce chunks of observations. At the threshold, activation moves observations into the log and removes raw messages from context. Above `blockAfter`, activation may overshoot the retention target instead of activating fewer chunks. A synchronous observation runs if the threshold is reached without activating a buffered chunk.
370
+ The lifecycle follows **buffer → activate → remove messages → repeat**. Background Observer calls run at `bufferTokens` intervals and produce chunks of observations. At the threshold, activation moves observations into the log and removes raw messages from context. Above `blockAfter`, activation may overshoot the retention target instead of activating fewer chunks. A synchronous observation runs if pending tokens are still at or above the threshold after all buffered chunks have been activated.
371
371
 
372
372
  Default settings:
373
373
 
@@ -557,8 +557,8 @@ interface ModelGenerationAttributes {
557
557
  /**
558
558
  * Definitions of the tools made available to the model for this generation
559
559
  * (name, description, and JSON-schema parameters), captured once per
560
- * generation. Per-step tool names live on MODEL_INFERENCE spans as
561
- * `availableTools`.
560
+ * generation. The definitions sent on each provider call live on
561
+ * MODEL_INFERENCE spans as `tools`.
562
562
  */
563
563
  tools?: ModelToolDefinition[]
564
564
 
@@ -639,6 +639,66 @@ interface ModelStepAttributes {
639
639
  }
640
640
  ```
641
641
 
642
+ ### `ModelInferenceAttributes`
643
+
644
+ Model Inference attributes - for a single call to the model provider within a step. The span covers only the provider call, so it doesn't include processors or tool executions.
645
+
646
+ ```typescript
647
+ interface ModelInferenceAttributes {
648
+ /** Model name (e.g., 'gpt-5.4', 'claude-opus-4-6') */
649
+ model?: string
650
+
651
+ /** Model provider (e.g., 'openai', 'anthropic') */
652
+ provider?: string
653
+
654
+ /** Index of the parent step in the generation (0, 1, 2, ...) */
655
+ stepIndex?: number
656
+
657
+ /** Token usage statistics */
658
+ usage?: UsageStats
659
+
660
+ /** Reason this inference finished (stop, tool-calls, length, etc.) */
661
+ finishReason?: string
662
+
663
+ /** Whether this was a streaming response */
664
+ streaming?: boolean
665
+
666
+ /** When the first token/chunk of the completion was received */
667
+ completionStartTime?: Date
668
+
669
+ /** Result warnings */
670
+ warnings?: Record<string, any>
671
+
672
+ /** Actual model used in the response (may differ from request model) */
673
+ responseModel?: string
674
+
675
+ /** Unique identifier for the response */
676
+ responseId?: string
677
+
678
+ /** Model parameters sent on the request (temperature, maxOutputTokens, topP, etc.) */
679
+ parameters?: Record<string, unknown>
680
+
681
+ /** Provider-specific options forwarded on the request */
682
+ providerOptions?: Record<string, unknown>
683
+
684
+ /** Names of tools made available to the model on this inference call */
685
+ availableTools?: string[]
686
+
687
+ /**
688
+ * Definitions of the tools sent to the provider on this inference call
689
+ * (name, description, and JSON-schema parameters), after per-step changes
690
+ * from processors, `prepareStep`, `activeTools`, and `toolChoice`.
691
+ */
692
+ tools?: ModelToolDefinition[]
693
+
694
+ /** How the model was instructed to choose tools */
695
+ toolChoice?: 'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }
696
+
697
+ /** Requested response format */
698
+ responseFormat?: 'text' | 'json' | 'json_schema' | { type: string; name?: string }
699
+ }
700
+ ```
701
+
642
702
  ### `ModelChunkAttributes`
643
703
 
644
704
  Model Chunk attributes - for individual streaming chunks/events.
@@ -6,10 +6,121 @@
6
6
 
7
7
  Use `queryTraces()` or `POST /api/observability/traces/query` to find completed logical traces that match trace fields and related span, score, or feedback records. Use `queryTraceThreads()` or `POST /api/observability/threads/query` to find thread identities that qualify across multiple eligible traces.
8
8
 
9
- Both endpoints use the same authentication as other observability routes and require the `observability:read` permission. The configured observability store must support the requested trace-query or thread-query operation.
9
+ Use `querySpans()` or `POST /api/observability/spans/query` to list the individual completed spans that match a span predicate.
10
+
11
+ All three endpoints use the same authentication as other observability routes and require the `observability:read` permission. The configured observability store must support the requested trace-query, thread-query, or span-query operation.
10
12
 
11
13
  > **Thread grouping is deprecated:** The `group` option remains supported until the next major release. Use [`queryTraceThreads()`](https://mastra.ai/reference/client-js/observability) to retrieve matching thread identities in new code.
12
14
 
15
+ ## Query individual spans
16
+
17
+ `querySpans()` returns one row per matching completed span across traces, including matching child spans. Use it to list the spans themselves, for example every failed tool call in the last day.
18
+
19
+ `queryTraces()` with a `spans.some` predicate answers a different question. It returns the traces that contain at least one matching span, and it doesn't identify which spans matched. Both use the same span fields and operators.
20
+
21
+ ```typescript
22
+ const timeRange = {
23
+ from: '2026-10-01T00:00:00.000Z',
24
+ to: '2026-10-02T00:00:00.000Z',
25
+ }
26
+ const where = {
27
+ op: 'and',
28
+ args: [
29
+ { op: 'eq', left: { path: 'spanType' }, right: { literal: 'tool_call' } },
30
+ { op: 'eq', left: { path: 'status' }, right: { literal: 'error' } },
31
+ ],
32
+ } as const
33
+
34
+ const firstPage = await mastraClient.querySpans({
35
+ timeRange,
36
+ where,
37
+ orderBy: [{ field: 'startedAt', direction: 'desc' }],
38
+ page: { limit: 50 },
39
+ })
40
+
41
+ if (firstPage.page.next) {
42
+ const secondPage = await mastraClient.querySpans({
43
+ timeRange,
44
+ where,
45
+ orderBy: [{ field: 'startedAt', direction: 'desc' }],
46
+ page: { limit: 50, after: firstPage.page.next },
47
+ })
48
+ }
49
+ ```
50
+
51
+ The HTTP route accepts the same body:
52
+
53
+ ```bash
54
+ curl --request POST \
55
+ --url http://localhost:4111/api/observability/spans/query \
56
+ --header 'Authorization: Bearer <token>' \
57
+ --header 'Content-Type: application/json' \
58
+ --data '{
59
+ "timeRange": {
60
+ "from": "2026-10-01T00:00:00.000Z",
61
+ "to": "2026-10-02T00:00:00.000Z"
62
+ },
63
+ "where": { "op": "eq", "left": { "path": "spanType" }, "right": { "literal": "tool_call" } },
64
+ "page": { "limit": 50 }
65
+ }'
66
+ ```
67
+
68
+ Span queries are optional for observability stores. Call `mastraClient.getObservabilityCapabilities()` and check `capabilities.spanQuery` before showing a span list. Treat a missing `spanQuery` value as unsupported, because older servers don't report it. A server whose store or `@mastra/core` version doesn't support span queries returns `501` with code `SPAN_QUERY_UNSUPPORTED`.
69
+
70
+ The other statuses match trace queries: `400` for malformed JSON or a malformed cursor, `409` for a cursor that doesn't match the query, `413` for a body over 256 KiB, `422` with code `TRACE_QUERY_INVALID` and structured `issues` for an invalid query, `503` with code `TRACE_QUERY_RESOURCE_LIMIT` when a page exceeds a resource limit, and `504` with code `TRACE_QUERY_EXECUTION_TIMEOUT` when the database deadline is exceeded.
71
+
72
+ The server applies [trusted tenant scope](#trusted-tenant-scope) to span queries the same way it does for trace queries. A cursor created under one scope and reused under another returns `409`.
73
+
74
+ ### Query individual spans through storage
75
+
76
+ The observability domain in DuckDB and the PostgreSQL and ClickHouse v-next stores supports `querySpans(plan)`. Check `storage.getFeatures()?.includes('span-query')` before using this optional storage method.
77
+
78
+ Build the plan in trusted backend code:
79
+
80
+ ```typescript
81
+ import { planSpanQuery } from '@mastra/core/storage'
82
+
83
+ const storage = await mastra.getStorage()?.getStore('observability')
84
+ if (!storage?.getFeatures()?.includes('span-query')) {
85
+ throw new Error('This store does not support span queries')
86
+ }
87
+
88
+ const plan = planSpanQuery({
89
+ timeRange: {
90
+ from: '2026-10-01T00:00:00.000Z',
91
+ to: '2026-10-02T00:00:00.000Z',
92
+ },
93
+ where: {
94
+ op: 'eq',
95
+ left: { path: 'spanType' },
96
+ right: { literal: 'tool_call' },
97
+ },
98
+ page: { limit: 50 },
99
+ })
100
+
101
+ const { spans, page } = await storage.querySpans(plan)
102
+ ```
103
+
104
+ This example uses local, unscoped storage. For a shared database, pass `{ scope: { organizationId, resourceId } }` as the second argument to `planSpanQuery()`, using identifiers resolved by your backend's authorization. The request body can't supply trusted scope. Apply the same authorization when loading full span details with `getSpan({ traceId, spanId })`.
105
+
106
+ Span queries use the scalar fields and operators available inside `queryTraces()`'s `spans.some` predicate. They don't accept related-record clauses. Nested attributes require support in the shared predicate contract and each store.
107
+
108
+ The `timeRange` applies to each span's `startedAt`, includes `from`, excludes `to`, and can cover at most 31 days. Sort by `startedAt` or `endedAt`, in either direction. The default is `startedAt` descending. A page contains up to 1,000 rows, with a default of 100. Pass `page.next` back as `page.after` with the same filters, time range, scope, and ordering. Cursors use scope and span identifiers to break timestamp ties. They aren't a snapshot across requests. New completions can appear when the view is refreshed.
109
+
110
+ Each row contains span and trace identifiers, display fields, duration, status, and input/output previews of at most 256 Unicode characters. Truncation flags indicate when a preview is incomplete. Stores select the page before loading previews and cost. Full payloads remain available through the existing span detail method.
111
+
112
+ The `cost` field describes only that span's model-token cost:
113
+
114
+ - `available` includes `amount` and `currency`. Zero is a valid amount.
115
+ - `missing` means no matching model metrics were found.
116
+ - `unavailable` means metrics exist but a complete, unambiguous cost can't be established.
117
+
118
+ Directional token totals supply the cost. Overlapping detail metrics aren't added again. A provider-supplied `query_total` cost is counted once. Partial pricing, conflicting currencies, and ambiguous totals produce `unavailable`.
119
+
120
+ Current-record selection runs before mutable filters. PostgreSQL and ClickHouse select the greatest completed `endedAt`. PostgreSQL breaks ties with its ingestion cursor. DuckDB reconstructs the earliest start event and selects the latest ingested completed event, matching its existing span-predicate behavior. Time bounds are checked again after reconstruction. ClickHouse uses its existing completion-only, insert-only model, where equal-version retries must contain identical records. Querying spans doesn't add a table or materialized view.
121
+
122
+ Queries have a 15-second default execution deadline. PostgreSQL and ClickHouse use their existing `traceQuery.timeoutMs` setting. ClickHouse also caps each query at 512 MiB. A page with more than 50,000 matching model metrics fails with a resource-limit error instead of returning partial cost. A small page size limits returned rows, but doesn't limit the number of records the database must examine.
123
+
13
124
  ## Query traces with the client SDK
14
125
 
15
126
  Pass the query to `queryTraces()`:
@@ -718,7 +829,7 @@ PostgreSQL and ClickHouse stop advanced trace and thread queries after 15 second
718
829
 
719
830
  ## Limitations
720
831
 
721
- Both operations consider completed traces only. They don't support running traces, custom projections, embedded evidence, summaries, aggregations, measures, or custom grouping. Numbered trace pages include a total count.
832
+ Trace and thread queries consider completed traces only, and span queries consider completed spans only. They don't support running traces, custom projections, embedded evidence, summaries, aggregations, measures, or custom grouping. Numbered trace pages include a total count.
722
833
 
723
834
  ## Related
724
835
 
@@ -6,8 +6,6 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.50.0`
8
8
 
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
10
-
11
9
  `mastra.schedules` is the CRUD service for persisted cron schedules. Use it to create, list, update, pause, resume, manually run, and delete schedules for agents or workflows.
12
10
 
13
11
  For usage patterns and concepts, see [Schedules](https://mastra.ai/docs/harness/schedules).
@@ -139,13 +137,13 @@ const schedules = await mastra.schedules.list({
139
137
 
140
138
  **filter.name** (`string`): Return only agent schedules with this label.
141
139
 
142
- **filter.status** (`'active' | 'paused'`): Return only schedules with this status.
140
+ **filter.status** (`'active' | 'paused' | 'completed'`): Return only schedules with this status. The default listing omits completed schedules.
143
141
 
144
142
  ### Update schedules
145
143
 
146
144
  #### `update(id, patch)`
147
145
 
148
- Updates a schedule. Changing `cron` or `timezone` recomputes the next fire time. Updating `status` from `paused` to `active` also recomputes the next fire time.
146
+ Updates a schedule. Changing `cron` or `timezone` recomputes the next fire time. Updating `status` from `paused` to `active` also recomputes the next fire time. A schedule becomes `completed` once its cron has no future occurrence. A cadence edit that leaves no future occurrence completes the row even when it was `paused`. Editing the cadence of a completed schedule reactivates it when the new cadence can still fire, and leaves it completed when it can't.
149
147
 
150
148
  ```typescript
151
149
  const updated = await mastra.schedules.update('pinger', {
@@ -170,7 +168,7 @@ const paused = await mastra.schedules.pause('pinger')
170
168
 
171
169
  #### `resume(id)`
172
170
 
173
- Resumes a paused schedule and recomputes the next fire time from the current time.
171
+ Resumes a paused schedule and recomputes the next fire time from the current time. A paused schedule whose cron has no future occurrence is completed instead of resumed.
174
172
 
175
173
  ```typescript
176
174
  const active = await mastra.schedules.resume('pinger')
@@ -130,6 +130,24 @@ app.get('/custom/public', async ctx => {
130
130
  })
131
131
  ```
132
132
 
133
+ When the auth provider refreshes an expired session, `createAuthMiddleware()` forwards the refreshed session headers (such as `Set-Cookie`) to the response, including error responses. `MastraServer` registers the `applyAuthRefreshHeaders` hook during `init()`, so routes added after `init()` get these headers alongside any cookies your route sets.
134
+
135
+ If you use `createAuthMiddleware()` without `MastraServer`, register the hook yourself before defining routes:
136
+
137
+ ```typescript
138
+ import { Elysia } from 'elysia'
139
+ import { applyAuthRefreshHeaders, createAuthMiddleware } from '@mastra/elysia'
140
+ import { mastra } from './mastra'
141
+
142
+ const app = new Elysia()
143
+ .onAfterHandle({ as: 'global' }, applyAuthRefreshHeaders)
144
+ .onError({ as: 'global' }, applyAuthRefreshHeaders)
145
+
146
+ app.get('/custom/protected', () => ({ ok: true }), {
147
+ beforeHandle: createAuthMiddleware({ mastra }),
148
+ })
149
+ ```
150
+
133
151
  ## Accessing context
134
152
 
135
153
  In Elysia handlers registered after `init()`, access Mastra context from the handler context:
@@ -6,8 +6,6 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.39.0`
8
8
 
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
10
-
11
9
  `createNotificationInboxTool()` creates a Mastra tool that lets an agent inspect and manage notification inbox records for the current thread.
12
10
 
13
11
  Use this tool with durable notification signals. For sending notification records, see [`Agent.sendNotificationSignal()`](https://mastra.ai/reference/agents/agent).
@@ -4,9 +4,7 @@
4
4
 
5
5
  # SignalProvider
6
6
 
7
- **Added in:** `@mastra/core@1.39.0`
8
-
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
7
+ **Added in:** `@mastra/core@1.42.0`
10
8
 
11
9
  Abstract base class for building signal providers. A signal provider monitors external sources (APIs, webhooks, event streams) and pushes notification signals into agent threads through a built-in subscription registry.
12
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # TaskSignalProvider
6
6
 
7
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
7
+ **Added in:** `@mastra/core@1.42.0`
8
8
 
9
9
  Bundles the built-in task tools (`task_write`, `task_update`, `task_complete`, `task_check`) and the `TaskStateProcessor` behind a single agent registration. Use it to add a structured, durable task list to an agent without wiring the tools and processor separately.
10
10
 
@@ -4,9 +4,7 @@
4
4
 
5
5
  # WebhookSignalProvider
6
6
 
7
- **Added in:** `@mastra/core@1.39.0`
8
-
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
7
+ **Added in:** `@mastra/core@1.42.0`
10
8
 
11
9
  Concrete signal provider for push-based event delivery. Routes incoming webhook payloads to subscribed agent threads by matching the payload against a configurable resource ID extractor.
12
10
 
@@ -14,6 +14,8 @@ All chunks include these base properties:
14
14
 
15
15
  **runId** (`string`): Unique identifier for this execution run
16
16
 
17
+ **traceId** (`string`): Trace ID of the run that produced this chunk, when tracing is enabled. Not set on custom data-\* chunks.
18
+
17
19
  **from** (`ChunkFrom`): Source of the chunk
18
20
 
19
21
  **from.AGENT** (`'AGENT'`): Chunk from agent execution
@@ -6,8 +6,6 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.38.0`
8
8
 
9
- > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
10
-
11
9
  The `createCodeMode()` function returns a tool and generated instructions that let an agent run multi-tool computations as one TypeScript function. The generated code runs in a workspace sandbox, and each `external_*` call runs the real tool on the host with validation, request context, and tracing.
12
10
 
13
11
  For a conceptual overview, see [Code mode](https://mastra.ai/docs/agents/code-mode).
@@ -367,6 +367,23 @@ const instructionsByServer = mcp.getServerInstructions()
367
367
  console.log(instructionsByServer.db)
368
368
  ```
369
369
 
370
+ ### `getServerInfo()`
371
+
372
+ Returns the identity each configured MCP server announced when it connected (its `serverInfo`, from the `server/discover` result or, for servers on an older revision, the `initialize` handshake): `name` and `version`, plus `title`, `description`, `websiteUrl`, and `icons` when the server provides them. A server's entry is `undefined` if it hasn't connected yet, or if it connected over the `2026-07-28` revision without announcing an identity, which that revision allows. Don't use it to check whether a server is connected. The values come from the remote server and aren't validated, so treat icon and website URLs as untrusted.
373
+
374
+ ```typescript
375
+ getServerInfo(): Record<string, MCPServerImplementation | undefined>
376
+ ```
377
+
378
+ Example:
379
+
380
+ ```typescript
381
+ await mcp.listTools()
382
+
383
+ const info = mcp.getServerInfo()
384
+ console.log(info.myServer?.title, info.myServer?.version)
385
+ ```
386
+
370
387
  ### `authenticate()`
371
388
 
372
389
  Runs the interactive OAuth authorization-code flow for a server whose `MCPOAuthClientProvider` uses a loopback redirect URL. A local callback server passes the authorization URL to the provider's `onRedirectToAuthorization` callback and waits for the browser to return the code. It then exchanges the code for tokens and reconnects. See [Interactive browser authentication](#interactive-browser-authentication).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.5-alpha.1",
3
+ "version": "1.3.5-alpha.11",
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/core": "1.75.0-alpha.0",
30
- "@mastra/mcp": "^2.1.2"
29
+ "@mastra/core": "1.75.0-alpha.4",
30
+ "@mastra/mcp": "^2.2.0-alpha.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hono/node-server": "^2.0.0",
@@ -44,8 +44,8 @@
44
44
  "typescript": "^7.0.2",
45
45
  "vitest": "4.1.11",
46
46
  "@internal/lint": "0.0.140",
47
- "@mastra/core": "1.75.0-alpha.0",
48
- "@internal/types-builder": "0.0.115"
47
+ "@internal/types-builder": "0.0.115",
48
+ "@mastra/core": "1.75.0-alpha.4"
49
49
  },
50
50
  "homepage": "https://mastra.ai",
51
51
  "repository": {