@mastra/mcp-docs-server 1.3.5-alpha.9 → 1.3.5

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 (97) hide show
  1. package/.docs/docs/agents/code-mode.md +0 -2
  2. package/.docs/docs/agents/overview.md +1 -1
  3. package/.docs/docs/agents/processors.md +8 -0
  4. package/.docs/docs/agents/tools.md +17 -0
  5. package/.docs/docs/auth/composite-auth.md +1 -1
  6. package/.docs/docs/auth/custom-auth-provider.md +28 -22
  7. package/.docs/docs/auth/jwt.md +1 -1
  8. package/.docs/docs/auth/overview.md +2 -2
  9. package/.docs/docs/auth/simple-auth.md +6 -1
  10. package/.docs/docs/browser.md +1 -2
  11. package/.docs/docs/deployment/overview.md +1 -1
  12. package/.docs/docs/deployment/web-framework.md +1 -1
  13. package/.docs/docs/develop.md +1 -3
  14. package/.docs/docs/evals/built-in-scorers.md +2 -2
  15. package/.docs/docs/guides/context-engineering.md +0 -2
  16. package/.docs/docs/guides/overview.md +15 -0
  17. package/.docs/docs/harness/agent-controller.md +7 -12
  18. package/.docs/docs/harness/goals.md +1 -3
  19. package/.docs/docs/harness/schedules.md +0 -2
  20. package/.docs/docs/harness/signal-providers.md +1 -3
  21. package/.docs/docs/harness/signals.md +0 -2
  22. package/.docs/docs/mastra-platform/configuration.md +1 -1
  23. package/.docs/docs/mastra-platform/environments.md +1 -1
  24. package/.docs/docs/mastra-platform/observability.md +1 -1
  25. package/.docs/docs/memory/observational-memory.md +2 -0
  26. package/.docs/docs/observability/overview.md +0 -5
  27. package/.docs/docs/sandbox/filesystem.md +12 -12
  28. package/.docs/docs/studio/observability.md +1 -1
  29. package/.docs/docs/workflows/error-handling.md +2 -0
  30. package/.docs/integrations/voice/livekit.md +449 -2
  31. package/.docs/models/gateways/netlify.md +1 -1
  32. package/.docs/models/gateways/openrouter.md +3 -4
  33. package/.docs/models/gateways/vercel.md +9 -3
  34. package/.docs/models/index.md +1 -1
  35. package/.docs/models/providers/aki-io.md +12 -12
  36. package/.docs/models/providers/edenai.md +15 -12
  37. package/.docs/models/providers/kilo.md +11 -13
  38. package/.docs/models/providers/llmgateway-providers.md +5 -2
  39. package/.docs/models/providers/llmgateway.md +2 -2
  40. package/.docs/models/providers/mistral.md +7 -6
  41. package/.docs/models/providers/nano-gpt.md +12 -3
  42. package/.docs/models/providers/opencode-go.md +2 -2
  43. package/.docs/models/providers/opencode.md +3 -1
  44. package/.docs/models/providers/requesty.md +3 -1
  45. package/.docs/models/providers/the-grid-ai.md +19 -12
  46. package/.docs/models/providers/wandb.md +4 -13
  47. package/.docs/reference/agent-controller/agent-controller-class.md +2 -4
  48. package/.docs/reference/agent-controller/session.md +18 -13
  49. package/.docs/reference/agents/createSkill.md +1 -2
  50. package/.docs/reference/agents/generate.md +2 -0
  51. package/.docs/reference/agents/getModel.md +1 -1
  52. package/.docs/reference/agents/getSkill.md +6 -1
  53. package/.docs/reference/agents/listSkills.md +0 -1
  54. package/.docs/reference/auth/jwt.md +1 -1
  55. package/.docs/reference/auth/supabase.md +1 -1
  56. package/.docs/reference/browser/mastra-browser.md +13 -11
  57. package/.docs/reference/cli/create-mastra.md +1 -1
  58. package/.docs/reference/cli/mastra.md +43 -5
  59. package/.docs/reference/client-js/agent-controller.md +19 -3
  60. package/.docs/reference/client-js/agents.md +1 -1
  61. package/.docs/reference/client-js/conversations.md +1 -1
  62. package/.docs/reference/client-js/mastra-client.md +2 -2
  63. package/.docs/reference/client-js/observability.md +28 -0
  64. package/.docs/reference/client-js/workflows.md +18 -2
  65. package/.docs/reference/code-sdk/mount-agent-controller.md +1 -3
  66. package/.docs/reference/editor/prompt-blocks.md +41 -0
  67. package/.docs/reference/editor/tool-provider.md +19 -0
  68. package/.docs/reference/file-based-agents/config.md +0 -2
  69. package/.docs/reference/file-based-agents/instructions.md +0 -2
  70. package/.docs/reference/file-based-agents/logger.md +0 -2
  71. package/.docs/reference/file-based-agents/memory.md +0 -2
  72. package/.docs/reference/file-based-agents/observability.md +0 -2
  73. package/.docs/reference/file-based-agents/processors.md +0 -2
  74. package/.docs/reference/file-based-agents/schedules.md +0 -2
  75. package/.docs/reference/file-based-agents/scorers.md +0 -2
  76. package/.docs/reference/file-based-agents/server.md +0 -2
  77. package/.docs/reference/file-based-agents/skills.md +0 -2
  78. package/.docs/reference/file-based-agents/storage.md +0 -2
  79. package/.docs/reference/file-based-agents/studio.md +0 -2
  80. package/.docs/reference/file-based-agents/subagents.md +0 -2
  81. package/.docs/reference/file-based-agents/tools.md +0 -2
  82. package/.docs/reference/file-based-agents/workflows.md +0 -2
  83. package/.docs/reference/file-based-agents/workspace.md +0 -2
  84. package/.docs/reference/memory/observational-memory.md +2 -0
  85. package/.docs/reference/observability/tracing/interfaces.md +62 -2
  86. package/.docs/reference/observability/tracing/trace-query.md +65 -4
  87. package/.docs/reference/schedules/overview.md +0 -2
  88. package/.docs/reference/signals/create-notification-inbox-tool.md +0 -2
  89. package/.docs/reference/signals/signal-provider.md +1 -3
  90. package/.docs/reference/signals/task-signal-provider.md +1 -1
  91. package/.docs/reference/signals/webhook-signal-provider.md +1 -3
  92. package/.docs/reference/streaming/ChunkType.md +2 -0
  93. package/.docs/reference/tools/create-code-mode.md +0 -2
  94. package/.docs/reference/tools/create-tool.md +2 -0
  95. package/.docs/reference/tools/mcp-server.md +8 -2
  96. package/.docs/reference/vectors/lance.md +56 -10
  97. package/package.json +6 -6
