@mastra/mcp-docs-server 1.2.13-alpha.0 → 1.2.13-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/.docs/docs/agents/agent-approval.md +72 -0
  2. package/.docs/docs/agents/overview.md +1 -1
  3. package/.docs/docs/agents/supervisor-agents.md +2 -2
  4. package/.docs/docs/agents/using-tools.md +61 -33
  5. package/.docs/docs/{evals/datasets → datasets}/overview.md +3 -3
  6. package/.docs/docs/{evals/datasets → datasets}/running-experiments.md +57 -9
  7. package/.docs/docs/deployment/workers.md +14 -14
  8. package/.docs/docs/editor/overview.md +201 -206
  9. package/.docs/docs/evals/evals-with-memory.md +1 -1
  10. package/.docs/docs/getting-started/develop.md +196 -0
  11. package/.docs/docs/index.md +78 -1
  12. package/.docs/docs/long-running-agents/durable-agents.md +2 -2
  13. package/.docs/docs/mastra-platform/overview.md +1 -1
  14. package/.docs/docs/mastra-platform/workspaces.md +152 -0
  15. package/.docs/docs/memory/observational-memory.md +53 -13
  16. package/.docs/docs/memory/overview.md +14 -0
  17. package/.docs/docs/server/auth/workers.md +7 -5
  18. package/.docs/docs/server/mastra-client.md +60 -0
  19. package/.docs/docs/server/pubsub.md +2 -2
  20. package/.docs/docs/studio/observability.md +4 -0
  21. package/.docs/docs/studio/overview.md +2 -2
  22. package/.docs/docs/workflows/overview.md +1 -1
  23. package/.docs/docs/workflows/scheduled-workflows.md +1 -0
  24. package/.docs/docs/workspace/search.md +1 -1
  25. package/.docs/guides/deployment/kubernetes.md +2 -0
  26. package/.docs/guides/deployment/mastra-workers.md +350 -6
  27. package/.docs/guides/deployment/vercel.md +2 -0
  28. package/.docs/guides/getting-started/quickstart.md +3 -3
  29. package/.docs/{docs → guides}/rag/chunking-and-embedding.md +1 -1
  30. package/.docs/{docs → guides}/rag/graph-rag.md +1 -1
  31. package/.docs/{docs → guides}/rag/overview.md +2 -2
  32. package/.docs/{docs → guides}/rag/retrieval.md +1 -1
  33. package/.docs/{docs → guides}/voice/overview.md +4 -4
  34. package/.docs/{docs → guides}/voice/realtime-voice.md +2 -2
  35. package/.docs/{docs → guides}/voice/speech-to-speech.md +1 -1
  36. package/.docs/{docs → guides}/voice/speech-to-text.md +1 -1
  37. package/.docs/{docs → guides}/voice/text-to-speech.md +2 -2
  38. package/.docs/models/embeddings.md +63 -65
  39. package/.docs/models/environment-variables.md +2 -1
  40. package/.docs/models/gateways/openrouter.md +3 -6
  41. package/.docs/models/gateways/vercel.md +4 -1
  42. package/.docs/models/index.md +1 -1
  43. package/.docs/models/providers/cortecs.md +2 -1
  44. package/.docs/models/providers/crof.md +2 -1
  45. package/.docs/models/providers/crossmodel.md +4 -3
  46. package/.docs/models/providers/empiriolabs.md +2 -1
  47. package/.docs/models/providers/greenpt.md +98 -0
  48. package/.docs/models/providers/huggingface.md +3 -1
  49. package/.docs/models/providers/hyper.md +10 -7
  50. package/.docs/models/providers/llmgateway.md +5 -4
  51. package/.docs/models/providers/minimax.md +1 -1
  52. package/.docs/models/providers/neuralwatt.md +3 -1
  53. package/.docs/models/providers/openai.md +2 -2
  54. package/.docs/models/providers/opencode-go.md +2 -1
  55. package/.docs/models/providers/opencode.md +1 -1
  56. package/.docs/models/providers/perplexity-agent.md +3 -1
  57. package/.docs/models/providers/scaleway.md +1 -3
  58. package/.docs/models/providers/the-grid-ai.md +3 -3
  59. package/.docs/models/providers/zai-coding-plan.md +11 -13
  60. package/.docs/models/providers/zhipuai-coding-plan.md +12 -12
  61. package/.docs/models/providers.md +1 -0
  62. package/.docs/reference/agents/agent.md +1 -1
  63. package/.docs/reference/agents/durable-agent.md +12 -1
  64. package/.docs/reference/agents/generate.md +1 -1
  65. package/.docs/reference/agents/getVoice.md +1 -1
  66. package/.docs/{docs/getting-started → reference}/build-with-ai.md +5 -110
  67. package/.docs/reference/cli/create-mastra.md +2 -0
  68. package/.docs/reference/cli/mastra.md +36 -16
  69. package/.docs/reference/client-js/agents.md +1 -1
  70. package/.docs/reference/configuration.md +2 -2
  71. package/.docs/reference/core/getEditor.md +1 -1
  72. package/.docs/reference/core/getVector.md +2 -2
  73. package/.docs/reference/core/listVectors.md +2 -2
  74. package/.docs/reference/core/mastra-class.md +2 -2
  75. package/.docs/reference/datasets/startExperiment.md +8 -0
  76. package/.docs/reference/datasets/startExperimentAsync.md +4 -0
  77. package/.docs/reference/editor/browser-provider.md +2 -2
  78. package/.docs/reference/editor/filesystem-provider.md +1 -1
  79. package/.docs/reference/editor/mastra-editor.md +31 -18
  80. package/.docs/reference/editor/prompt-blocks.md +137 -0
  81. package/.docs/reference/editor/sandbox-provider.md +1 -1
  82. package/.docs/reference/editor/storage-browser-ref.md +3 -3
  83. package/.docs/reference/editor/storage-workspace-ref.md +3 -3
  84. package/.docs/reference/editor/tool-provider.md +44 -10
  85. package/.docs/reference/editor/tools.md +100 -0
  86. package/.docs/reference/editor/versioning.md +130 -0
  87. package/.docs/reference/evals/mastra-scorer.md +68 -8
  88. package/.docs/reference/evals/summarization.md +203 -0
  89. package/.docs/reference/file-based-agents/config.md +39 -1
  90. package/.docs/reference/index.md +4 -4
  91. package/.docs/reference/memory/observational-memory.md +76 -24
  92. package/.docs/reference/memory/serialized-memory-config.md +3 -3
  93. package/.docs/reference/observability/tracing/interfaces.md +6 -1
  94. package/.docs/reference/processors/processor-interface.md +14 -2
  95. package/.docs/reference/processors/regex-filter-processor.md +81 -9
  96. package/.docs/reference/processors/token-limiter-processor.md +15 -1
  97. package/.docs/reference/project-structure.md +1 -1
  98. package/.docs/reference/rag/database-config.md +1 -1
  99. package/.docs/reference/storage/composite.md +2 -0
  100. package/.docs/reference/streaming/agents/stream.md +1 -1
  101. package/.docs/reference/tools/isolated-vm-transport.md +1 -1
  102. package/.docs/reference/vectors/mongodb.md +13 -13
  103. package/.docs/reference/voice/livekit.md +3 -3
  104. package/.docs/reference/workers/overview.md +10 -8
  105. package/.docs/reference/workspace/platform-filesystem.md +8 -5
  106. package/.docs/reference/workspace/platform-sandbox.md +83 -7
  107. package/CHANGELOG.md +51 -0
  108. package/README.md +1 -1
  109. package/package.json +5 -5
  110. package/.docs/docs/agent-builder/access-control.md +0 -99
  111. package/.docs/docs/agent-builder/browser.md +0 -63
  112. package/.docs/docs/agent-builder/channels.md +0 -78
  113. package/.docs/docs/agent-builder/configuration.md +0 -132
  114. package/.docs/docs/agent-builder/deploying.md +0 -124
  115. package/.docs/docs/agent-builder/integrations.md +0 -115
  116. package/.docs/docs/agent-builder/memory.md +0 -69
  117. package/.docs/docs/agent-builder/model-policy.md +0 -50
  118. package/.docs/docs/agent-builder/overview.md +0 -114
  119. package/.docs/docs/agent-builder/skill-registries.md +0 -31
  120. package/.docs/docs/agent-builder/workspace.md +0 -62
  121. package/.docs/docs/editor/prompts.md +0 -140
  122. package/.docs/docs/editor/tools.md +0 -148
  123. package/.docs/docs/getting-started/file-based-agents.md +0 -121
  124. package/.docs/docs/mastra-platform/workspace.md +0 -111
  125. package/.docs/docs/what-is-mastra.md +0 -161
  126. package/.docs/reference/client-js/agent-builder.md +0 -163
  127. package/.docs/reference/editor/agent-builder/agent-builder-options.md +0 -76
  128. package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +0 -79
  129. package/.docs/reference/editor/agent-builder/builder-models.md +0 -66
  130. /package/.docs/{docs → guides}/getting-started/manual-install.md +0 -0
  131. /package/.docs/{docs → guides}/rag/vector-databases.md +0 -0
