March 5, 2026
inputExamples to improve model tool-call accuracyTool definitions can now include inputExamples, which are passed through to models that support them (e.g., Anthropic’s input_examples) to demonstrate valid inputs and reduce malformed tool calls.
RequestContext (auth/cookie forwarding)@mastra/mcp adds requestContext support to custom fetch functions for MCP HTTP server definitions, enabling request-scoped forwarding of cookies/bearer tokens during tool execution while remaining backward compatible with (url, init) fetch signatures.
Provider stream errors are now consistently surfaced from generate()/resumeGenerate(), AI SDK errors are routed through the Mastra logger with structured context, client-side tools no longer lose history in stateless deployments, and memory.deleteThread()/deleteMessages() now automatically cleans up orphaned vector embeddings across supported vector stores.
Add inputExamples support on tool definitions to show AI models what valid tool inputs look like. Models that support this (e.g., Anthropic's input_examples) will receive the examples alongside the tool schema, improving tool call accuracy. (#12932)
inputExamples field to ToolAction, CoreTool, and Tool classconst weatherTool = createTool({
id: "get-weather",
description: "Get weather for a location",
inputSchema: z.object({
city: z.string(),
units: z.enum(["celsius", "fahrenheit"])
}),
inputExamples: [{ input: { city: "New York", units: "fahrenheit" } }, { input: { city: "Tokyo", units: "celsius" } }],
execute: async ({ city, units }) => {
return await fetchWeather(city, units);
}
});
dependencies updates: (#13209)
p-map@^7.0.4 ↗︎ (from ^7.0.3, in dependencies)dependencies updates: (#13210)
p-retry@^7.1.1 ↗︎ (from ^7.1.0, in dependencies)Update provider registry and model documentation with latest models and providers (33e2fd5)
Fixed execute_command tool timeout parameter to accept seconds instead of milliseconds, preventing agents from accidentally setting extremely short timeouts (#13799)
Skill tools are now stable across conversation turns and prompt-cache friendly. (#13744)
skill-activate → skill — returns full skill instructions directly in the tool resultskill-read-reference, skill-read-script, skill-read-asset → skill_readskill-search → skill_search<available_skills> in the system message is now sorted deterministicallyFixed Cloudflare Workers build failures when using @mastra/core. Local process execution now loads its runtime dependency lazily, preventing incompatible Node-only modules from being bundled during worker builds. (#13813)
Fix mimeType → mediaType typo in sendMessage file part construction. This caused file attachments to be routed through the V4 adapter instead of V5, preventing them from being correctly processed by AI SDK v5 providers. (#13833)
Fixed onIterationComplete feedback being discarded when it returns { continue: false } — feedback is now added to the conversation and the model gets one final turn to produce a text response before the loop stops. (#13759)
Fixed generate() and resumeGenerate() to always throw provider stream errors. Previously, certain provider errors were silently swallowed, returning false "successful" empty responses. Now errors are always surfaced to the caller, making retry logic reliable when providers fail transiently. (#13802)
Remove the default maxSteps limit so stopWhen can control sub-agent execution (#13764)
Fix suspendedToolRunId required error when it shouldn't be required (#13722)
Fixed subagent tool defaulting maxSteps to 50 when no stop condition is configured, preventing unbounded execution loops. When stopWhen is set, maxSteps is left to the caller. (#13777)
Fixed prompt failures by removing assistant messages that only contain sources before model calls. (#13790)
Fixed RequestContext constructor crashing when constructed from a deserialized plain object. (#13856)
Fixed LLM errors (generateText, generateObject, streamText, streamObject) being swallowed by the AI SDK's default handler instead of being routed through the Mastra logger. Errors now appear with structured context (runId, modelId, provider, etc.) in your logger, and streaming errors are captured via onError callbacks. (#13857)
Fixed workspace tool output truncation so it no longer gets prematurely cut off when short lines precede a very long line (e.g. minified JSON). Output now uses the full token budget instead of stopping at line boundaries, resulting in more complete tool results. (#13828)
Fixed subagent tool to default maxSteps to 50 when no stopWhen condition is configured, preventing unbounded agent loops. When stopWhen is set, maxSteps remains unset so the stop condition controls termination. (#13777)
semver@^7.7.4 ↗︎ (from ^7.7.2, in dependencies)41e48c1, 82469d3, 33e2fd5, 7ef6e2c, 08072ec, ef9d0f0, b12d2a5, fa37d39, b12d2a5, 1391f22, 71c38bf, f993c38, f51849a, 3ceb231, 9bf3a0d, cafa045, 1fd9ddb, 1391f22, ef888d2, e7a567c, 3626623, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
Fixes inline import() statements referencing workspace packages (via @internal/*) in publish .d.ts files (#13811)
Updated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
dependencies updates: (#13134)
jsonwebtoken@^9.0.3 ↗︎ (from ^9.0.2, in dependencies)dependencies updates: (#13135)
jwks-rsa@^3.2.2 ↗︎ (from ^3.2.0, in dependencies)ae52b89, 1ea40a9, 41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
lru-cache@^11.2.6 ↗︎ (from ^11.1.0, in dependencies)ae52b89, 1ea40a9, 41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
Fix agent losing conversation context ("amnesia") when using client-side tools with stateless server deployments. Recursive calls after tool execution now include the full conversation history when no threadId is provided. (#11476)
Updated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
couchbase@^4.6.1 ↗︎ (from ^4.6.0, in dependencies)41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, b12d2a5, d9d228c, 5576507, 79d69c9, 9fb4c06, 94f44b8, 13187db, 2ae5311, b5a8ea5, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
Added custom user-agent header to all Elasticsearch requests. Every request now identifies itself as mastra-elasticsearch/<version> via the user-agent header, enabling usage tracking in Elasticsearch server logs and analytics tools. (#13740)
Updated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, b12d2a5, d9d228c, 5576507, 79d69c9, 9fb4c06, 94f44b8, 13187db, 2ae5311, b5a8ea5, 6135ef4]:
dependencies updates: (#10195)
fastembed@^2.1.0 ↗︎ (from ^1.14.4, in dependencies)Add warmup() export to pre-download fastembed models without creating ONNX sessions. This prevents concurrent download race conditions when multiple consumers call FlagEmbedding.init() in parallel, which could corrupt the model archive and cause Z_BUF_ERROR. (#13752)
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, b12d2a5, d9d228c, 5576507, 79d69c9, 9fb4c06, 94f44b8, 13187db, 2ae5311, b5a8ea5, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, b12d2a5, d9d228c, 5576507, 79d69c9, 9fb4c06, 94f44b8, 13187db, 2ae5311, b5a8ea5, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, b12d2a5, d9d228c, 5576507, 79d69c9, 9fb4c06, 94f44b8, 13187db, 2ae5311, b5a8ea5, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, a8e2e2e, 33e2fd5, 7ef6e2c, 08072ec, ef9d0f0, b12d2a5, 3ada2da, fa37d39, b12d2a5, 1391f22, 71c38bf, f993c38, f51849a, 3ceb231, 9bf3a0d, cafa045, 1fd9ddb, 1391f22, ef888d2, e7a567c, 3626623, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
Added requestContext support to the custom fetch option in MCP client HTTP server definitions. The fetch function now receives the current request context as an optional third argument, enabling users to forward authentication cookies, bearer tokens, and other request-scoped data from the incoming request to remote MCP servers during tool execution. (#13773)
Example usage:
const mcp = new MCPClient({
servers: {
myServer: {
url: new URL("https://api.example.com/mcp"),
fetch: async (url, init, requestContext) => {
const headers = new Headers(init?.headers);
const cookie = requestContext?.get("cookie");
if (cookie) {
headers.set("cookie", cookie);
}
return fetch(url, { ...init, headers });
}
}
}
});
This change is fully backward-compatible — existing fetch functions with (url, init) signatures continue to work unchanged. Closes #13769.
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, 9e21667, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
Improved confidence in observational memory threshold behavior through expanded automated test coverage. No public API changes. (#13785)
Improved Observational Memory reliability: fixed future-date annotations producing invalid strings, fixed a duplicate inline-date matching bug, and hardened the process-level operation registry against concurrent operation tracking errors. (#13774)
Fixed buffered activation cleanup to respect the configured retention floor so message history does not collapse unexpectedly after activation. (#13745)
Fixed orphaned vector embeddings accumulating when memory threads or messages are deleted. Calling memory.deleteThread() or memory.deleteMessages() now automatically cleans up associated vector embeddings across all supported vector store backends. Cleanup is non-blocking and does not slow down the delete call. Also fixed updateMessages not cleaning up old vectors correctly when using a non-default index separator (e.g. Pinecone). (#12227)
Repeated token counts in OM are faster and more reliable, estimates are now persisted on metadata, and totals remain consistent after saving and loading conversations. (#13745)
Improved observational memory marker creation consistency for more reliable debugging and UI status behavior. No public API changes. (#13779)
Fixed observational memory token counting to use stored model output for tool results transformed with toModelOutput. (#13862)
Fix working memory data corruption when using resource scope across threads (#12415)
updateWorkingMemory() to prevent race conditions during concurrent updates__experimental_updateWorkingMemoryVNext() to detect template duplicates with whitespace variationsupdateWorkingMemoryTool to prevent LLM from accidentally wiping existing data by sending empty templateUpdated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
Fixed MongoDB observational memory buffering so legacy records with bufferedObservationChunks: null can append chunks safely and continue storing chunk buffers as arrays after activation. (#13803)
Updated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
@mastra/observability by requiring @mastra/core >= 1.9.0. (#13838)
This prevents installs with older core versions that can cause runtime errors.41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, 08072ec, ef9d0f0, b12d2a5, fa37d39, b12d2a5, 1391f22, 71c38bf, f993c38, f51849a, 3ceb231, 9bf3a0d, cafa045, 1fd9ddb, 1391f22, ef888d2, e7a567c, 3626623, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
dependencies updates: (#13236)
papaparse@^5.5.3 ↗︎ (from ^5.4.1, in dependencies)dependencies updates: (#13271)
@codemirror/merge@^6.12.0 ↗︎ (from ^6.10.2, in dependencies)@codemirror/view@^6.39.15 ↗︎ (from ^6.39.14, in dependencies)dependencies updates: (#13283)
semver@^7.7.4 ↗︎ (from ^7.7.2, in dependencies)dependencies updates: (#13771)
@uiw/codemirror-theme-dracula@^4.25.5 ↗︎ (from ^4.25.4, in dependencies)dependencies updates: (#13847)
@codemirror/autocomplete@^6.20.1 ↗︎ (from ^6.20.0, in dependencies)@codemirror/lang-javascript@^6.2.5 ↗︎ (from ^6.2.4, in dependencies)@codemirror/view@^6.39.16 ↗︎ (from ^6.39.15, in dependencies)Fixed experiment results page showing only 10 items, empty summary tab with no scorers, and scores not updating during experiment runs. (#13831)
Updated skill activation indicators to match new skill tool names. (#13744)
Fix saving traces and scores as dataset items in the Studio. (#13800)
Fixed Playground UI agent settings so temperature is no longer reset to 1 on refresh. Temperature now stays unset unless saved settings or code defaults provide a value. (#13778)
Fixed documentation link in empty datasets page pointing to the correct datasets docs instead of evals (#13872)
Fix wrong threads showing for agents on studio (#13789)
Fixed dev playground auth bypass not working in capabilities endpoint. The client now passes MastraClient headers (including x-mastra-dev-playground) to the auth capabilities endpoint, and the server returns disabled state when this header is present. This prevents the login gate from appearing in dev playground mode. (#13801)
Updated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, 88061a8, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, d1e26f0, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, d1e26f0, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, e9060ef, 13187db, 2ae5311, 6135ef4]:
Fixed Studio so custom gateway models appear in the provider list. (#13772) Improved /agents/providers API to include both built-in providers and providers from configured custom gateways.
Fixed dev playground auth bypass not working in capabilities endpoint. The client now passes MastraClient headers (including x-mastra-dev-playground) to the auth capabilities endpoint, and the server returns disabled state when this header is present. This prevents the login gate from appearing in dev playground mode. (#13801)
Updated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:
Fetched April 7, 2026