@@ -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).
@@ -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).
@@ -592,6 +592,8 @@ Emitted when observation or reflection fails. The system falls back to synchrono
592
592
 
593
593
  **error** (`string`): Error message.
594
594
 
595
+ **retrying** (`true`): Set when a reflection attempt did not compress below its target and OM is retrying at a higher compression level. A new start marker follows, so this failure is not final. Absent on final failures.
596
+
595
597
  **observations** (`string`): Any partial content available for display.
596
598
 
597
599
  **recordId** (`string`): The OM record ID.
@@ -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,13 +6,74 @@
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
 
13
- ## Query individual spans through storage
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
14
75
 
15
- The observability domain in DuckDB and the PostgreSQL and ClickHouse v-next stores supports `querySpans(plan)`. It returns individual completed spans across traces, including matching child spans. Check `storage.getFeatures()?.includes('span-query')` before using this optional storage method. Server routes and client SDK support are separate from this storage API.
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.
16
77
 
17
78
  Build the plan in trusted backend code:
18
79
 
@@ -768,7 +829,7 @@ PostgreSQL and ClickHouse stop advanced trace and thread queries after 15 second
768
829
 
769
830
  ## Limitations
770
831
 
771
- 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.
772
833
 
773
834
  ## Related
774
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).
@@ -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).
@@ -49,6 +49,8 @@ The first `execute` parameter is the validated value from `inputSchema`. Destruc
49
49
 
50
50
  **strict** (`boolean`): When true, Mastra enables strict tool input generation on model adapters that support it. This helps supported providers return arguments that match the tool schema more closely.
51
51
 