@@ -1,69 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Memory
4
-
5
- > **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
6
-
7
- The Agent Builder pins a default memory shape onto every new agent through `builder.configuration.agent.memory`. The default applies when an end user creates a new agent and doesn't override it.
8
-
9
- ## Quickstart
10
-
11
- ```typescript
12
- import { MastraEditor } from '@mastra/editor'
13
-
14
- new MastraEditor({
15
- builder: {
16
- enabled: true,
17
- configuration: {
18
- agent: {
19
- memory: { observationalMemory: true },
20
- },
21
- },
22
- },
23
- })
24
- ```
25
-
26
- Observational memory lets the agent learn long-lived facts from past conversations. Storage on the `Mastra` instance is required, see the [Memory overview](https://mastra.ai/docs/memory/overview) for the prerequisites.
27
-
28
- ## Observational memory model
29
-
30
- Observational memory runs an Observer and Reflector model on top of every conversation. For Agent Builder agents, the default model is `openai/gpt-5-mini`, which requires an `OPENAI_API_KEY` environment variable in any environment where the Builder agent will run.
31
-
32
- > **Note:** This default applies only to agents created through the Agent Builder. Core (non-builder) agents configured with `observationalMemory: true` keep the framework default `google/gemini-2.5-flash` (which uses `GOOGLE_API_KEY`, falling back to `GOOGLE_GENERATIVE_AI_API_KEY`).
33
-
34
- To use a different model, set `observationalMemory.model` to any model ID supported by the Mastra model router (and provide the matching provider credentials). An explicit model always wins over the Builder default:
35
-
36
- ```typescript
37
- new MastraEditor({
38
- builder: {
39
- enabled: true,
40
- configuration: {
41
- agent: {
42
- memory: {
43
- observationalMemory: {
44
- model: 'openai/gpt-5.6-sol',
45
- },
46
- },
47
- },
48
- },
49
- },
50
- })
51
- ```
52
-
53
- The `model` field applies to both the Observer and Reflector. You can also override each one independently via `observation.model` and `reflection.model`. See the [SerializedMemoryConfig reference](https://mastra.ai/reference/memory/serialized-memory-config) for the full shape.
54
-
55
- ## Storage and vector requirements
56
-
57
- Memory features layer on top of `Mastra.storage`:
58
-
59
- - **Message history** (`options.lastMessages`) requires storage.
60
- - **Observational memory** (`observationalMemory: true`) requires storage.
61
- - **Semantic recall** (`options.semanticRecall`) requires storage plus a registered vector adapter (`vector`) and an embedder (`embedder`).
62
-
63
- If a required adapter is missing, Mastra throws a descriptive error at agent run time. See [Semantic recall](https://mastra.ai/docs/memory/semantic-recall) for the full list of supported vector stores and embedders.
64
-
65
- ## Related
66
-
67
- - [Memory overview](https://mastra.ai/docs/memory/overview): Concepts and core configuration.
68
- - [BuilderAgentDefaults reference](https://mastra.ai/reference/editor/agent-builder/builder-agent-defaults): The full `memory` field schema.
69
- - [Configuration](https://mastra.ai/docs/agent-builder/configuration): Wire `memory` alongside the rest of the Builder config.
@@ -1,50 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Model policy
4
-
5
- > **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
6
-
7
- The model policy controls which providers and models Builder-created agents can use, which model is selected by default, and whether end users can change it. The policy lives at `builder.configuration.agent.models`.
8
-
9
- ## Quickstart
10
-
11
- ```typescript
12
- import { MastraEditor } from '@mastra/editor'
13
-
14
- new MastraEditor({
15
- builder: {
16
- enabled: true,
17
- configuration: {
18
- agent: {
19
- models: {
20
- allowed: [
21
- { provider: 'openai', modelId: 'gpt-5.4-mini' },
22
- { provider: 'openai', modelId: 'gpt-5.4' },
23
- { provider: 'anthropic', modelId: 'claude-opus-4-7' },
24
- ],
25
- },
26
- },
27
- },
28
- },
29
- })
30
- ```
31
-
32
- This restricts the Builder's model picker to two OpenAI models and one Anthropic model. End users choose one when creating an agent.
33
-
34
- ## Validation rules
35
-
36
- Mastra validates the model policy at server boot. Violations are surfaced as warnings through `getModelPolicyWarnings()`.
37
-
38
- - When `allowed` is empty or omitted, every registered model is available.
39
- - When `allowed` is non-empty, `default` (if set) must satisfy the allowlist. A `default` that fails this check is dropped and surfaced as a warning.
40
- - To hide the end-user model picker, set `features.agent.model: false` in [AgentBuilderOptions](https://mastra.ai/reference/editor/agent-builder/agent-builder-options). When the picker is hidden, provide a `default` so new agents resolve a model.
41
-
42
- Registered providers (`provider: 'openai'`, `provider: 'anthropic'`, and so on) can omit `modelId` to allow every model from that provider.
43
-
44
- See the [`builder.configuration.agent.models`](https://mastra.ai/reference/editor/agent-builder/builder-models) reference for every admin-writable field and validation rules.
45
-
46
- ## Related
47
-
48
- - [Configuration](https://mastra.ai/docs/agent-builder/configuration): Wire the model policy into the broader Builder config.
49
- - [`builder.configuration.agent.models`](https://mastra.ai/reference/editor/agent-builder/builder-models): Full property list.
50
- - [Provider registry](https://github.com/mastra-ai/mastra/blob/main/packages/core/src/llm/model/provider-registry.json): Every model ID Mastra recognizes out of the box.
@@ -1,114 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Agent Builder overview
4
-
5
- > **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
6
-
7
- The Agent Builder lets you build, configure, and operate Mastra agents all within the UI. It runs inside your Mastra server, persists everything to `Mastra.storage`, and supports multi-tenant agent workflows with RBAC and channel integrations.
8
-
9
- > **📹 Watch:** Watch [Mastra Agent Builder overview](https://www.youtube.com/watch?v=AbdgIu4Z07I) to see how teams create and configure agents from the UI.
10
-
11
- - [**Configuration**](https://mastra.ai/docs/agent-builder/configuration): Toggle UI sections and pin admin-controlled defaults for every new agent.
12
- - [**Model policy**](https://mastra.ai/docs/agent-builder/model-policy): Restrict which providers and models the Builder exposes, and pin a default.
13
- - [**Memory**](https://mastra.ai/docs/agent-builder/memory): Configure the default memory shape for every Builder-created agent.
14
- - [**Workspace**](https://mastra.ai/docs/agent-builder/workspace): Configure the default filesystem, sandbox, and skills workspace for Builder-created agents.
15
- - [**Browser**](https://mastra.ai/docs/agent-builder/browser): Register browser providers and pin a default browser configuration.
16
- - [**Access control**](https://mastra.ai/docs/agent-builder/access-control): Gate the Builder behind Mastra RBAC roles and permissions.
17
- - [**Channels**](https://mastra.ai/docs/agent-builder/channels): Connect Builder-created agents to Slack and other channels.
18
- - [**Tool providers**](https://mastra.ai/docs/agent-builder/integrations): Connect Builder-created agents to third-party apps through OAuth-backed tool providers.
19
- - [**Skill registries**](https://mastra.ai/docs/agent-builder/skill-registries): Browse and install community skills from opt-in registries.
20
- - [**Deploying**](https://mastra.ai/docs/agent-builder/deploying): Swap local primitives for cloud-backed storage, filesystems, and sandboxes.
21
-
22
- For building agents entirely in code, see the [Agents overview](https://mastra.ai/docs/agents/overview). For editing code-defined agents through Studio, see the [Editor overview](https://mastra.ai/docs/editor/overview).
23
-
24
- ## Prerequisites
25
-
26
- The Agent Builder requires:
27
-
28
- - An existing Mastra project (Follow the [installation guide](https://mastra.ai/guides/getting-started/quickstart) to set up a new project)
29
- - **Storage**: A `@mastra/core` storage adapter on the `Mastra` instance. Agents, memory, and workspace state all persist through `Mastra.storage`.
30
- - **A builder agent**: Register a `builderAgent` created with the `createBuilderAgent()` factory from `@mastra/editor/ee` on `Mastra.agents`. The chat-based editor invokes it through the same `Mastra.getAgent(id)` lookup as any other agent. Without this registration, the chat-based editor returns 404.
31
- - **Model credentials**: `createBuilderAgent()` uses an OpenAI model by default, which requires `OPENAI_API_KEY`. To use a different provider, pass a `model` override to `createBuilderAgent({ model })` and set that provider's credentials instead.
32
-
33
- ## Get started
34
-
35
- Install `@mastra/editor` alongside a storage adapter. This example uses `@mastra/libsql`:
36
-
37
- **npm**:
38
-
39
- ```bash
40
- npm install @mastra/editor @mastra/libsql
41
- ```
42
-
43
- **pnpm**:
44
-
45
- ```bash
46
- pnpm add @mastra/editor @mastra/libsql
47
- ```
48
-
49
- **Yarn**:
50
-
51
- ```bash
52
- yarn add @mastra/editor @mastra/libsql
53
- ```
54
-
55
- **Bun**:
56
-
57
- ```bash
58
- bun add @mastra/editor @mastra/libsql
59
- ```
60
-
61
- The example below defines a storage adapter and registers a builder agent, plus enables the editor as explained in the prerequisites:
62
-
63
- ```typescript
64
- import { Mastra } from '@mastra/core/mastra'
65
- import { MastraEditor } from '@mastra/editor'
66
- import { createBuilderAgent } from '@mastra/editor/ee'
67
- import { LibSQLStore } from '@mastra/libsql'
68
-
69
- export const mastra = new Mastra({
70
- storage: new LibSQLStore({ id: 'mastra-storage', url: 'file:./mastra.db' }),
71
- agents: { builderAgent: createBuilderAgent() },
72
- editor: new MastraEditor({
73
- builder: {
74
- enabled: true,
75
- configuration: {
76
- agent: {
77
- memory: { observationalMemory: true },
78
- },
79
- },
80
- },
81
- }),
82
- })
83
- ```
84
-
85
- Start Mastra's development server:
86
-
87
- ```bash
88
- npx mastra dev
89
- ```
90
-
91
- For Agent Builder development, you can also use `mastra factory dev`, which uses the same dev runtime and flags as `mastra dev` and writes to the same `.mastra/output` directory. Both commands share a dev lock and can't run simultaneously in the same project. See the [CLI reference](https://mastra.ai/reference/cli/mastra) for details.
92
-
93
- The Agent Builder is mounted at `http://localhost:4111/agent-builder`.
94
-
95
- ## Disabling the Builder
96
-
97
- Set `enabled: false` to keep the config in place but turn the surface off:
98
-
99
- ```typescript
100
- new MastraEditor({
101
- builder: {
102
- enabled: false,
103
- },
104
- })
105
- ```
106
-
107
- Omitting the `builder` field has the same effect.
108
-
109
- ## Next steps
110
-
111
- - [Configuration](https://mastra.ai/docs/agent-builder/configuration): Toggle Builder surfaces and pin defaults for new agents.
112
- - [Access control](https://mastra.ai/docs/agent-builder/access-control): Gate the Builder with authentication and role-based access control.
113
- - [Deploying](https://mastra.ai/docs/agent-builder/deploying): Replace local development primitives with production-ready storage, filesystems, and sandboxes.
114
- - 📹 [Mastra Agent Builder workshop](https://www.youtube.com/watch?v=p2p_wb-rUPg\&t=666s)
@@ -1,31 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Skill registries
4
-
5
- > **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
6
-
7
- Registries let the Agent Builder browse and install community skills directly from the UI. All registries are opt-in. When no registry is enabled, the Builder hides registry browse UI entirely.
8
-
9
- ## Quickstart
10
-
11
- Enable the [skills.sh](https://skills.sh) registry:
12
-
13
- ```typescript
14
- import { MastraEditor } from '@mastra/editor'
15
-
16
- new MastraEditor({
17
- builder: {
18
- enabled: true,
19
- registries: {
20
- skillsSh: { enabled: true },
21
- },
22
- },
23
- })
24
- ```
25
-
26
- The Builder library tab now exposes a **Browse** view backed by skills.sh. End users can preview a skill, then install it into an agent. See the [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) for the full `registries` schema.
27
-
28
- ## Related
29
-
30
- - [Configuration](https://mastra.ai/docs/agent-builder/configuration): Wire registries alongside the rest of the Builder config.
31
- - [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options): Every field on `builder`.
@@ -1,62 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Workspace
4
-
5
- > **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
6
-
7
- A [workspace](https://mastra.ai/docs/workspace/overview) gives agents filesystem access, command execution, and skill loading. The Agent Builder pins a default workspace onto every new agent through `builder.configuration.agent.workspace`. End users can still override the workspace per agent through the Builder UI.
8
-
9
- ## Quickstart
10
-
11
- Pin an inline workspace snapshot as the Builder default:
12
-
13
- ```typescript
14
- import { Mastra } from '@mastra/core'
15
- import { MastraEditor } from '@mastra/editor'
16
-
17
- export const mastra = new Mastra({
18
- editor: new MastraEditor({
19
- builder: {
20
- enabled: true,
21
- configuration: {
22
- agent: {
23
- workspace: {
24
- type: 'inline',
25
- config: {
26
- name: 'project-workspace',
27
- filesystem: {
28
- provider: 'local',
29
- config: { basePath: './workspace' },
30
- },
31
- },
32
- },
33
- },
34
- },
35
- },
36
- }),
37
- })
38
- ```
39
-
40
- The Builder derives a deterministic id from the inline config and persists the snapshot, so identical inline configs are deduplicated across agents.
41
-
42
- ## Workspace references
43
-
44
- `configuration.agent.workspace` accepts a `StorageWorkspaceRef`:
45
-
46
- - **`{ type: 'inline', config }`**: Embeds a serialized workspace snapshot directly on the agent. Useful for per-agent, ad-hoc configurations.
47
- - **`{ type: 'id', workspaceId }`**: References a workspace already registered on the `Mastra` instance via `new Mastra({ workspace })` or `mastra.addWorkspace(...)`. Use this for shared, named workspaces.
48
-
49
- See the [StorageWorkspaceRef reference](https://mastra.ai/reference/editor/storage-workspace-ref) for both variants.
50
-
51
- ## Filesystem and sandbox
52
-
53
- A workspace combines a `filesystem` (file tools) and an optional `sandbox` (command execution). For local development, point both at the same directory so files written through the filesystem are immediately visible to commands in the sandbox.
54
-
55
- For cloud deployments, swap `LocalFilesystem` / `LocalSandbox` for managed providers (e.g., S3, E2B). See [Deploying](https://mastra.ai/docs/agent-builder/deploying) for the cloud-swap pattern.
56
-
57
- ## Related
58
-
59
- - [Workspace overview](https://mastra.ai/docs/workspace/overview): The underlying workspace model.
60
- - [Filesystem](https://mastra.ai/docs/workspace/filesystem) and [Sandbox](https://mastra.ai/docs/workspace/sandbox): The building blocks.
61
- - [BuilderAgentDefaults reference](https://mastra.ai/reference/editor/agent-builder/builder-agent-defaults): The full `workspace` field schema.
62
- - [Configuration](https://mastra.ai/docs/agent-builder/configuration): Wire `workspace` alongside the rest of the Builder config.
@@ -1,140 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Prompts
4
-
5
- Prompt blocks are reusable instruction templates that you compose into an agent's system prompt. Each block can contain plain text, template variables, and display conditions.
6
-
7
- Non-technical team members can edit and test prompt content before publishing changes. Every edit is versioned, so you can compare prompt variations and roll back. The history also records what changed over time.
8
-
9
- You can create and manage prompt blocks through the Studio UI or programmatically through the server API, then reference them across multiple agents.
10
-
11
- ## Quickstart
12
-
13
- 1. Go to the **Prompts** tab in Studio.
14
- 2. Select **Create prompt** and enter a name and your instruction text.
15
- 3. Save the prompt block and publish it.
16
- 4. Open an agent's **Instructions** section and select **Add block**.
17
- 5. Pick the saved prompt block from the block picker dialog.
18
-
19
- The block is added as a reference in the agent's instruction list. Changes to the original prompt block update every agent that references it.
20
-
21
- ## Block types
22
-
23
- An agent's instructions are made up of an ordered list of blocks. Each block is one of three types:
24
-
25
- | Type | Description |
26
- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
27
- | Inline text | Free-form text written directly in the agent's instruction list. Lives only on that agent. |
28
- | Prompt block | A standalone block with its own content, stored in the agent snapshot. You can save an inline block as a prompt block to reuse it. |
29
- | Prompt block reference | A pointer to a saved prompt block. The content is resolved at runtime from the referenced block. |
30
-
31
- To turn an inline block into a reusable prompt block, open the block's menu and select **Save as prompt block**. To reference an existing prompt block, select **Add block** and pick one from the dialog.
32
-
33
- ## Template variables
34
-
35
- Prompt blocks support `{{variable}}` syntax for runtime content. Variables are resolved at runtime from the agent's variables and request context.
36
-
37
- ```text
38
- You are helping {{userName}} with their {{task || 'request'}}.
39
- ```
40
-
41
- | Syntax | Behavior |
42
- | ----------------------------- | ------------------------------------------------------------------------------------------- |
43
- | `{{variableName}}` | Replaced with the variable value. Left as-is if not found. |
44
- | `{{nested.path.value}}` | Resolves dot-notation paths in the context object. |
45
- | `{{variable \|\| 'default'}}` | Uses the fallback value when the variable is missing. Single or double quotes are accepted. |
46
-
47
- Variables are passed through the agent's `variables` configuration or through [request context](https://mastra.ai/docs/server/request-context).
48
-
49
- ## Display conditions
50
-
51
- Each block can have a **display condition**. A rule group that controls whether the block is included in the final prompt. Conditions are evaluated at runtime against the agent's variables and request context.
52
-
53
- A rule group uses `AND` or `OR` logic with one or more conditions. Each condition checks a context field against a value using an operator:
54
-
55
- | Operator | Description |
56
- | ---------------------------------------------- | ------------------------------------- |
57
- | `equals` / `not_equals` | Exact match comparison. |
58
- | `contains` / `not_contains` | String inclusion or array membership. |
59
- | `greater_than` / `less_than` | Numeric comparison. |
60
- | `greater_than_or_equal` / `less_than_or_equal` | Numeric comparison with equality. |
61
- | `in` / `not_in` | Checks if a value is in an array. |
62
- | `exists` / `not_exists` | Checks if the field is present. |
63
-
64
- Rule groups can be nested, so you can combine `AND` and `OR` conditions for complex logic.
65
-
66
- In the Studio, open a block's **Display conditions** panel to set up rules visually. You can also configure conditions programmatically through the API. Blocks without conditions are always included.
67
-
68
- ## Programmatic control
69
-
70
- Prompt blocks can be managed from code through [`mastra.getEditor().prompt`](https://mastra.ai/reference/editor/mastra-editor). This is useful for seeding a set of starter prompts or syncing blocks between environments, or alternatively generating prompt variants from a script.
71
-
72
- Create a new prompt block with `editor.prompt.create()`:
73
-
74
- ```typescript
75
- import { mastra } from '../mastra'
76
-
77
- const editor = mastra.getEditor()!
78
-
79
- await editor.prompt.create({
80
- id: 'brand-voice',
81
- name: 'Brand voice',
82
- description: 'Acme Inc. tone and style guidelines',
83
- content:
84
- 'You write in a friendly, concise tone. Always address the user as {{userName || "there"}}.',
85
- })
86
- ```
87
-
88
- Update an existing block with `editor.prompt.update()`. Each update creates a new draft version:
89
-
90
- ```typescript
91
- import { mastra } from '../mastra'
92
-
93
- const editor = mastra.getEditor()!
94
-
95
- await editor.prompt.update({
96
- id: 'brand-voice',
97
- content: 'You write in a friendly, concise tone. Always greet the user by name when available.',
98
- })
99
- ```
100
-
101
- Use `editor.prompt.list()` to paginate through stored blocks or `editor.prompt.getById()` to fetch a specific block. To preview an agent's full instructions with a set of prompt blocks applied, call `editor.prompt.preview()` with the draft content.
102
-
103
- The same operations are available over HTTP through the Mastra server:
104
-
105
- | Method | Path | Description |
106
- | -------- | -------------------------------------------- | -------------------------------- |
107
- | `GET` | `/stored/prompt-blocks` | List all stored prompt blocks. |
108
- | `POST` | `/stored/prompt-blocks` | Create a stored prompt block. |
109
- | `GET` | `/stored/prompt-blocks/:storedPromptBlockId` | Get a stored prompt block by ID. |
110
- | `PATCH` | `/stored/prompt-blocks/:storedPromptBlockId` | Update a stored prompt block. |
111
- | `DELETE` | `/stored/prompt-blocks/:storedPromptBlockId` | Delete a stored prompt block. |
112
-
113
- Once a prompt block is created, reference it from an agent's `instructions` field as a `prompt_block_ref`:
114
-
115
- ```typescript
116
- import { mastra } from '../mastra'
117
-
118
- const editor = mastra.getEditor()!
119
-
120
- await editor.agent.update({
121
- id: 'support-agent',
122
- instructions: [
123
- { type: 'prompt_block_ref', id: 'brand-voice' },
124
- { type: 'text', content: 'Answer only questions about Acme products.' },
125
- ],
126
- })
127
- ```
128
-
129
- See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full `editor.prompt` API.
130
-
131
- ## Versioning
132
-
133
- Prompt blocks follow the same [versioning lifecycle](https://mastra.ai/docs/editor/overview) as agents. Each prompt block has a draft that you can edit and publish as a versioned snapshot. As a result, prompt content can be versioned and rolled back independently from the agent that uses it.
134
-
135
- When an agent references a prompt block, the resolved content comes from the block's active published version by default. During editing, draft content is used for previews. This separation makes it safe for non-technical team members to experiment with prompt wording. The published version stays stable until they explicitly activate a new one.
136
-
137
- ## Related
138
-
139
- - [Editor overview](https://mastra.ai/docs/editor/overview): Setup and versioning.
140
- - [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor): Full configuration options for the editor.
@@ -1,148 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Tools
4
-
5
- The editor gives you three ways to add tools to agents:
6
-
7
- - **Code tools**: Tools already registered in your Mastra instance.
8
- - **Integration providers**: Third-party tool platforms like Composio and Arcade.
9
- - **MCP clients**: Tools from MCP servers, configured as reusable client definitions.
10
-
11
- You can manage all three sources through the Studio UI or programmatically through the server API. Non-technical team members can browse tool catalogs and add tools to agents, plus test different tool combinations without code changes. Tool configurations are versioned alongside the rest of the agent, so you can roll back tool changes and compare versions, plus experiment safely.
12
-
13
- ## Description overrides
14
-
15
- Every tool, regardless of source, can have its description overridden at the agent level. This changes the description the agent sees during tool selection without modifying the original tool definition.
16
-
17
- This is useful when you want to:
18
-
19
- - Tailor a generic tool's purpose for a specific agent's context.
20
- - Add instructions about when or how to use a tool.
21
- - Clarify ambiguous tool descriptions.
22
-
23
- In the Studio, select a tool in the agent's tool list and edit the **Description** field. The override applies only to that agent.
24
-
25
- ## Display conditions
26
-
27
- Each tool in an agent can have display conditions, rule groups that control whether the tool is available at runtime. This uses the same rule system as [prompt blocks](https://mastra.ai/docs/editor/prompts).
28
-
29
- When a request comes in, the editor evaluates each tool's rules against the current context (agent variables and request context). Tools whose conditions aren't met are excluded from that run.
30
-
31
- Use display conditions to:
32
-
33
- - Restrict expensive tools to specific users or roles.
34
- - Enable tools based on feature flags or environment variables.
35
- - Conditionally include tools based on the conversation context.
36
-
37
- Tools without display conditions are always available.
38
-
39
- ## Studio
40
-
41
- Go to the **Agents** tab in Studio and select an agent to edit. Select the **Editor** tab. Scroll to the **Tools** section.
42
-
43
- Here you are able to add tools and configure MCP clients.
44
-
45
- Once you've made the changes, be sure to save the agent configuration.
46
-
47
- ## Integration providers
48
-
49
- Integration providers connect external tool platforms to the editor. Once registered, you can browse available tools in the Studio and add them to any agent.
50
-
51
- ### Composio
52
-
53
- [Composio](https://composio.dev) gives access to hundreds of integration tools organized into toolkits (GitHub, Slack, Gmail, and others).
54
-
55
- 1. Get a **project** API key (the `x-api-key` type) from your [Composio dashboard](https://dashboard.composio.dev).
56
-
57
- 2. Register the provider in your Editor configuration:
58
-
59
- ```typescript
60
- import { Mastra } from '@mastra/core'
61
- import { MastraEditor } from '@mastra/editor'
62
- import { ComposioToolProvider } from '@mastra/editor/composio'
63
-
64
- export const mastra = new Mastra({
65
- agents: {/* your agents */},
66
- editor: new MastraEditor({
67
- toolProviders: {
68
- composio: new ComposioToolProvider({
69
- apiKey: process.env.COMPOSIO_API_KEY!,
70
- }),
71
- },
72
- }),
73
- })
74
- ```
75
-
76
- Composio tool slugs use a format like `GITHUB_CREATE_ISSUE`. By default, tool calls use the connection pinned by the agent's author. To route calls to each end user's own account instead, see [connection scope](https://mastra.ai/docs/agent-builder/integrations) in the Agent Builder docs.
77
-
78
- ### Arcade
79
-
80
- [Arcade](https://arcade.dev) provides a curated catalog of tools with built-in authentication handling.
81
-
82
- 1. Get an API key from your Arcade dashboard.
83
-
84
- 2. Register the provider in your Editor configuration:
85
-
86
- ```typescript
87
- import { Mastra } from '@mastra/core'
88
- import { MastraEditor } from '@mastra/editor'
89
- import { ArcadeToolProvider } from '@mastra/editor/arcade'
90
-
91
- export const mastra = new Mastra({
92
- agents: {/* your agents */},
93
- editor: new MastraEditor({
94
- toolProviders: {
95
- arcade: new ArcadeToolProvider({
96
- apiKey: process.env.ARCADE_API_KEY!,
97
- }),
98
- },
99
- }),
100
- })
101
- ```
102
-
103
- Arcade tools use a `Toolkit.ToolName` format (for example, `Github.GetRepository`). The provider pre-seeds common toolkits to reduce API calls during browsing.
104
-
105
- ## MCP clients
106
-
107
- The editor lets you create stored MCP client configurations that connect to MCP servers. Once created, you can reference these clients in any agent to give it access to the server's tools.
108
-
109
- ### Transport types
110
-
111
- Stored MCP clients support two transport types:
112
-
113
- | Transport | Description |
114
- | --------- | ----------------------------------------------------------------------------------------------------------------- |
115
- | **stdio** | Launches a local process and communicates over standard I/O. Specify the `command` and optional `args` and `env`. |
116
- | **HTTP** | Connects to a remote MCP server over HTTP. Specify the server `url` and optional `headers`. |
117
-
118
- ### Tool filtering
119
-
120
- You can filter MCP tools at two levels:
121
-
122
- 1. **Client level**: On the MCP client itself, specify which tools from the server to include or exclude. This applies to every agent that references the client.
123
- 2. **Agent level**: On the agent's MCP client reference, further limit which tools are available. This lets you use the same MCP client in multiple agents while exposing different tool subsets.
124
-
125
- ### Tool namespacing
126
-
127
- Tools from MCP servers are namespaced as `serverName_toolName` to avoid conflicts. For example, a `search` tool from the `docs` server becomes `docs_search`.
128
-
129
- ### Conditional activation
130
-
131
- MCP client references in an agent can have display conditions, like [prompt blocks](https://mastra.ai/docs/editor/prompts). This lets you conditionally include MCP tools based on request context or agent variables.
132
-
133
- ## How tools are merged
134
-
135
- When an agent runs, tools from all sources are merged in this order:
136
-
137
- 1. Code tools
138
- 2. Integration tools
139
- 3. MCP tools
140
-
141
- If a tool ID exists in multiple sources, later sources take precedence. Description overrides set at the agent level always take priority over the original tool description. See the [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider) for the full provider API.
142
-
143
- ## Related
144
-
145
- - [Editor overview](https://mastra.ai/docs/editor/overview): Setup and versioning.
146
- - [Prompts](https://mastra.ai/docs/editor/prompts): Display conditions reference for prompt blocks.
147
- - [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider): Composio and Arcade API details.
148
- - [MCP overview](https://mastra.ai/docs/mcp/overview): General MCP documentation.