@mastra/mcp-docs-server 1.3.9-alpha.10 → 1.3.9-alpha.13

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 (77) hide show
  1. package/.docs/docs/agents/processors.md +6 -4
  2. package/.docs/docs/auth/custom-auth-provider.md +1 -1
  3. package/.docs/docs/auth/overview.md +3 -1
  4. package/.docs/docs/connections/sdk-agents.md +18 -7
  5. package/.docs/docs/guides/mcp-authentication-authorization.md +2 -2
  6. package/.docs/docs/harness/agent-controller.md +11 -14
  7. package/.docs/docs/harness/durable-agents.md +3 -1
  8. package/.docs/docs/harness/schedules.md +8 -6
  9. package/.docs/docs/mastra-platform/environments.md +1 -1
  10. package/.docs/docs/mastra-platform/server.md +1 -1
  11. package/.docs/docs/mastra-platform/studio.md +1 -1
  12. package/.docs/docs/memory/semantic-recall.md +20 -0
  13. package/.docs/docs/studio/auth.md +2 -2
  14. package/.docs/docs/studio/observability.md +5 -1
  15. package/.docs/docs/workflows/error-handling.md +1 -1
  16. package/.docs/models/environment-variables.md +0 -1
  17. package/.docs/models/gateways/merge-gateway.md +6 -1
  18. package/.docs/models/index.md +1 -2
  19. package/.docs/models/providers/aixy.md +3 -1
  20. package/.docs/models/providers/alibaba-cn.md +7 -55
  21. package/.docs/models/providers/alibaba-coding-plan-cn.md +8 -12
  22. package/.docs/models/providers/alibaba-coding-plan.md +8 -12
  23. package/.docs/models/providers/alibaba-token-plan-cn.md +0 -2
  24. package/.docs/models/providers/alibaba-token-plan.md +29 -30
  25. package/.docs/models/providers/alibaba.md +32 -61
  26. package/.docs/models/providers/ambient.md +0 -8
  27. package/.docs/models/providers/anthropic.md +4 -2
  28. package/.docs/models/providers/cloudflare-workers-ai.md +1 -1
  29. package/.docs/models/providers/edenai.md +7 -1
  30. package/.docs/models/providers/empiriolabs.md +1 -3
  31. package/.docs/models/providers/google.md +2 -0
  32. package/.docs/models/providers/inception.md +2 -1
  33. package/.docs/models/providers/kilo.md +11 -25
  34. package/.docs/models/providers/llmgateway-providers.md +3 -1
  35. package/.docs/models/providers/llmgateway.md +3 -1
  36. package/.docs/models/providers/minimax-cn-coding-plan.md +4 -11
  37. package/.docs/models/providers/minimax-cn.md +4 -10
  38. package/.docs/models/providers/minimax-coding-plan.md +4 -11
  39. package/.docs/models/providers/minimax.md +4 -10
  40. package/.docs/models/providers/mistral.md +4 -4
  41. package/.docs/models/providers/moonshotai-cn.md +2 -2
  42. package/.docs/models/providers/nano-gpt.md +12 -16
  43. package/.docs/models/providers/openai.md +3 -1
  44. package/.docs/models/providers/runinfra.md +2 -1
  45. package/.docs/models/providers/xai.md +3 -1
  46. package/.docs/models/providers/zai-coding-plan.md +0 -4
  47. package/.docs/models/providers/zhipuai-coding-plan.md +0 -1
  48. package/.docs/models/providers/zhipuai.md +12 -12
  49. package/.docs/models/providers.md +0 -1
  50. package/.docs/reference/agent-controller/agent-controller-class.md +17 -22
  51. package/.docs/reference/agent-controller/session.md +3 -3
  52. package/.docs/reference/agents/channels.md +7 -1
  53. package/.docs/reference/agents/durable-agent.md +9 -7
  54. package/.docs/reference/agents/getSkill.md +1 -1
  55. package/.docs/reference/agents/listSkills.md +1 -4
  56. package/.docs/reference/browser/mastra-browser.md +1 -1
  57. package/.docs/reference/client-js/agent-controller.md +13 -3
  58. package/.docs/reference/client-js/mastra-client.md +1 -1
  59. package/.docs/reference/client-js/observability.md +3 -3
  60. package/.docs/reference/core/mastra-class.md +2 -2
  61. package/.docs/reference/editor/mastra-editor.md +9 -7
  62. package/.docs/reference/editor/tool-provider.md +2 -2
  63. package/.docs/reference/evals/create-classifier-scorer.md +6 -2
  64. package/.docs/reference/file-based-agents/instructions.md +1 -1
  65. package/.docs/reference/file-based-agents/processors.md +2 -0
  66. package/.docs/reference/file-based-agents/schedules.md +1 -1
  67. package/.docs/reference/file-based-agents/skills.md +1 -1
  68. package/.docs/reference/file-based-agents/subagents.md +1 -1
  69. package/.docs/reference/memory/cloneThread.md +1 -1
  70. package/.docs/reference/memory/copyThread.md +1 -1
  71. package/.docs/reference/memory/memory-class.md +2 -0
  72. package/.docs/reference/memory/serialized-memory-config.md +1 -1
  73. package/.docs/reference/observability/tracing/advanced-queries.md +40 -31
  74. package/.docs/reference/processors/processor-interface.md +10 -2
  75. package/.docs/reference/signals/signal-provider.md +2 -0
  76. package/.docs/reference/signals/task-signal-provider.md +1 -1
  77. package/package.json +3 -3