52
+ **outputValidation** (`'strict' | 'warn'`): How a result that fails outputSchema validation is handled. Both modes log a warning. 'strict' replaces the result with a validation error object. 'warn' returns the tool's actual result unchanged, for tools whose side effects have already happened. (Default: `'strict'`)
53
+
52
54
  **toModelOutput** (`(output: TSchemaOut) => unknown`): Optional function that transforms the tool's execute output before it is sent back to the model. Use this to return text, json, or content-shaped outputs (including multimodal parts like images/files) to the model while still keeping the full raw output in your application code.
53
55
 
54
56
  **transform** (`ToolPayloadTransform`): Optional target-aware transform for tool payloads before they leave runtime for display streams or user-visible transcript messages. Configure display and transcript transforms for phases such as input, inputDelta, output, error, approval, suspend, and resume.
@@ -75,7 +75,13 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
75
75
 
76
76
  **workflows** (`Record<string, Workflow>`): An object where keys are workflow identifiers and values are Mastra Workflow instances. Each workflow is converted into a tool named run\_\<workflowKey>. The workflow's inputSchema becomes the tool's input schema. The workflow \*\*must\*\* have a non-empty description string property, which is used for the tool's description. If a workflow's description is missing or empty, an error will be thrown. The tool executes the workflow by calling workflow\.createRun() followed by run.start({ inputData: \<tool\_input> }). If a tool name derived from an agent or workflow (e.g., ask\_myAgent or run\_myWorkflow) collides with an explicitly defined tool name or another derived name, the explicitly defined tool takes precedence, and a warning is logged. Agents/workflows leading to subsequent collisions are skipped.
77
77
 
78
- **description** (`string`): Optional description of what the MCP server does.
78
+ **description** (`string`): Optional description of what the MCP server does. Announced to MCP clients as part of the server's identity and returned in the registry server info.
79
+
80
+ **title** (`string`): Optional human-readable display title announced to MCP clients (e.g., 'Weather Server'). Clients fall back to name when it isn't set.
81
+
82
+ **websiteUrl** (`string`): Optional URL of the server's website, announced to MCP clients.
83
+
84
+ **icons** (`{ src: string; mimeType?: string; sizes?: string[]; theme?: 'light' | 'dark' }[]`): Optional icons clients can display for the server. src is an https: URL or a data: URI; sizes takes values like '48x48' or 'any'.
79
85
 
80
86
  **instructions** (`string`): Optional instructions describing how to use the server and its features.
81
87
 
@@ -1389,7 +1395,7 @@ const server = new MCPServer({
1389
1395
  })
