@mastra/mcp-docs-server 0.13.11-alpha.1 → 0.13.11-alpha.2

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 (72) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +15 -15
  2. package/.docs/organized/changelogs/%40mastra%2Fcore.md +14 -14
  3. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +22 -22
  4. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +21 -21
  5. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +13 -13
  6. package/.docs/organized/changelogs/%40mastra%2Flance.md +15 -12
  7. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +13 -13
  8. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +14 -14
  9. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +13 -13
  10. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +14 -14
  11. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +13 -13
  12. package/.docs/organized/changelogs/%40mastra%2Fpg.md +17 -17
  13. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +18 -18
  14. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +14 -14
  15. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
  16. package/.docs/organized/changelogs/%40mastra%2Fserver.md +15 -15
  17. package/.docs/organized/changelogs/create-mastra.md +11 -11
  18. package/.docs/organized/changelogs/mastra.md +24 -24
  19. package/.docs/organized/code-examples/a2a.md +52 -19
  20. package/.docs/organized/code-examples/weather-agent.md +14 -0
  21. package/.docs/raw/auth/jwt.mdx +3 -1
  22. package/.docs/raw/evals/overview.mdx +8 -0
  23. package/.docs/raw/getting-started/installation.mdx +45 -7
  24. package/.docs/raw/getting-started/mcp-docs-server.mdx +3 -3
  25. package/.docs/raw/memory/overview.mdx +11 -5
  26. package/.docs/raw/reference/agents/agent.mdx +6 -2
  27. package/.docs/raw/reference/agents/generate.mdx +48 -40
  28. package/.docs/raw/reference/agents/getAgent.mdx +10 -5
  29. package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +22 -17
  30. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +22 -17
  31. package/.docs/raw/reference/agents/getDefaultVNextStreamOptions.mdx +22 -17
  32. package/.docs/raw/reference/agents/getDescription.mdx +9 -5
  33. package/.docs/raw/reference/agents/getInstructions.mdx +22 -17
  34. package/.docs/raw/reference/agents/getLLM.mdx +23 -18
  35. package/.docs/raw/reference/agents/getMemory.mdx +22 -17
  36. package/.docs/raw/reference/agents/getModel.mdx +22 -17
  37. package/.docs/raw/reference/agents/getScorers.mdx +22 -17
  38. package/.docs/raw/reference/agents/getTools.mdx +22 -17
  39. package/.docs/raw/reference/agents/getVoice.mdx +22 -17
  40. package/.docs/raw/reference/agents/getWorkflows.mdx +22 -17
  41. package/.docs/raw/reference/agents/stream.mdx +24 -19
  42. package/.docs/raw/reference/agents/streamVNext.mdx +18 -19
  43. package/.docs/raw/reference/storage/upstash.mdx +5 -0
  44. package/.docs/raw/reference/tools/create-tool.mdx +22 -29
  45. package/.docs/raw/reference/tools/graph-rag-tool.mdx +2 -2
  46. package/.docs/raw/reference/tools/vector-query-tool.mdx +3 -3
  47. package/.docs/raw/reference/workflows/branch.mdx +6 -6
  48. package/.docs/raw/reference/workflows/commit.mdx +5 -5
  49. package/.docs/raw/reference/workflows/create-run.mdx +28 -29
  50. package/.docs/raw/reference/workflows/dountil.mdx +5 -5
  51. package/.docs/raw/reference/workflows/dowhile.mdx +5 -5
  52. package/.docs/raw/reference/workflows/execute.mdx +83 -91
  53. package/.docs/raw/reference/workflows/foreach.mdx +5 -5
  54. package/.docs/raw/reference/workflows/map.mdx +8 -93
  55. package/.docs/raw/reference/workflows/parallel.mdx +5 -5
  56. package/.docs/raw/reference/workflows/resume.mdx +45 -47
  57. package/.docs/raw/reference/workflows/sendEvent.mdx +5 -5
  58. package/.docs/raw/reference/workflows/sleep.mdx +5 -5
  59. package/.docs/raw/reference/workflows/sleepUntil.mdx +16 -8
  60. package/.docs/raw/reference/workflows/start.mdx +42 -27
  61. package/.docs/raw/reference/workflows/step.mdx +15 -29
  62. package/.docs/raw/reference/workflows/stream.mdx +55 -205
  63. package/.docs/raw/reference/workflows/streamVNext.mdx +55 -174
  64. package/.docs/raw/reference/workflows/then.mdx +5 -5
  65. package/.docs/raw/reference/workflows/waitForEvent.mdx +5 -5
  66. package/.docs/raw/reference/workflows/watch.mdx +31 -13
  67. package/.docs/raw/reference/workflows/workflow.mdx +27 -100
  68. package/.docs/raw/scorers/overview.mdx +8 -0
  69. package/.docs/raw/server-db/local-dev-playground.mdx +16 -1
  70. package/dist/tools/__tests__/test-setup.d.ts +1 -1
  71. package/dist/tools/__tests__/test-setup.d.ts.map +1 -1
  72. package/package.json +5 -5
