Mastra is an opinionated TypeScript framework for AI agents and workflows. Mirage ships a tool factory that exposes aDocumentation Index
Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
Use this file to discover all available pages before exploring further.
Workspace as five createTool() instances (execute, readFile, writeFile, editFile, ls) ready to plug into new Agent({ tools }).
Node only. The Mirage adapter is runtime-agnostic, but most Mastra setups (memory, evals, workflows) depend on Node APIs.
Install
Usage
Exports
| Symbol | Purpose |
|---|---|
mirageTools(ws) | Returns { execute, readFile, writeFile, editFile, ls }, each a createTool() from @mastra/core/tools with stable ids (mirage-execute, mirage-read-file, …). |
Tool reference
| Tool id | Input | Output |
|---|---|---|
mirage-execute | { command: string } | { stdout, stderr, exitCode } |
mirage-read-file | { path: string } | { content? , error? } |
mirage-write-file | { path, content } | { path } (auto-mkdirs parent) |
mirage-edit-file | { path, oldString, newString, replaceAll? } | { path?, occurrences?, error? } |
mirage-ls | { path: string } | { files?: { path, is_dir }[], error? } |
execute(inputData, context). You don’t need to call it directly, the agent runtime invokes it on tool calls.
Examples
examples/typescript/agents/mastra/ram_mastra.ts, RAM-only sandbox driven bygpt-5.4-mini.