@mastra/server 0.0.0-mastra-2973-fast-mcp-removal-20250409163028 → 0.0.0-mastra-3171-llamaindex-pin-20250423175211

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 (36) hide show
  1. package/{LICENSE → LICENSE.md} +3 -1
  2. package/dist/_tsup-dts-rollup.d.cts +33 -24
  3. package/dist/_tsup-dts-rollup.d.ts +33 -24
  4. package/dist/{chunk-2JQC6JWP.js → chunk-3EJZQ6TQ.js} +4 -1
  5. package/dist/{chunk-YNSGUC2O.js → chunk-5JNVY6DU.js} +8 -4
  6. package/dist/{chunk-QH6XWSXP.cjs → chunk-5SWCVTNL.cjs} +38 -38
  7. package/dist/{chunk-CWSDZEZG.cjs → chunk-7IWQE76Z.cjs} +2 -2
  8. package/dist/{chunk-A7DF4ETD.cjs → chunk-CWUJ6DED.cjs} +1 -3
  9. package/dist/{chunk-4C3EPMMF.cjs → chunk-D3G23FP3.cjs} +12 -8
  10. package/dist/{chunk-5JOF627H.cjs → chunk-FPIWDH5Y.cjs} +6 -3
  11. package/dist/{chunk-GV52BII2.cjs → chunk-HCOPJZ4A.cjs} +13 -9
  12. package/dist/{chunk-ILW7XYNJ.js → chunk-LFOBHRFO.js} +17 -8
  13. package/dist/{chunk-VK6FX47H.js → chunk-OMN3UI6X.js} +38 -38
  14. package/dist/{chunk-BMA2ORRT.js → chunk-R4J7XQYU.js} +9 -5
  15. package/dist/{chunk-2YONKUWB.js → chunk-RE6YL32K.js} +6 -3
  16. package/dist/{chunk-VB7KH62D.cjs → chunk-SKBVVI24.cjs} +4 -1
  17. package/dist/{chunk-X37I6GZT.cjs → chunk-TZK63M5N.cjs} +23 -14
  18. package/dist/{chunk-DVPP5S6I.js → chunk-WTHDCRMY.js} +2 -2
  19. package/dist/{chunk-3RVHWGWO.js → chunk-YE2P6K2L.js} +1 -3
  20. package/dist/server/handlers/agents.cjs +7 -7
  21. package/dist/server/handlers/agents.js +1 -1
  22. package/dist/server/handlers/logs.cjs +4 -4
  23. package/dist/server/handlers/logs.js +1 -1
  24. package/dist/server/handlers/network.cjs +5 -5
  25. package/dist/server/handlers/network.js +1 -1
  26. package/dist/server/handlers/telemetry.cjs +3 -3
  27. package/dist/server/handlers/telemetry.js +1 -1
  28. package/dist/server/handlers/tools.cjs +5 -5
  29. package/dist/server/handlers/tools.js +1 -1
  30. package/dist/server/handlers/voice.cjs +4 -4
  31. package/dist/server/handlers/voice.js +1 -1
  32. package/dist/server/handlers/workflows.cjs +11 -11
  33. package/dist/server/handlers/workflows.js +1 -1
  34. package/dist/server/handlers.cjs +14 -14
  35. package/dist/server/handlers.js +7 -7
  36. package/package.json +5 -5
@@ -1,4 +1,6 @@
1
- Elastic License 2.0 (ELv2)
1
+ # Elastic License 2.0 (ELv2)
2
+
3
+ Copyright (c) 2025 Mastra AI, Inc.
2
4
 
3
5
  **Acceptance**
4
6
  By using the software, you agree to all of the terms and conditions below.
@@ -1,27 +1,27 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
- import { BaseLogMessage } from '@mastra/core';
3
+ import type { BaseLogMessage } from '@mastra/core/logger';
4
4
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core';
5
+ import { EvalRow } from '@mastra/core/storage';
6
6
  import { GenerateObjectResult } from 'ai';
7
7
  import { GenerateTextResult } from 'ai';