@@ -35,11 +35,8 @@ interface SkillMetadata {
35
35
  name: string
36
36
  description: string
37
37
  path: string
38
- references: string[]
39
- scripts: string[]
40
- assets: string[]
41
38
  license?: string
42
- compatibility?: string[]
39
+ compatibility?: unknown
43
40
  'user-invocable'?: boolean
44
41
  metadata?: Record<string, unknown>
45
42
  }
@@ -53,7 +53,7 @@ export const browserAgent = new Agent({
53
53
 
54
54
  **screencast.format** (`'jpeg' | 'png'`): Image format for screencast frames.
55
55
 
56
- **screencast.quality** (`number`): Image quality (1-100). Only applies to JPEG format.
56
+ **screencast.quality** (`number`): Image quality (0-100). Only applies to JPEG format.
57
57
 
58
58
  **screencast.maxWidth** (`number`): Maximum width for screencast frames.
59
59
 
@@ -81,11 +81,19 @@ Returns the controller's workspace status.
81
81
 
82
82
  Returns: `Promise<AgentControllerWorkspaceStatus>`
83
83
 
84
- ### `session(resourceId, scope?)`
84
+ ### `session(sessionId)`
85
85
 
86
- Returns an `AgentControllerSession` bound to one resource. Sessions are get-or-create on the server, so calling `create()` on the same `resourceId` and `scope` resumes the existing conversation instead of forking it.
86
+ Returns an `AgentControllerSession` addressed by its session id. Every request goes to `/agent-controller/:controllerId/sessions/:sessionId/...`. Sessions are get-or-create on the server, so calling `create()` with the same `sessionId` resumes the existing conversation instead of forking it.
87
87
 
88
- Pass `scope` to address an independent session over the same `resourceId`. Sessions that share a `resourceId` but use different scopes each get their own run loop, thread binding, mode, model, and state. A common pattern is one session per git worktree with the worktree path as the scope. The scope travels on every request as a `sessionScope` query parameter.
88
+ Sessions that share a resource but use different session ids each get their own run loop, thread binding, mode, model, and state. Their stored threads and resource-scoped memory belong to the shared resource. Pass the resource to `create()`:
89
+
90
+ ```typescript
91
+ const runA = client.getAgentController('code').session('run-a')
92
+ await runA.create({ resourceId: 'factory-1' })
93
+
94
+ const runB = client.getAgentController('code').session('run-b')
95
+ await runB.create({ resourceId: 'factory-1' })
96
+ ```
89
97
 
90
98
  ## Session methods
91
99
 
@@ -93,6 +101,8 @@ Pass `scope` to address an independent session over the same `resourceId`. Sessi
93
101
 
94
102
  Creates or resumes the session.
95
103
 
104
+ **resourceId** (`string`): Memory resource that owns the session's threads. Defaults to the session id, so a session created with only an id keeps one resource of its own.
105
+
96
106
  **tags** (`Record<string, string>`): Scopes initial thread selection. A thread is a resume candidate only when its metadata matches every tag.
97
107
 
98
108
  **threadId** (`string`): Binds the session to one exact thread, creating it with that ID when it does not exist.
@@ -61,7 +61,7 @@ You can also pass `requestContext` as a `Record<string, any>`.
61
61
 
62
62
  **listAgentControllers()** (`Promise<AgentControllerInfo[]>`): Returns the agent controllers hosted on the connected Mastra instance. Each entry's id is the key the controller is registered under in new Mastra({ agentControllers }).
63
63
 
64
- **getAgentController(controllerId)** (`AgentController`): Retrieves a specific agent controller by the key it is registered under in new Mastra({ agentControllers }), which can differ from the controller id. .session(resourceId) returns a session client; call await session.create() to create or resume the server session.
64
+ **getAgentController(controllerId)** (`AgentController`): Retrieves a specific agent controller by the key it is registered under in new Mastra({ agentControllers }), which can differ from the controller id. .session(sessionId) returns a session client; call await session.create() to create or resume the server session.
65
65
 
66
66
  **listMemoryThreads(params)** (`Promise<StorageThreadType[]>`): Retrieves memory threads for the specified resource and agent. Requires a resourceId and an agentId.
67
67
 
@@ -90,7 +90,7 @@ const result = await mastraClient.querySpans({
90
90
  console.log(result.spans)
91
91
  ```
92
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.
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`, `endedAt`, or `timeToFirstChunkMs`, ascending or descending, and defaults to descending start time. Spans without a `timeToFirstChunkMs` value sort last in both directions.
94
94
 
95
95
  | Fields | Operators |
96
96
  | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
@@ -98,14 +98,14 @@ Pages default to 100 rows and allow at most 1,000. The response is `{ spans, pag
98
98
  | `organizationId`, `resourceId`, `runId`, `sessionId`, `userId`, `requestId`, `serviceName`, `experimentId`, `environment`, `executionSource` | Same string operators |
99
99
  | Entity, parent entity and root entity `Type`, `Id`, `Name`, `VersionId` fields, such as `parentEntityId` | Same string operators |
100
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 |
101
+ | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | Comparisons, membership and presence |
102
102
  | `error` | `exists`, `notExists` |
103
103
 
104
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
105
 
106
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
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.
108
+ Check `capabilities.spanQueryContextFields` from `getObservabilityCapabilities()` before using the additional identity, context and parent/root entity filters. A missing or false value means these filters aren't available. With an older adapter, requests using these filters return a structured `422` error.
109
109
 
110
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
111
 
@@ -147,9 +147,9 @@ Re-drives every orphaned `running` durable-agent run across all registered durab
147
147
 
148
148
  Requires persistent storage. With an in-memory store, there's nothing to recover after a process restart.
149
149
 
150
- Agents and their runs are attempted serially. Each built-in `recoverActiveRuns()` attempt waits up to 30 seconds in total for `recover()` setup and settlement of the whole recovered workflow, then traversal can continue to later runs and agents. This isn't an overall recovery deadline: discovery and overridden custom recovery methods aren't bounded by this budget.
150
+ Recovery processes up to five agents concurrently, with up to five run waits per agent, independently of `recovery.workflowConcurrency`. Each built-in `recoverActiveRuns()` attempt waits up to 30 seconds in total for `recover()` setup and settlement of the whole recovered workflow, then frees its slot for another run. These limits bound waiting, not live executions. This isn't an overall recovery deadline: discovery and overridden custom recovery methods aren't bounded by this budget.
151
151
 
152
- A timed-out attempt continues in the background. Its outcome is `status: 'skipped'` with `reason: 'recovery-timeout'` and no `retryAt`. It contributes only to `skipped`, not `recovered`, `succeeded`, or `failed`, and Mastra doesn't automatically retry it. Late settlement doesn't change the returned counts.
152
+ A timed-out attempt continues in the background. Its outcome is `status: 'skipped'` with `reason: 'recovery-timeout'` and a future `retryAt`. It contributes only to `skipped`, not `recovered`, `succeeded`, or `failed`. Mastra schedules re-checks automatically. While the original attempt is pending, re-checks defer without starting another execution. After it settles, recovery checks the persisted snapshot and ownership before retrying; finished or suspended runs aren't restarted. Late settlement doesn't change the returned counts.
153
153
 
154
154
  When shutdown begins, recovery stops dispatching new agents and runs. The recovery traversal and original attempts, including timed-out setup or execution, participate in the same shared shutdown drain as active executions. A recovery wait timeout doesn't cancel the attempt or give it a separate shutdown drain window.
155
155
 
@@ -102,9 +102,9 @@ All namespaces extend a shared CRUD base class, so they expose the same `create`
102
102
 
103
103
  **agent.listResolved** (`(args?: StorageListAgentsInput) => Promise<StorageListAgentsResolvedOutput>`): Same as list, but returns fully resolved configurations with references dereferenced.
104
104
 
105
- **agent.applyStoredOverrides** (`(agent: Agent, options?: { versionId?: string; status?: "draft" | "published" }) => Promise<Agent>`): Mutate a code-defined agent in place to apply any stored overrides (instructions, tools, variables). Called internally by mastra.getAgent() — you rarely call it directly.
105
+ **agent.applyStoredOverrides** (`(agent: Agent, options?: { status?: "draft" | "published" } | { versionId: string }, requestContext?: RequestContext) => Promise<Agent>`): Apply any stored overrides (instructions and tools) to a code-defined agent. When overrides exist, it returns a fork with them applied and leaves the input agent unchanged, so use the returned Agent. Pass either a status or a specific versionId, not both. Called internally by mastra.getAgent() — you rarely call it directly.
106
106
 
107
- **agent.clone** (`(agent: Agent, options: { newId: string; newName?: string; metadata?: Record<string, unknown>; authorId?: string; requestContext?: RequestContext; }) => Promise<Agent>`): Create a new stored agent by cloning an existing agent.
107
+ **agent.clone** (`(agent: Agent, options: { newId: string; newName?: string; metadata?: Record<string, unknown>; authorId?: string; visibility?: "private" | "public"; requestContext?: RequestContext }) => Promise<StorageResolvedAgentType>`): Create a new stored agent by cloning an existing agent and return the resolved stored agent record.
108
108
 
109
109
  **agent.clearCache** (`(agentId?: string) => void`): Clear the in-memory cache for one agent or all agents. Called automatically after mutations.
110
110
 
@@ -160,17 +160,19 @@ All namespaces extend a shared CRUD base class, so they expose the same `create`
160
160
 
161
161
  **scorer** (`EditorScorerNamespace`): CRUD operations for scorer configurations.
162
162
 
163
- **scorer.create** (`(input: StorageCreateScorerInput) => Promise<MastraScorer>`): Create a new stored scorer and return a hydrated MastraScorer instance.
163
+ **scorer.create** (`(input: StorageCreateScorerDefinitionInput) => Promise<StorageResolvedScorerDefinitionType>`): Create a new stored scorer definition and return the resolved definition.
164
164
 
165
- **scorer.getById** (`(id: string, options?: GetByIdOptions) => Promise<MastraScorer | null>`): Return a hydrated scorer for a given id.
165
+ **scorer.getById** (`(id: string, options?: GetByIdOptions) => Promise<StorageResolvedScorerDefinitionType | null>`): Return the resolved scorer definition for a given id.
166
166
 
167
- **scorer.update** (`(input: StorageUpdateScorerInput) => Promise<MastraScorer>`): Partially update a stored scorer.
167
+ **scorer.update** (`(input: StorageUpdateScorerDefinitionInput) => Promise<StorageResolvedScorerDefinitionType>`): Partially update a stored scorer.
168
168
 
169
169
  **scorer.delete** (`(id: string) => Promise<void>`): Delete a stored scorer and remove it from the Mastra runtime registry.
170
170
 
171
- **scorer.list** (`(args?: StorageListScorersInput) => Promise<StorageListScorersOutput>`): List stored scorers with optional pagination and filters.
171
+ **scorer.list** (`(args?: StorageListScorerDefinitionsInput) => Promise<StorageListScorerDefinitionsOutput>`): List stored scorers with optional pagination and filters.
172
172
 
173
- **scorer.listResolved** (`(args?: StorageListScorersInput) => Promise<StorageListScorersResolvedOutput>`): Same as list, but returns fully resolved scorer configurations.
173
+ **scorer.listResolved** (`(args?: StorageListScorerDefinitionsInput) => Promise<StorageListScorerDefinitionsResolvedOutput>`): Same as list, but returns fully resolved scorer configurations.
174
+
175
+ **scorer.resolve** (`(storedScorer: StorageResolvedScorerDefinitionType) => MastraScorer | null`): Build a runnable MastraScorer from a resolved stored definition. Supports llm-judge definitions; returns null for preset types or when instructions or model configuration are missing.
174
176
 
175
177
  **scorer.clearCache** (`(id?: string) => void`): Clear the in-memory cache for one scorer or all scorers.
176
178
 
@@ -18,7 +18,7 @@ Providers expose metadata and the legacy discovery and resolution methods. Agent
18
18
 
19
19
  **capabilities** (`ToolProviderCapabilities`): Static connection and revocation capabilities. Required for VNext providers.
20
20
 
21
- **defaultScope** (`'per-author' | 'caller-supplied'`): Default connection identity scope. Defaults to 'per-author' when omitted.
21
+ **defaultScope** (`'per-author' | 'shared' | 'caller-supplied'`): Default connection identity scope. Defaults to 'per-author' when omitted.
22
22
 
23
23
  **listToolkits()** (`() => Promise<ToolProviderListResult<ToolProviderToolkit>>`): Lists available toolkits through the legacy interface.
24
24
 
@@ -77,7 +77,7 @@ const editor = new MastraEditor({
77
77
 
78
78
  **allowedTools** (`Readonly<Record<string, readonly string[]>>`): Per-toolkit tool slug allowlists. Supports exact matches and prefix wildcards.
79
79
 
80
- **defaultScope** (`'per-author' | 'caller-supplied'`): Connection identity scope. Defaults to per-author. (Default: `'per-author'`)
80
+ **defaultScope** (`'per-author' | 'shared' | 'caller-supplied'`): Connection identity scope. Defaults to per-author. (Default: `'per-author'`)
81
81
 
82
82
  **userIdResolver** (`ComposioUserIdResolver`): Server-side resolver that derives the effective Composio userId from authenticated context fields. Used for invoker and caller-supplied execution. The exact connected account always comes from the stored connection pin.
83
83
 
@@ -6,7 +6,9 @@
6
6
 
7
7
  `createClassifierScorer()` adapts one constructor-configured [`Classifier`](https://mastra.ai/reference/classifier/classifier) question to Mastra's scorer pipeline. It returns a normal `MastraScorer` with a numeric `score` and retains the selected answer, probabilities, usage, warnings, and safe response metadata in `analyzeStepResult`.
8
8
 
9
- The adapter evaluates exactly one question and always returns a score between 0 and 1. It doesn't aggregate questions, apply boolean thresholds, infer choice ordering, or call a second judge model.
9
+ Each scorer run calls `Classifier.decide()` to evaluate all questions configured on the classifier, then projects only the answer selected by `question` into a score between 0 and 1. The `question` option doesn't limit which questions are sent to the model. The adapter doesn't aggregate questions, apply boolean thresholds, infer choice ordering, or call a second judge model.
10
+
11
+ To evaluate exactly one question per scorer run, use a separate classifier configured with only that question. For example, five rubric scorers that share a five-question classifier each evaluate all five questions on every run, rather than only their selected question.
10
12
 
11
13
  Agent scorer runs contain message objects that `Classifier.decide()` can't accept directly, so `state` is required. Use it to extract JSON-compatible text, for example with the helpers from `@mastra/evals/scorers/utils`.
12
14
 
@@ -58,6 +60,8 @@ export const qualityScorer = createClassifierScorer({
58
60
  })
59
61
  ```
60
62
 
63
+ This classifier configures three questions so the examples below can reuse it. Each `qualityScorer.run()` evaluates `quality`, `route`, and `factual`, but only the `quality` answer determines its score. To evaluate only `quality`, remove `route` and `factual` from this classifier's `questions`.
64
+
61
65
  For a score question with N criteria, the classifier answers with a level from `0` to `N - 1`, and `result.score` divides that level by `N - 1`. With three criteria, `Partially correct` scores `0.5`.
62
66
 
63
67
  ## Choice questions
@@ -155,7 +159,7 @@ Running an ID-backed scorer before registering it with Mastra rejects with an er
155
159
 
156
160
  **classifier** (`Classifier | string`): A classifier with constructor-configured questions, or its registered Mastra ID.
157
161
 
158
- **question** (`keyof classifier.questions`): The single configured question to evaluate and project.
162
+ **question** (`keyof classifier.questions`): The configured question whose answer is projected into the score. All questions configured on the classifier are evaluated on each scorer run.
159
163
 
160
164
  **scores** (`Record<ChoiceKey, number>`): Required exhaustive mapping for choice questions. Each value must be between 0 and 1. Rejected for score and boolean questions.
161
165
 
@@ -56,7 +56,7 @@ export default agentInstructions(({ requestContext }) => {
56
56
  })
57
57
  ```
58
58
 
59
- The function can be `async` and receives `mastra` alongside `requestContext`, so it can read from storage or another registered primitive before returning the prompt.
59
+ The function can be `async`. Alongside `requestContext`, it receives `mastra`, the Mastra instance the agent is registered with, so it can read from storage or another registered primitive before returning the prompt. `mastra` is optional in the function type, so guard its use (for example, `mastra?.getStorage()`).
60
60
 
61
61
  Both files can also live in a [subagent](https://mastra.ai/reference/file-based-agents/subagents) directory, which follows the same rules.
62
62
 
@@ -45,6 +45,8 @@ model → config.outputProcessors → processors/output/* → response
45
45
 
46
46
  If `config.inputProcessors` or `config.outputProcessors` is a function, discovered processors of that type are ignored with a warning because function-valued processors can't be statically merged.
47
47
 
48
+ If `config.ts` exports a `new Agent()` instead of a config object, Mastra uses that agent as-is. Discovered files under `processors/input/` and `processors/output/` are ignored with a warning, so set `inputProcessors` and `outputProcessors` on the `Agent` instead.
49
+
48
50
  ## Precedence with config
49
51
 
50
52
  Use `config.ts` for processors that need to be created at runtime or shared across agents. Use file-based processors for static, per-agent processors that should be reviewed alongside the agent.
@@ -120,7 +120,7 @@ Frontmatter accepts every option below except `handler`, which needs a function
120
120
 
121
121
  **prompt** (`string`): Message the agent runs on each fire. Set this or handler, not both.
122
122
 
123
- **handler** (`(ctx) => ScheduleOverrides | null | undefined`): Computes the fire at trigger time. Return overrides to apply, or null to skip this fire. Returning nothing applies no overrides, which fails the fire because handler mode has no stored prompt. Set this or prompt, not both.
123
+ **handler** (`(ctx) => AgentScheduleHandlerResult | null | undefined | void | Promise<AgentScheduleHandlerResult | null | undefined | void>`): Computes the fire at trigger time and can be async. Return overrides to apply as an AgentScheduleHandlerResult (Partial\<ScheduleEffective>), or null to skip this fire. Returning nothing applies no overrides, which fails the fire because handler mode has no stored prompt. Set this or prompt, not both.
124
124
 
125
125
  **timezone** (`string`): IANA timezone the cron is evaluated in (e.g. America/New\_York). Defaults to the host process timezone, which varies by deployment, so set this explicitly for anything time-of-day sensitive. DST transitions are handled by the timezone rules, so 0 9 \* \* \* stays 9am local across the shift.
126
126
 
@@ -10,7 +10,7 @@ Use this page for the file-based convention. For code-defined skills, see [Agent
10
10
 
11
11
  ## Quickstart
12
12
 
13
- The simplest skill is one markdown file under `skills/`. The filename becomes the skill name, and `description` tells the agent when to load it.
13
+ The simplest skill is one markdown file under `skills/`. The filename becomes the skill name unless the frontmatter sets `name`, which takes precedence. The `description` tells the agent when to load it.
14
14
 
15
15
  ```markdown
16
16
  ---
@@ -42,7 +42,7 @@ export default agentConfig({
42
42
 
43
43
  A subagent's `description` is routing text for the parent model. Write it like a [tool description](https://mastra.ai/reference/file-based-agents/tools): explain what the subagent does and when to delegate to it.
44
44
 
45
- The build fails when a discovered subagent doesn't provide a non-empty description.
45
+ The build fails when a discovered subagent doesn't provide a non-empty description. The exception is a parent whose `config.ts` exports a `new Agent()`: its `subagents/` directory is ignored with a warning, so no description check runs. Set `agents` on the `Agent` instead.
46
46
 
47
47
  ## Isolation
48
48
 
@@ -35,7 +35,7 @@ const { thread, clonedMessages } = await memory.cloneThread({
35
35
 
36
36
  **title** (`string`): Optional title for the cloned thread. If omitted, the clone uses Clone of ${sourceThread.title} when the source thread has a title. Otherwise, the title is empty.
37
37
 
38
- **metadata** (`Record<string, unknown>`): Optional metadata to merge with the source thread's metadata. Clone metadata is automatically added.
38
+ **metadata** (`Record<string, unknown>`): Optional metadata for the new thread. The new thread's metadata contains only the supplied metadata plus an automatically added clone record with sourceThreadId, clonedAt, and optional lastMessageId. Source-thread metadata isn't copied.
39
39
 
40
40
  **options** (`CloneOptions`): Optional filtering options for the clone operation.
41
41
 
@@ -35,7 +35,7 @@ const { thread, messageIdMap } = await memory.copyThread({
35
35
 
36
36
  **title** (`string`): Optional title for the new thread. If omitted, the copy uses Clone of ${sourceThread.title} when the source thread has a title. Otherwise, the title is empty.
37
37
 
38
- **metadata** (`Record<string, unknown>`): Optional metadata to merge with the source thread's metadata. Clone metadata is automatically added.
38
+ **metadata** (`Record<string, unknown>`): Optional metadata for the new thread. The new thread's metadata contains only the supplied metadata plus an automatically added clone record with sourceThreadId, clonedAt, and optional lastMessageId. Source-thread metadata isn't copied.
39
39
 
40
40
  **options** (`CloneOptions`): Optional filtering options. See cloneThread() for the full shape.
41
41
 
@@ -37,6 +37,8 @@ export const agent = new Agent({
37
37
 
38
38
  **embedder** (`EmbeddingModel<string> | EmbeddingModelV2<string>`): Embedder instance for vector embeddings. Required when semantic recall is enabled.
39
39
 
40
+ **embeddingDimension** (`number`): Output dimension of the embedder, as a positive integer. When set, Memory uses it to name the semantic recall index instead of embedding a probe string on first use. It must match the vectors the embedder returns: a mismatch throws a MASTRA\_MEMORY\_EMBEDDING\_DIMENSION\_MISMATCH error before any index is created. See Setting the embedding dimension.
41
+
40
42
  **options** (`MemoryConfig`): Memory configuration options.
41
43
 
42
44
  **options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to false to disable the message history feature entirely (messages are not loaded into context or saved). Use Number.MAX\_SAFE\_INTEGER to retrieve all messages with no limit. To load messages without saving new ones, use the readOnly option. The window slides forward on every request, so once a thread exceeds the limit, each turn invalidates the provider prompt cache. For long-running conversations, use Observational Memory instead.
@@ -52,7 +52,7 @@ new MastraEditor({
52
52
 
53
53
  **model** (`string`): Model ID used by both the Observer and Reflector (for example, "google/gemini-2.5-flash").
54
54
 
55
- **scope** (`'resource' | 'thread'`): Whether observations are scoped to a resource or a single thread.
55
+ **scope** (`'resource' | 'thread'`): Deprecated. 'resource' will be removed in a future release, leaving 'thread' (already the default) as the only scope. Omit this option to use thread scope. See resource scope (deprecated). (Default: `'thread'`)
56
56
 
57
57
  **activateAfterIdle** (`ObservationalMemoryActivationTTL`): Inactivity TTL before forcing buffered observation activation.
58
58
 
@@ -21,18 +21,20 @@ For hosted traces, see [Query observability data on Mastra Platform](https://mas
21
21
 
22
22
  The configured observability store must support each API. Call `getObservabilityCapabilities()` or `GET /api/observability/capabilities` and check these flags before showing a feature:
23
23
 
24
- | Capability | Store feature | Enables |
25
- | ---------------------------- | --------------------------------- | -------------------------------------------------------------------------------------- |
26
- | `traceQuery` | `trace-query` | `queryTraces()` |
27
- | `traceAggregate` | `trace-aggregate` | `aggregateTraces()` |
28
- | `traceQueryRootDuration` | `trace-query-root-duration` | Trace-scope `durationMs` predicates |
29
- | `traceQueryTimeToFirstChunk` | `trace-query-time-to-first-chunk` | `timeToFirstChunkMs` predicates and results |
30
- | `traceQueryContextIds` | `trace-query-context-ids` | `runId`, `sessionId`, `userId`, and `organizationId` predicates |
31
- | `traceQueryRootSpanFields` | `trace-query-root-span-fields` | Trace-scope `name` and `spanType` predicates, dimensions, and `countDistinct` measures |
32
- | `traceQueryDiscovery` | `trace-query-discovery` | [Field and value discovery](#discover-fields-and-values) |
33
- | `traceQueryTenantScope` | `trace-query-tenant-scope` | [Trusted tenant scope](#trusted-tenant-scope) |
34
-
35
- A missing `traceAggregate` value means the server doesn't support aggregation. Servers without the aggregate route return `404`, and stores without the feature return `501 TRACE_AGGREGATE_UNSUPPORTED`. Against a store without a sub-feature, a request that uses a gated field returns `501` before storage runs. Root span `name` and `spanType` are the exception and return `422` with a `field_not_allowed` issue.
24
+ | Capability | Store feature | Enables |
25
+ | -------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------- |
26
+ | `traceQuery` | `trace-query` | `queryTraces()` |
27
+ | `traceAggregate` | `trace-aggregate` | `aggregateTraces()` |
28
+ | `traceQueryRootDuration` | `trace-query-root-duration` | Trace-scope `durationMs` predicates |
29
+ | `traceQueryTimeToFirstChunk` | `trace-query-time-to-first-chunk` | `timeToFirstChunkMs` predicates and results |
30
+ | `traceQueryTimeToFirstChunkSort` | `trace-query-time-to-first-chunk-sort` | `orderBy` on `timeToFirstChunkMs` |
31
+ | `traceQueryContextIds` | `trace-query-context-ids` | `runId`, `sessionId`, `userId`, and `organizationId` predicates |
32
+ | `traceQueryRootSpanFields` | `trace-query-root-span-fields` | Trace-scope `name` and `spanType` predicates, dimensions, and `countDistinct` measures |
33
+ | `traceQueryRootEntityId` | `trace-query-root-entity-id` | Trace-scope `entityId` predicates, dimensions, and `countDistinct` measures |
34
+ | `traceQueryDiscovery` | `trace-query-discovery` | [Field and value discovery](#discover-fields-and-values) |
35
+ | `traceQueryTenantScope` | `trace-query-tenant-scope` | [Trusted tenant scope](#trusted-tenant-scope) |
36
+
37
+ A missing `traceAggregate` value means the server doesn't support aggregation. Servers without the aggregate route return `404`, and stores without the feature return `501 TRACE_AGGREGATE_UNSUPPORTED`. Against a store without a sub-feature, a request that uses a gated field returns `501` before storage runs. Root span `name`, `spanType`, and `entityId` are the exception and return `422` with a `field_not_allowed` issue.
36
38
 
37
39
  ## Select traces
38
40
 
@@ -75,7 +77,7 @@ Span clauses examine the current root span and current child spans. The root `ti
75
77
 
76
78
  | Predicate context | Fields | Operators |
77
79
  | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
78
- | Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
80
+ | Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `entityId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
79
81
  | Trace metadata | `metadata.<key>` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
80
82
  | Trace | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
81
83
  | Trace | `tags` | `includes`, `notIncludes`, `exists`, `notExists` |
@@ -84,7 +86,7 @@ Span clauses examine the current root span and current child spans. The root `ti
84
86
  | Span | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
85
87
  | Span | `error` | `exists`, `notExists` |
86
88
 
87
- Trace-scope `name` and `spanType` read the current root span, so `{ op: 'eq', left: { path: 'spanType' }, right: { literal: 'workflow_run' } }` selects traces started by a workflow run. Inside `spans.some` or `spans.none`, the same fields match any span in the trace.
89
+ Trace-scope `name`, `spanType`, and `entityId` read the current root span, so `{ op: 'eq', left: { path: 'spanType' }, right: { literal: 'workflow_run' } }` selects traces started by a workflow run. Inside `spans.some` or `spans.none`, the same fields match any span in the trace.
88
90
 
89
91
  Compose predicates with `{ op: 'and', args: [...] }`, `{ op: 'or', args: [...] }`, and `{ op: 'not', arg: ... }`. Comparison predicates place a field reference on the left and a literal on the right. Membership predicates use a field reference in `value` and a homogeneous literal array in `set`. Tag predicates name the stored tag collection in `path`. `includes` and `notIncludes` also take one tag in `value`, while `exists` and `notExists` take only `op` and `path`. See [Filter by tags](#filter-by-tags). Text predicates use the comparison shape with a string literal. See [Filter by text](#filter-by-text).
90
92
 
@@ -128,7 +130,13 @@ const slowFirstChunk = {
128
130
 
129
131
  The value is `null` when the span didn't stream a chunk, for example a tool call or a workflow run. A `null` value counts as missing, so it matches `notExists` and never matches ordered predicates. A value of `0` isn't missing. It means the first chunk arrived in the same millisecond the span started.
130
132
 
131
- Trace query results include the root span's `timeToFirstChunkMs`, and `querySpans()` results include each span's value. Sorting by this field isn't supported. Stores advertise support through the `trace-query-time-to-first-chunk` feature, and the server reports it as the `traceQueryTimeToFirstChunk` capability. Against an older store, results omit the field, a predicate on it returns `501` before storage runs, and field discovery omits it.
133
+ Trace query results include the root span's `timeToFirstChunkMs`, and `querySpans()` results include each span's value. Stores advertise support through the `trace-query-time-to-first-chunk` feature, and the server reports it as the `traceQueryTimeToFirstChunk` capability. Against an older store, results omit the field, a predicate on it returns `501` before storage runs, and field discovery omits it.
134
+
135
+ #### Sort by time to first chunk
136
+
137
+ Pass `orderBy: [{ field: 'timeToFirstChunkMs', direction: 'desc' }]` to list the slowest first chunks first. Traces sort by the root span's value. Missing values sort last in both directions, and `0` sorts as a value. Ties break by `traceId` for traces and by span identity for `querySpans()`.
138
+
139
+ Stores advertise the sort through the `trace-query-time-to-first-chunk-sort` feature, and the server reports it as the `traceQueryTimeToFirstChunkSort` capability. Against an older store, the sort returns `501` before storage runs.
132
140
 
133
141
  #### Filter by context identifiers
134
142
 
@@ -437,16 +445,16 @@ curl --request POST \
437
445
 
438
446
  ### Request fields
439
447
 
440
- | Field | Required | Description |
441
- | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
442
- | `timeRange` | Yes | Trace start-time boundary. `from` is inclusive and `to` is exclusive. Both values must be ISO timestamps, and `from` must be earlier than `to`. |
443
- | `where` | No | Recursive trace predicate. Supports scalar conditions and `spans.some` or `spans.none` clauses. |
444
- | `orderBy` | No | One item ordering results by `startedAt` or `endedAt`, in `asc` or `desc` order. Defaults to `startedAt desc`. Not accepted in delta mode. |
445
- | `page` | No | `{ limit, after }`. `limit` defaults to 100 and has a maximum of 1000. Pass the opaque `page.next` value as `after`. |
446
- | `pagination` | No | Numbered pages: `{ page, perPage }`. Defaults to page 0 and 10 results. `perPage` has a maximum of 100. |
447
- | `mode` | No | Set to `'delta'` to poll using a delta cursor instead of `page` or `pagination`. |
448
- | `after` | No | Delta mode only. Opaque `deltaCursor` from a numbered page or previous poll. Omit to establish the current watermark. |
449
- | `limit` | No | Delta mode only. Maximum results per batch. Defaults to 10 and has a maximum of 100. |
448
+ | Field | Required | Description |
449
+ | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
450
+ | `timeRange` | Yes | Trace start-time boundary. `from` is inclusive and `to` is exclusive. Both values must be ISO timestamps, and `from` must be earlier than `to`. |
451
+ | `where` | No | Recursive trace predicate. Supports scalar conditions and `spans.some` or `spans.none` clauses. |
452
+ | `orderBy` | No | One item ordering results by `startedAt`, `endedAt`, or `timeToFirstChunkMs`, in `asc` or `desc` order. Defaults to `startedAt desc`. Not accepted in delta mode. |
453
+ | `page` | No | `{ limit, after }`. `limit` defaults to 100 and has a maximum of 1000. Pass the opaque `page.next` value as `after`. |
454
+ | `pagination` | No | Numbered pages: `{ page, perPage }`. Defaults to page 0 and 10 results. `perPage` has a maximum of 100. |
455
+ | `mode` | No | Set to `'delta'` to poll using a delta cursor instead of `page` or `pagination`. |
456
+ | `after` | No | Delta mode only. Opaque `deltaCursor` from a numbered page or previous poll. Omit to establish the current watermark. |
457
+ | `limit` | No | Delta mode only. Maximum results per batch. Defaults to 10 and has a maximum of 100. |
450
458
 
451
459
  Unknown fields are rejected. Requests can't select a projection, declare joins, request counts or measures, or control authorization. Use [`aggregateTraces()`](#aggregate-traces) for counts and measures. Request bodies are limited to 256 KiB.
452
460
 
@@ -657,12 +665,13 @@ Unknown fields are rejected. Aggregation isn't paginated. Narrow the selection,
657
665
 
658
666
  Dimensions read the current root span of each selected trace:
659
667
 
660
- | Dimension | Notes |
661
- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
662
- | `entityType`, `entityName`, `environment`, `status`, `serviceName`, `executionSource` | Root span attributes. |
663
- | `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the root span. |
664
- | `name`, `spanType` | Root span name and type. Requires the `traceQueryRootSpanFields` capability. |
665
- | `metadata.<key>` | One non-empty top-level metadata key. Values are trimmed. Missing, empty, and non-string values group as `null`. |
668
+ | Dimension | Notes |
669
+ | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
670
+ | `entityType`, `entityName`, `environment`, `status`, `serviceName`, `executionSource` | Root span attributes. |
671
+ | `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the root span. |
672
+ | `name`, `spanType` | Root span name and type. Requires the `traceQueryRootSpanFields` capability. |
673
+ | `entityId` | Root span entity ID. Groups traces that have no `entityName`, such as scorer runs. Requires the `traceQueryRootEntityId` capability. |
674
+ | `metadata.<key>` | One non-empty top-level metadata key. Values are trimmed. Missing, empty, and non-string values group as `null`. |
666
675
 
667
676
  Every dimension except `serviceName`, `executionSource`, and `experimentId` is also a trace-scope `where` field, so you can drill into a group by adding its values to the predicate. `traceId`, `spanId`, `runId`, and `requestId` aren't groupable. Traces with no value for a dimension form their own group with a `null` value.
668
677
 
@@ -668,6 +668,14 @@ processOutputStep?(args: ProcessOutputStepArgs): ProcessorMessageResult;
668
668
 
669
669
  **requestContext** (`RequestContext`): Request-scoped context with execution metadata.
670
670
 
671
+ #### Return value
672
+
673
+ `processOutputStep` returns a `MessageList` or `MastraDBMessage[]`, directly or in a promise.
674
+
675
+ - Return the supplied `messageList` instance to keep it, including any in-place changes.
676
+ - Return a messages array to replace the current messages. Return the supplied `messages` array to leave them unchanged.
677
+ - Returning `[]` removes all current messages, including the conversation history and the latest response. It isn't a no-op.
678
+
671
679
  #### Use cases
672
680
 
673
681
  - Implementing quality guardrails that can request retries
@@ -683,7 +691,7 @@ import type { Processor } from '@mastra/core/processors'
683
691
  export class QualityGuardrail implements Processor {
684
692
  id = 'quality-guardrail'
685
693
 
686
- async processOutputStep({ text, abort, retryCount }) {
694
+ async processOutputStep({ messages, text, abort, retryCount }) {
687
695
  const score = await evaluateResponseQuality(text)
688
696
 
689
697
  if (score < 0.7) {
@@ -699,7 +707,7 @@ export class QualityGuardrail implements Processor {
699
707
  }
700
708
  }
701
709
 
702
- return []
710
+ return messages
703
711
  }
704
712
  }
705
713
  ```
@@ -396,6 +396,8 @@ Identifies a specific agent thread.
396
396
 
397
397
  **agentId** (`string`): Agent identifier.
398
398
 
399
+ **ifIdle** (`AgentSignalIfIdleOptions`): Options for signal delivery when the target thread is idle. Forwarded to sendNotificationSignal. See thread signals.
400
+
399
401
  ## Type guard
400
402
 
401
403
  ### `isSignalProvider(obj)`
@@ -8,7 +8,7 @@
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
 
11
- Extends [`SignalProvider`](https://mastra.ai/reference/signals/signal-provider). The task list is stored in the thread-scoped `tasks` storage domain (the source of truth) and projected onto the agent state-signal lane by the processor, so it survives observational-memory truncation without invalidating the prompt cache.
11
+ Extends [`SignalProvider`](https://mastra.ai/reference/signals/signal-provider). The task list is stored under the `task` state type in the thread-scoped `threadState` storage domain, which is the source of truth, and projected onto the `tasks` agent state-signal lane by the processor, so it survives observational-memory truncation without invalidating the prompt cache.
12
12
 
13
13
  ## Usage example
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.9-alpha.10",
3
+ "version": "1.3.9-alpha.13",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "local-pkg": "^1.1.2",
28
28
  "zod": "^4.6.7",
29
29
  "@mastra/mcp": "^2.5.0-alpha.1",
30
- "@mastra/core": "1.79.0-alpha.7"
30
+ "@mastra/core": "1.79.0-alpha.9"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hono/node-server": "^2.0.0",
@@ -44,7 +44,7 @@
44
44
  "vitest": "4.1.11",
45
45
  "@internal/lint": "0.0.144",
46
46
  "@internal/types-builder": "0.0.119",
47
- "@mastra/core": "1.79.0-alpha.7"
47
+ "@mastra/core": "1.79.0-alpha.9"
48
48
  },
49
49
  "homepage": "https://mastra.ai",
50
50
  "repository": {