@@ -1,42 +1,30 @@
1
1
  ---
2
- title: "Reference: Workflow Class | Building Workflows | Mastra Docs"
3
- description: Documentation for the Workflow class in Mastra, which enables you to create state machines for complex sequences of operations with conditional branching and data validation.
2
+ title: "Reference: Workflow Class | Workflows | Mastra Docs"
3
+ description: Documentation for the `Workflow` class in Mastra, which enables you to create state machines for complex sequences of operations with conditional branching and data validation.
4
4
  ---
5
5
 
6
6
  # Workflow Class
7
7
 
8
- The Workflow class enables you to create state machines for complex sequences of operations with conditional branching and data validation.
8
+ The `Workflow` class enables you to create state machines for complex sequences of operations with conditional branching and data validation.
9
9
 
10
- ## Usage
10
+ ## Usage example
11
11
 
12
- ```typescript
13
- const myWorkflow = createWorkflow({
14
- id: "my-workflow",
12
+ ```typescript filename="src/mastra/workflows/test-workflow.ts" showLineNumbers copy
13
+ import { createWorkflow } from "@mastra/core/workflows";
14
+ import { z } from "zod";
15
+
16
+ const workflow = createWorkflow({
17
+ id: "test-workflow",
15
18
  inputSchema: z.object({
16
- startValue: z.string(),
19
+ value: z.string(),
17
20
  }),
18
21
  outputSchema: z.object({
19
- result: z.string(),
20
- }),
21
- steps: [step1, step2, step3], // Declare steps used in this workflow
22
+ value: z.string(),
23
+ })
22
24
  })
23
- .then(step1)
24
- .then(step2)
25
- .then(step3)
26
- .commit();
27
-
28
- const mastra = new Mastra({
29
- workflows: {
30
- myWorkflow,
31
- },
32
- });
33
-
34
- const run = await mastra.getWorkflow("myWorkflow").createRunAsync();
35
25
  ```
36
26
 
37
- ## API Reference
38
-
39
- ### Constructor
27
+ ## Constructor parameters
40
28
 
41
29
  <PropertiesTable
42
30
  content={[
@@ -54,64 +42,13 @@ const run = await mastra.getWorkflow("myWorkflow").createRunAsync();
54
42
  name: "outputSchema",
55
43
  type: "z.ZodType<any>",
56
44
  description: "Zod schema defining the output structure for the workflow",
57
- },
58
- {
59
- name: "steps",
60
- type: "Step[]",
61
- description: "Array of steps to include in the workflow",
62
- },
45
+ }
63
46
  ]}
64
47
  />
65
48
 
66
- ### Core Methods
67
-
68
- #### `then()`
69
-
70
- Adds a step to the workflow sequentially. Returns the workflow instance for chaining.
71
-
72
- #### `parallel()`
73
-
74
- Executes multiple steps concurrently. Takes an array of steps and returns the workflow instance.
75
-
76
- #### `branch()`
77
-
78
- Creates conditional branching logic. Takes an array of tuples containing condition functions and steps to execute when conditions are met.
79
-
80
- #### `dowhile()`
81
-
82
- Creates a loop that executes a step repeatedly while a condition remains true. The condition is checked after each execution.
83
-
84
- #### `dountil()`
85
-
86
- Creates a loop that executes a step repeatedly until a condition becomes true. The condition is checked after each execution.
87
-
88
- #### `foreach()`
49
+ ## Workflow status
89
50
 
90
- Iterates over an array and executes a step for each element. Accepts optional concurrency configuration.
91
-
92
- #### `map()`
93
-
94
- Maps data between steps using either a mapping configuration object or a mapping function. Useful for transforming data between steps.
95
-
96
- #### `commit()`
97
-
98
- Validates and finalizes the workflow configuration. Must be called after adding all steps.
99
-
100
- #### `createRun()`
101
-
102
- Deprecated. Creates a new workflow run instance, allowing you to execute the workflow with specific input data. Accepts optional run ID.
103
-
104
- #### `createRunAsync()`
105
-
106
- Creates a new workflow run instance, allowing you to execute the workflow with specific input data. Accepts optional run ID. Stores a pending workflow run snapshot into storage.
107
-
108
- #### `execute()`
109
-
110
- Executes the workflow with provided input data. Handles workflow suspension, resumption and emits events during execution.
111
-
112
- ## Workflow Status
113
-
114
- A workflow's status indicates its current execution state. The possible values are:
51
+ A workflow's `status` indicates its current execution state. The possible values are:
115
52
 
116
53
  <PropertiesTable
117
54
  content={[
@@ -136,28 +73,18 @@ A workflow's status indicates its current execution state. The possible values a
136
73
  ]}
137
74
  />
138
75
 
139
- ## Passing Context Between Steps
76
+ ## Extended usage example
140
77
 
141
- Steps can access data from previous steps in the workflow through the context object. Each step receives the accumulated context from all previous steps that have executed.
78
+ ```typescript filename="src/test-run.ts" showLineNumbers copy
79
+ import { mastra } from "./mastra";
142
80
 