8
8
  import type { Mastra } from '@mastra/core/mastra';
9
- import type { Mastra as Mastra_2 } from '@mastra/core';
10
9
  import type { MastraMemory } from '@mastra/core/memory';
11
10
  import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
11
+ import { MessageType } from '@mastra/core/memory';
13
12
  import type { QueryResult } from '@mastra/core/vector';
14
13
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
15
- import { Step } from '@mastra/core';
16
- import { StepExecutionContext } from '@mastra/core';
17
- import { StepGraph } from '@mastra/core';
18
- import { StorageThreadType } from '@mastra/core';
14
+ import type { RuntimeContext } from '@mastra/core/runtime-context';
15
+ import { Step } from '@mastra/core/workflows';
16
+ import { StepExecutionContext } from '@mastra/core/workflows';
17
+ import { StepGraph } from '@mastra/core/workflows';
18
+ import { StorageThreadType } from '@mastra/core/memory';
19
19
  import type { ToolAction } from '@mastra/core/tools';
20
20
  import type { VercelTool } from '@mastra/core/tools';
21
21
  import type { Workflow } from '@mastra/core/workflows';
22
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
23
- import { WorkflowRunResult } from '@mastra/core';
24
- import { WorkflowRuns } from '@mastra/core';
22
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
23
+ import { WorkflowRunResult } from '@mastra/core/workflows';
24
+ import type { WorkflowRuns } from '@mastra/core/storage';
25
25
 
26
26
  export declare namespace agents {
27
27
  export {
@@ -87,23 +87,27 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
87
87
  metric: string | undefined;
88
88
  }>;
89
89
 
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
90
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
91
  agentId?: string;
92
92
  data: any;
93
+ runtimeContext: RuntimeContext;
93
94
  }): Promise<any>;
94
95
 
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
97
  data?: unknown;
98
+ runtimeContext: RuntimeContext;
97
99
  }) => Promise<any>;
98
100
 
99
- export declare function generateHandler({ mastra, agentId, body, }: Context & {
101
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
102
+ runtimeContext: RuntimeContext;
100
103
  agentId: string;
101
104
  body: GetBody<'generate'> & {
102
105
  resourceid?: string;
103
106
  };
104
107
  }): Promise<GenerateTextResult<any, any>>;
105
108
 
106
- export declare function generateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
109
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
110
+ runtimeContext: RuntimeContext;
107
111
  body: {
108
112
  messages?: Parameters<AgentNetwork['generate']>[0];
109
113
  } & Parameters<AgentNetwork['generate']>[1];
@@ -159,7 +163,7 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
159
163
 
160
164
  export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
161
165
 
162
- export declare function getLogsHandler({ mastra, transportId }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
166
+ export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
163
167
 
164
168
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
165
169
  transports: string[];
@@ -362,18 +366,20 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
362
366
 
363
367
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
364
368
 
365
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
369
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
366
370
  body: {
367
371
  stepId: string;
368
372
  context: any;
369
373
  };
374
+ runtimeContext: RuntimeContext;
370
375
  }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
371
376
 
372
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
377
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
373
378
  body: {
374
379
  stepId: string;
375
380
  context: any;
376
381
  };
382
+ runtimeContext: RuntimeContext;
377
383
  }): Promise<{
378
384
  message: string;
379
385
  }>;
@@ -386,12 +392,14 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
386
392
 
387
393
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
388
394
 
389
- export declare function startAsyncWorkflowHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
395
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
390
396
  triggerData?: unknown;
397
+ runtimeContext: RuntimeContext;
391
398
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
392
399
 
393
- export declare function startWorkflowRunHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
400
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
401
  triggerData?: unknown;
402
+ runtimeContext: RuntimeContext;
395
403
  }): Promise<{
396
404
  message: string;
397
405
  }>;
@@ -415,14 +423,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
415
423
  traceCount: number;
416
424
  }>;
417
425
 