1390
1396
  ```
1391
1397
 
1392
- Link a tool to its app resource by setting `mcp._meta.ui.resourceUri` in `createTool()` to the matching `ui://` URI. The server normalizes this metadata for older hosts when listing tools. Visit [MCP Apps](https://mastra.ai/docs/connections/mcp) for the full app bridge API and usage patterns.
1398
+ Link a tool to its app resource by setting `mcp._meta.ui.resourceUri` in `createTool()` to the matching `ui://` URI. The server normalizes this metadata for older hosts when listing tools, and returns the same link on successful tool call results. Visit [MCP Apps](https://mastra.ai/docs/connections/mcp) for the full app bridge API and usage patterns.
1393
1399
 
1394
1400
  ## Related information
1395
1401
 
@@ -49,15 +49,17 @@ const s3Store = await LanceVectorStore.create('s3://bucket/db', {
49
49
 
50
50
  #### `LanceIndexConfig`
51
51
 
52
- **type** (`'ivfflat' | 'hnsw'`): Index type (Default: `hnsw`)
52
+ **type** (`'ivfflat' | 'ivfpq' | 'hnsw'`): Index type (Default: `hnsw`)
53
53
 
54
- **type.ivfflat** (`ivfflat`): Clusters vectors into lists for approximate search.
54
+ **type.ivfflat** (`ivfflat`): Clusters vectors into partitions and stores full vectors. Searches compute exact distances only within the probed partitions, so closer vectors in other partitions can be missed.
55
+
56
+ **type.ivfpq** (`ivfpq`): IVF index with product quantization. Uses less memory than ivfflat with lower recall.
55
57
 
56
58
  **type.hnsw** (`hnsw`): Graph-based index offering fast search times and high recall.
57
59
 
58
60
  **numPartitions** (`number`): Number of partitions for IVF indexes (Default: `128`)
59
61
 
60
- **numSubVectors** (`number`): Number of sub-vectors for product quantization (Default: `16`)
62
+ **numSubVectors** (`number`): Number of sub-vectors for product quantization. Only applies to ivfpq (Default: `16`)
61
63
 
62
64
  **hnsw** (`HNSWConfig`): HNSW configuration
63
65
 
@@ -137,16 +139,60 @@ interface IndexStats {
137
139
  dimension: number
138
140
  count: number
139
141
  metric: 'cosine' | 'euclidean' | 'dotproduct'
140
- type: 'ivfflat' | 'hnsw'
141
- config: {
142
- m?: number
143
- efConstruction?: number
144
- numPartitions?: number
145
- numSubVectors?: number
146
- }
147
142
  }
148
143
  ```
149
144
 
145
+ ### `getIndexCoverage()`
146
+
147
+ **tableName** (`string`): Table to inspect. Defaults to indexName when omitted.
148
+
149
+ **indexName** (`string`): Used as the table name when tableName is omitted, matching upsert() and query().
150
+
151
+ Returns one entry per index on the table:
152
+
153
+ ```typescript
154
+ interface LanceIndexCoverage {
155
+ indexName: string
156
+ indexType: string
157
+ columns: string[]
158
+ numIndexedRows: number
159
+ numUnindexedRows: number
160
+ }
161
+ ```
162
+
163
+ ### `optimize()`
164
+
165
+ Runs LanceDB table maintenance. It compacts data files, adds rows written since the index was built to the existing index, and removes old table versions. Mastra never calls it automatically. Concurrent calls for the same table in one process share a single run.
166
+
167
+ **tableName** (`string`): Table to optimize. Defaults to indexName when omitted.
168
+
169
+ **indexName** (`string`): Used as the table name when tableName is omitted.
170
+
171
+ **cleanupOlderThan** (`Date`): Remove table versions older than this date. When omitted, LanceDB keeps versions from the last 7 days.
172
+
173
+ **deleteUnverified** (`boolean`): Also delete unverified files newer than 7 days. Only set this when no other process writes to the table, or the table can be corrupted. (Default: `false`)
174
+
175
+ Returns LanceDB `OptimizeStats` (compaction and pruning counts).
176
+
177
+ #### When to optimize
178
+
179
+ `upsert()` writes rows outside the existing vector index. `query()` still returns those rows by scanning them without the index, so results stay complete, but queries get slower as unindexed rows grow. LanceDB's `fastSearch()` skips unindexed rows entirely.
180
+
181
+ `optimize()` adds new rows to the existing index without retraining it. If your data distribution has changed a lot, rebuild the index with `deleteIndex()` and `createIndex()` instead.
182
+
183
+ LanceDB suggests optimizing after roughly 100,000 modified rows or 20 write operations. Use `getIndexCoverage()` to build your own policy:
184
+
185
+ ```typescript
186
+ const [coverage] = await store.getIndexCoverage({ indexName: 'docs' })
187
+ const total = coverage.numIndexedRows + coverage.numUnindexedRows
188
+
189
+ if (coverage.numUnindexedRows >= 1_000 && coverage.numUnindexedRows / total >= 0.1) {
190
+ await store.optimize({ indexName: 'docs' })
191
+ }
192
+ ```
193
+
194
+ Managed LanceDB Cloud and Enterprise maintain tables automatically, so you don't need to call `optimize()` there.
195
+
150
196
  ### `deleteIndex()`
151
197
 
152
198
  **indexName** (`string`): Name of the index to delete
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.5-alpha.9",
3
+ "version": "1.3.5",
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/mcp": "^2.2.0-alpha.0",
30
- "@mastra/core": "1.75.0-alpha.3"
29
+ "@mastra/core": "1.75.0",
30
+ "@mastra/mcp": "^2.2.0"
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
- "@mastra/core": "1.75.0-alpha.3",
47
- "@internal/lint": "0.0.140",
48
- "@internal/types-builder": "0.0.115"
46
+ "@internal/lint": "0.0.141",
47
+ "@internal/types-builder": "0.0.116",
48
+ "@mastra/core": "1.75.0"
49
49
  },
50
50
  "homepage": "https://mastra.ai",
51
51
  "repository": {