github mastra-ai/mastra @mastra/core@1.10.0
March 5, 2026

11 hours ago

Highlights

Tool inputExamples to improve model tool-call accuracy

Tool 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.

MCP client fetch hooks now receive 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.

Reliability + DX fixes for agents, streaming, and memory cleanup

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.

Changelog

@mastra/core@1.10.0

Minor Changes

  • 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)

    • Added optional inputExamples field to ToolAction, CoreTool, and Tool class
    const 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);
      }
    });

Patch Changes

  • dependencies updates: (#13209)

  • dependencies updates: (#13210)

  • 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)

    • Renamed skill-activateskill — returns full skill instructions directly in the tool result
    • Consolidated skill-read-reference, skill-read-script, skill-read-assetskill_read
    • Renamed skill-searchskill_search
    • <available_skills> in the system message is now sorted deterministically
  • Fixed 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 mimeTypemediaType 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 experiment pending count showing negative values when experiments are triggered from the Studio (#13831)
    • Fixed scorer prompt metadata (analysis context, generated prompts) being lost when saving experiment scores
  • 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)

@mastra/agent-builder@1.0.10

Patch Changes

@mastra/ai-sdk@1.1.2

Patch Changes

@mastra/arize@1.0.6

Patch Changes

@mastra/auth@1.0.1

Patch Changes

@mastra/auth-clerk@1.0.1

Patch Changes

@mastra/auth-cloud@1.1.1

Patch Changes

@mastra/auth-workos@1.1.1

Patch Changes

@mastra/braintrust@1.0.6

Patch Changes

@mastra/client-js@1.7.3

Patch Changes

@mastra/couchbase@1.0.2

Patch Changes

@mastra/datadog@1.0.5

Patch Changes

@mastra/deployer@1.10.0

Patch Changes

@mastra/deployer-cloud@1.10.0

Patch Changes

@mastra/deployer-cloudflare@1.1.7

Patch Changes

@mastra/deployer-netlify@1.0.11

Patch Changes

@mastra/deployer-vercel@1.1.1

Patch Changes

@mastra/elasticsearch@1.1.2

Patch Changes

@mastra/express@1.1.9

Patch Changes

@mastra/fastembed@1.0.1

Patch Changes

  • dependencies updates: (#10195)

  • 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)

@mastra/fastify@1.1.9

Patch Changes

@mastra/hono@1.1.9

Patch Changes

@mastra/koa@1.2.5

Patch Changes

@mastra/laminar@1.0.5

Patch Changes

@mastra/langfuse@1.0.5

Patch Changes

@mastra/langsmith@1.1.3

Patch Changes

@mastra/libsql@1.6.4

Patch Changes

@mastra/longmemeval@1.0.11

Patch Changes

@mastra/mcp@1.1.0

Minor Changes

  • 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.

Patch Changes

@mastra/mcp-docs-server@1.1.8

Patch Changes

@mastra/memory@1.6.1

Patch Changes

  • 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)

    • Add mutex protection to updateWorkingMemory() to prevent race conditions during concurrent updates
    • Add normalized whitespace comparison to __experimental_updateWorkingMemoryVNext() to detect template duplicates with whitespace variations
    • Add validation to updateWorkingMemoryTool to prevent LLM from accidentally wiping existing data by sending empty template
    • Improve template removal logic to handle line ending variations
  • Updated dependencies [41e48c1, 82469d3, 33e2fd5, 7ef6e2c, b12d2a5, fa37d39, b12d2a5, 71c38bf, f993c38, f51849a, 9bf3a0d, cafa045, 1fd9ddb, 6135ef4, d9d228c, 5576507, 79d69c9, 94f44b8, 13187db, 2ae5311, 6135ef4]:

    • @mastra/core@1.10.0

@mastra/mongodb@1.5.4

Patch Changes

@mastra/observability@1.3.1

Patch Changes

@mastra/opencode@0.0.8

Patch Changes

@mastra/otel-bridge@1.0.5

Patch Changes

@mastra/otel-exporter@1.0.5

Patch Changes

@mastra/pg@1.7.2

Patch Changes

@mastra/playground-ui@15.2.0

Patch Changes

  • dependencies updates: (#13236)

  • dependencies updates: (#13271)

  • dependencies updates: (#13283)

  • dependencies updates: (#13771)

  • dependencies updates: (#13847)

  • 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)

    • Traces with structured message content (e.g. multi-part content arrays) can now be saved as dataset items without validation errors
    • Score dialog now has a "Save as Dataset Item" button for scorer calibration workflows, pre-filling scorer input/output and expected score
    • Dataset output schema updated to match the full experiment output shape (text, object, toolCalls, files, usage, etc.)
  • 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]:

    • @mastra/core@1.10.0
    • @mastra/ai-sdk@1.1.2
    • @mastra/client-js@1.7.3
    • @mastra/react@0.2.9

@mastra/posthog@1.0.6

Patch Changes

@mastra/react@0.2.9

Patch Changes

@mastra/sentry@1.0.5

Patch Changes

@mastra/server@1.10.0

Patch Changes

Don't miss a new mastra release

NewReleases is sending notifications on new releases.