418
- export declare function streamGenerateHandler({ mastra, agentId, body, }: Context & {
426
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
427
+ runtimeContext: RuntimeContext;
419
428
  agentId: string;
420
429
  body: GetBody<'stream'> & {
421
430
  resourceid?: string;
422
431
  };
423
432
  }): Promise<Response | undefined>;
424
433
 
425
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
434
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
435
+ runtimeContext: RuntimeContext;
426
436
  body: {
427
437
  messages?: Parameters<AgentNetwork['stream']>[0];
428
438
  } & Parameters<AgentNetwork['stream']>[1];
@@ -540,8 +550,7 @@ declare interface VoiceContext extends Context {
540
550
 
541
551
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
542
552
 
543
- declare interface WorkflowContext {
544
- mastra: Mastra_2;
553
+ declare interface WorkflowContext extends Context {
545
554
  workflowId?: string;
546
555
  runId?: string;
547
556
  }
@@ -1,27 +1,27 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
- import { BaseLogMessage } from '@mastra/core';
3
+ import type { BaseLogMessage } from '@mastra/core/logger';
4
4
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core';
5
+ import { EvalRow } from '@mastra/core/storage';
6
6
  import { GenerateObjectResult } from 'ai';
7
7
  import { GenerateTextResult } from 'ai';
8
8
  import type { Mastra } from '@mastra/core/mastra';
9
- import type { Mastra as Mastra_2 } from '@mastra/core';
10
9
  import type { MastraMemory } from '@mastra/core/memory';
11
10
  import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
11
+ import { MessageType } from '@mastra/core/memory';
13
12
  import type { QueryResult } from '@mastra/core/vector';
14
13
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
15
- import { Step } from '@mastra/core';
16
- import { StepExecutionContext } from '@mastra/core';
17
- import { StepGraph } from '@mastra/core';
18
- import { StorageThreadType } from '@mastra/core';
14
+ import type { RuntimeContext } from '@mastra/core/runtime-context';
15
+ import { Step } from '@mastra/core/workflows';
16
+ import { StepExecutionContext } from '@mastra/core/workflows';
17
+ import { StepGraph } from '@mastra/core/workflows';
18
+ import { StorageThreadType } from '@mastra/core/memory';
19
19
  import type { ToolAction } from '@mastra/core/tools';
20
20
  import type { VercelTool } from '@mastra/core/tools';
21
21
  import type { Workflow } from '@mastra/core/workflows';
22
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
23
- import { WorkflowRunResult } from '@mastra/core';
24
- import { WorkflowRuns } from '@mastra/core';
22
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
23
+ import { WorkflowRunResult } from '@mastra/core/workflows';
24
+ import type { WorkflowRuns } from '@mastra/core/storage';
25
25
 
26
26
  export declare namespace agents {
27
27
  export {
@@ -87,23 +87,27 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
87
87
  metric: string | undefined;
88
88
  }>;
89
89
 
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
90
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
91
  agentId?: string;
92
92
  data: any;
93
+ runtimeContext: RuntimeContext;
93
94
  }): Promise<any>;
94
95
 
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
97
  data?: unknown;
98
+ runtimeContext: RuntimeContext;
97
99
  }) => Promise<any>;
98
100
 
99
- export declare function generateHandler({ mastra, agentId, body, }: Context & {
101
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
102
+ runtimeContext: RuntimeContext;
100
103
  agentId: string;
101
104
  body: GetBody<'generate'> & {
102
105
  resourceid?: string;
103
106
  };
104
107
  }): Promise<GenerateTextResult<any, any>>;
105
108
 
106
- export declare function generateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
109
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
110
+ runtimeContext: RuntimeContext;
107
111
  body: {
108
112
  messages?: Parameters<AgentNetwork['generate']>[0];
109
113
  } & Parameters<AgentNetwork['generate']>[1];
@@ -159,7 +163,7 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
159
163
 
160
164
  export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
161
165
 
162
- export declare function getLogsHandler({ mastra, transportId }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
166
+ export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
163
167
 
164
168
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
165
169
  transports: string[];
@@ -362,18 +366,20 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
362
366
 
363
367
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
364
368
 
365
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
369
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
366
370
  body: {
367
371
  stepId: string;
368
372
  context: any;
369
373
  };
374
+ runtimeContext: RuntimeContext;
370
375
  }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