143
- ```typescript
144
- workflow
145
- .then({
146
- id: "getData",
147
- execute: async ({ inputData }) => {
148
- return {
149
- data: { id: "123", value: "example" },
150
- };
151
- },
152
- })
153
- .then({
154
- id: "processData",
155
- execute: async ({ inputData }) => {
156
- // Access data from previous step through context.steps
157
- const previousData = inputData.data;
158
- // Process previousData.id and previousData.value
159
- },
160
- });
81
+ const run = await mastra.getWorkflow("workflow").createRunAsync();
82
+
83
+ const result = await run.start({...});
84
+
85
+ if (result.status === "suspended") {
86
+ const resumedResult = await run.resume({...});
87
+ }
161
88
  ```
162
89
 
163
90
  ## Related
@@ -48,6 +48,14 @@ This modular structure enables both simple single-step evaluations and complex m
48
48
 
49
49
  To learn how to create your own Scorers, see [Creating Custom Scorers](/docs/scorers/custom-scorers).
50
50
 
51
+ ## Installation
52
+
53
+ To access Mastra's scorers feature install the `@mastra/evals` package.
54
+
55
+ ```bash copy
56
+ npm install @mastra/evals@latest
57
+ ```
58
+
51
59
  ## Live evaluations
52
60
 
53
61
  **Live evaluations** allow you to automatically score AI outputs in real-time as your agents and workflows operate. Instead of running evaluations manually or in batches, scorers run asynchronously alongside your AI systems, providing continuous quality monitoring.
@@ -13,12 +13,27 @@ Mastra provides a local development environment where you can test your agents,
13
13
 
14
14
  Start the local development server by running:
15
15
 
16
- <Tabs items={["npm", "Mastra CLI"]}>
16
+ <Tabs items={["npm", "yarn", "pnpm", "bun", "Mastra CLI"]}>
17
17
  <Tab>
18
18
  ```bash copy
19
19
  npm run dev
20
20
  ```
21
21
  </Tab>
22
+ <Tab>
23
+ ```bash copy
24
+ yarn run dev
25
+ ```
26
+ </Tab>
27
+ <Tab>
28
+ ```bash copy
29
+ pnpm run dev
30
+ ```
31
+ </Tab>
32
+ <Tab>
33
+ ```bash copy
34
+ bun run dev
35
+ ```
36
+ </Tab>
22
37
  <Tab>
23
38
  ```bash copy
24
39
  mastra dev
@@ -1,5 +1,5 @@
1
1
  import { MCPClient } from '@mastra/mcp';
2
2
  export declare const server: import("@hono/node-server").ServerType;
3
3
  export declare const mcp: MCPClient;
4
- export declare function callTool(tool: any, args: any): Promise<string>;
4
+ export declare function callTool(tool: any, args: any): Promise<any>;
5
5
  //# sourceMappingURL=test-setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/test-setup.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAuCxC,eAAO,MAAM,MAAM,wCAGjB,CAAC;AAKH,eAAO,MAAM,GAAG,WAWd,CAAC;AAEH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,mBAsBlD"}
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/test-setup.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAuCxC,eAAO,MAAM,MAAM,wCAGjB,CAAC;AAKH,eAAO,MAAM,GAAG,WAWd,CAAC;AAEH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,gBA2BlD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "0.13.11-alpha.1",
3
+ "version": "0.13.11-alpha.2",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,8 +32,8 @@
32
32
  "uuid": "^11.1.0",
33
33
  "zod": "^3.25.67",
34
34
  "zod-to-json-schema": "^3.24.5",
35
- "@mastra/mcp": "^0.10.10",
36
- "@mastra/core": "0.13.2-alpha.1"
35
+ "@mastra/core": "0.13.2-alpha.2",
36
+ "@mastra/mcp": "^0.10.11-alpha.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@hono/node-server": "^1.17.1",
@@ -48,8 +48,8 @@
48
48
  "tsx": "^4.19.4",
49
49
  "typescript": "^5.8.3",
50
50
  "vitest": "^3.2.4",
51
- "@mastra/core": "0.13.2-alpha.1",
52
- "@internal/lint": "0.0.28"
51
+ "@internal/lint": "0.0.28",
52
+ "@mastra/core": "0.13.2-alpha.2"
53
53
  },
54
54
  "scripts": {
55
55
  "prepare-docs": "cross-env PREPARE=true node dist/prepare-docs/prepare.js",