371
376
 
372
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
377
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
373
378
  body: {
374
379
  stepId: string;
375
380
  context: any;
376
381
  };
382
+ runtimeContext: RuntimeContext;
377
383
  }): Promise<{
378
384
  message: string;
379
385
  }>;
@@ -386,12 +392,14 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
386
392
 
387
393
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
388
394
 
389
- export declare function startAsyncWorkflowHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
395
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
390
396
  triggerData?: unknown;
397
+ runtimeContext: RuntimeContext;
391
398
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
392
399
 
393
- export declare function startWorkflowRunHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
400
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
401
  triggerData?: unknown;
402
+ runtimeContext: RuntimeContext;
395
403
  }): Promise<{
396
404
  message: string;
397
405
  }>;
@@ -415,14 +423,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
415
423
  traceCount: number;
416
424
  }>;
417
425
 
418
- export declare function streamGenerateHandler({ mastra, agentId, body, }: Context & {
426
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
427
+ runtimeContext: RuntimeContext;
419
428
  agentId: string;
420
429
  body: GetBody<'stream'> & {
421
430
  resourceid?: string;
422
431
  };
423
432
  }): Promise<Response | undefined>;
424
433
 
425
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
434
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
435
+ runtimeContext: RuntimeContext;
426
436
  body: {
427
437
  messages?: Parameters<AgentNetwork['stream']>[0];
428
438
  } & Parameters<AgentNetwork['stream']>[1];
@@ -540,8 +550,7 @@ declare interface VoiceContext extends Context {
540
550
 
541
551
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
542
552
 
543
- declare interface WorkflowContext {
544
- mastra: Mastra_2;
553
+ declare interface WorkflowContext extends Context {
545
554
  workflowId?: string;
546
555
  runId?: string;
547
556
  }
@@ -9,7 +9,10 @@ __export(logs_exports, {
9
9
  getLogsByRunIdHandler: () => getLogsByRunIdHandler,
10
10
  getLogsHandler: () => getLogsHandler
11
11
  });
12
- async function getLogsHandler({ mastra, transportId }) {
12
+ async function getLogsHandler({
13
+ mastra,
14
+ transportId
15
+ }) {
13
16
  try {
14
17
  validateBody({ transportId });
15
18
  const logs = await mastra.getLogs(transportId);
@@ -1,4 +1,4 @@
1
- import { stringify, esm_default } from './chunk-VK6FX47H.js';
1
+ import { stringify, esm_default } from './chunk-OMN3UI6X.js';
2
2
  import { validateBody } from './chunk-L7XE5QTW.js';
3
3
  import { handleError } from './chunk-3AHQ5RGN.js';
4
4
  import { __export, HTTPException } from './chunk-TRDNDNGQ.js';
@@ -55,7 +55,8 @@ function executeToolHandler(tools) {
55
55
  mastra,
56
56
  runId,
57
57
  toolId,
58
- data
58
+ data,
59
+ runtimeContext
59
60
  }) => {
60
61
  try {
61
62
  if (!toolId) {
@@ -76,7 +77,8 @@ function executeToolHandler(tools) {
76
77
  const result = await tool.execute({
77
78
  context: data,
78
79
  mastra,
79
- runId
80
+ runId,
81
+ runtimeContext
80
82
  });
81
83
  return result;
82
84
  } catch (error) {
@@ -88,7 +90,8 @@ async function executeAgentToolHandler({
88
90
  mastra,
89
91
  agentId,
90
92
  toolId,
91
- data
93
+ data,
94
+ runtimeContext
92
95
  }) {
93
96
  try {
94
97
  const agent = agentId ? mastra.getAgent(agentId) : null;
@@ -104,6 +107,7 @@ async function executeAgentToolHandler({
104
107
  }
105
108
  const result = await tool.execute({
106
109
  context: data,
110
+ runtimeContext,
107
111
  mastra,
108
112
  runId: agentId
109
113
  });