Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

feat(ts): add support for Mastra v1

jkomyno66a2087c6e5c
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f78f0615c..29e1728af 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -18,6 +18,9 @@ catalogs:
'@composio/client':
specifier: 0.1.0-alpha.56
version: 0.1.0-alpha.56
+ '@mastra/core':
+ specifier: ^1.0.4
+ version: 1.0.4
'@modelcontextprotocol/sdk':
specifier: ^1.25.2
version: 1.25.3
@@ -456,7 +459,7 @@ importers:
version: link:../../packages/core
'@mastra/mcp':
specifier: ^0.14.4
dotenv:
specifier: ^16.4.1
version: 16.6.1
@@ -1185,7 +1188,7 @@ importers:
version: 0.52.0
'@mastra/mcp':
specifier: ^0.12.0
devDependencies:
'@composio/core':
specifier: workspace:*
@@ -1296,16 +1299,16 @@ importers:
ts/packages/providers/mastra:
dependencies:
- '@mastra/core':
- specifier: ^0.21.1
- '@mastra/mcp':
- specifier: ^0.12.0
+ '@mastra/schema-compat':
+ specifier: ^1.0.0
+ version: 1.0.0([email protected])
devDependencies:
'@composio/core':
specifier: workspace:*
version: link:../../core
+ '@mastra/core':
+ specifier: 'catalog:'
tsdown:
specifier: 'catalog:'
version: 0.18.4(@arethetypeswrong/[email protected])([email protected])([email protected])
@@ -1411,24 +1414,12 @@ packages:
peerDependencies:
zod: ^3.0.0
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-ZEBiiv1UhjGjBwUU63pFhLK5LCSlNDb1idY9K1oZHm5/Fda1cuTojf32tOp0opH0RPbPAN/F8fyyNjbU33n9Kw==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-egqr9PHqqX2Am5mn/Xs1C3+1/wphVKiAjpsVpW85eLc2WpW7AgiAg52DCBr4By9bw3UVVuMeR4uEO1X0dKDUDA==}
engines: {node: '>=18'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-v9i3GPEo4t3fGcSkQkc07xM6KJN75VUv7C1Mqmmsu2xD8lQwnQfsrgAXyNuWe20yGY0eHuheSPDZhiqsGKtH1g==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-W+cB1sOWvPcz9qiIsNtD+HxUrBUva2vWv2K1EFukuImX+HA0uZx3EyyOjhYQ9gtf/teqEG80M6OvJ7xx/VLV2A==}
engines: {node: '>=18'}
@@ -1441,12 +1432,6 @@ packages:
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-6LyuUrCZuiULg0rUV+kT4T2jG19oUntudorI4ttv1ARkSbwl8A39ue3rA487aDDy6fUScdbGFiV5Yv/o4gidVA==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-E7MTVE6vhWXQJzXQDvojwA9t5xlhWpxttCH3R/kUyiE6y0tT8Ay2dmZLO+bLpFBQ5qrvBMrjKWpDVQMoo6TJZg==}
engines: {node: '>=18'}
@@ -1471,12 +1456,6 @@ packages:
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-hnsqPCCSNKgpZRNDOAIXZs7OcUDM4ut5ggWxj2sjB4tNL/aBn/xrM7pJkqu+WuPowyrE60wPVSlw0LvtXAlMXQ==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-Q+lwBIeMprc/iM+vg1yGjvzRrp74l316wDpqWdbmd4VXXlllblzGsUgBLTeKvcEapFTgqk0FRETvSb58Y6dsfA==}
engines: {node: '>=18'}
@@ -1489,12 +1468,6 @@ packages:
peerDependencies:
zod: ^3.0.0
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-9mM6QS8k0ooH9qMC27nlrYLQmNDnO6Rk0JTmFo/yUxpABEWOcvQhMWNHbp9lFL6Ty5vkdINrujhsAQfWuEleOg==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-GIkR3+Fyif516ftXv+YPSPstnAHhcZxNoR2s8uSHhQ1yBT7I7aQYTVwpjAuYoT3GR+TeP50q7onj2/nDRbT2FQ==}
engines: {node: '>=18'}
@@ -1519,12 +1492,6 @@ packages:
peerDependencies:
zod: ^3.23.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-T1gZ76gEIwffep6MWI0QNy9jgoybUHE7TRaHB5k54K8mF91ciGFlbtCGxDYhMH3nCRergKwYFIDeFF0hJSIQHQ==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-ZtbdvYxdMoria+2SlNarEk6Hlgyf+zzcznlD55EAl+7VZvJaSg2sqPvwArY7L6TfDEDJsnCq0fdhBSkYo0Xqdg==}
engines: {node: '>=18'}
@@ -1555,6 +1522,12 @@ packages:
peerDependencies:
zod: ^3.25.76 || ^4.1.8
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-HyCyOls9I3a3e38+gtvOJOEjuw9KRcvbBnCL5GBuSmJvS9Jh9v3fz7pRC6ha1EUo/ZH1zwvLWYXBMtic8MTguA==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ zod: ^3.25.76 || ^4.1.8
+
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-bB4r6nfhBOpmoS9mePxjRoCy+LnzP3AfhyMGCkGL4Mn9clVNlqEeKj26zEKEtB6yoSVcT1IQ0Zh9fytwMCDnow==}
engines: {node: '>=18'}
@@ -1573,6 +1546,10 @@ packages:
resolution: {integrity: sha512-KCUwswvsC5VsW2PWFqF8eJgSCu5Ysj7m1TxiHTVA6g7k360bk0RNQENT8KTMAYEs+8fWPD3Uu4dEmzGHc+jGng==}
engines: {node: '>=18'}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-m9ka3ptkPQbaHHZHqDXDF9C9B5/Mav0KTdky1k2HZ3/nrW2t1AgObxIVPyGDWQNS9FXT/FS6PIoSjpcP/No8rQ==}
+ engines: {node: '>=18'}
+
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-2Xmoq6DBJqmSl80U6V9z5jJSJP7ehaJJQMy2iFUqTay06wdCqTnPVBBQbtEL8RCChenL+q5DC5H5WzU3vV3v8w==}
engines: {node: '>=18'}
@@ -1593,12 +1570,6 @@ packages:
peerDependencies:
zod: ^3.23.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-Xo4r5W/Wvi4mkCD98DoafNxj9V3xysUlWOeqAYpqKeKkNQ2xtOTly2MHq+gP6wKud0Y/mI7hemkCMQgH6HOwzQ==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-+VtaLZSxmoKnNeJGM9bbtbZ3QMkPFlBB4N8prngbrSnvU/hG8cNdvvSBW/rIk6/DHrc2R8nFntNIBQoIRuBdQw==}
engines: {node: '>=18'}
@@ -3068,21 +3039,29 @@ packages:
'@loaderkit/[email protected]':
resolution: {integrity: sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==}
+ '@lukeed/[email protected]':
+ resolution: {integrity: sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==}
+ engines: {node: '>=8'}
+
+ '@lukeed/[email protected]':
+ resolution: {integrity: sha512-qC72D4+CDdjGqJvkFMMEAtancHUQ7/d/tAiHf64z8MopFDmcrtbcJuerDtFceuAfQJ2pDSfCKCtbqoGBNnwg0w==}
+ engines: {node: '>=8'}
+
'@manypkg/[email protected]':
resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==}
'@manypkg/[email protected]':
resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==}
- '@mastra/[email protected]':
- resolution: {integrity: sha512-lyASrQCLiW+tleVRL16pBN5YfBg14IBEXYl2uGmrOsJ0QiPX/pHzcmYe0n7Oh48dYzu9YB/MgbQuY5PLzks8uQ==}
+ '@mastra/[email protected]':
+ resolution: {integrity: sha512-EjAPnX6pq7Y+7YN/kO92HIHqfk9Z/jtggE4Ww6wiL2Gvr01eFoNZSmsrIT4vTQAdD4oM41R2x1ndgtKFAJRH0w==}
engines: {node: '>=20'}
peerDependencies:
zod: ^3.25.0 || ^4.0.0
- '@mastra/[email protected]':
- resolution: {integrity: sha512-EjAPnX6pq7Y+7YN/kO92HIHqfk9Z/jtggE4Ww6wiL2Gvr01eFoNZSmsrIT4vTQAdD4oM41R2x1ndgtKFAJRH0w==}
- engines: {node: '>=20'}
+ '@mastra/[email protected]':
+ resolution: {integrity: sha512-kBSlYoUD3zjwvVMxFVneNHe0+cLKvXs1rZTGeRUHQdwVYo7guMXFu/qnsxizSGd+eNz976Ph81LixmqK2Ca7dA==}
+ engines: {node: '>=22.13.0'}
peerDependencies:
zod: ^3.25.0 || ^4.0.0
@@ -3098,16 +3077,16 @@ packages:
'@mastra/core': '>=0.20.1-0 <0.25.0-0'
zod: ^3.25.0 || ^4.0.0
- '@mastra/[email protected]':
- resolution: {integrity: sha512-oh3+enP3oYftZlmJAKQQj5VXR86KgTMwfMnwALZyLk04dPSWfVD2wGytoDg5Qbi3rX9qHj6g0rMNa0CUjR6aTg==}
+ '@mastra/[email protected]':
+ resolution: {integrity: sha512-LXEChx5n3bcuSFWQ5Wn9K2spLEpzHGf+DCnAeryuecpOo8VGLJ2QCK9Ugsnfjuc6hC0Ha73HvL1AD8zDhjmYOg==}
peerDependencies:
ai: ^4.0.0 || ^5.0.0
zod: ^3.25.0 || ^4.0.0
- '@mastra/[email protected]':
- resolution: {integrity: sha512-LXEChx5n3bcuSFWQ5Wn9K2spLEpzHGf+DCnAeryuecpOo8VGLJ2QCK9Ugsnfjuc6hC0Ha73HvL1AD8zDhjmYOg==}
+ '@mastra/[email protected]':
+ resolution: {integrity: sha512-jR5QsibhCO3lh2Vv3hNifd5XaKFnOV7ecduZyNxNg21Fw1+59ozpHkNtUAmDQW88uwvx/qHu1dKN/XtOhwWeyw==}
+ engines: {node: '>=22.13.0'}
peerDependencies:
- ai: ^4.0.0 || ^5.0.0
zod: ^3.25.0 || ^4.0.0
'@modelcontextprotocol/[email protected]':
@@ -3289,13 +3268,6 @@ packages:
peerDependencies:
zod: ^3.25.40 || ^4.0
- '@openrouter/[email protected]':
- resolution: {integrity: sha512-stuIwq7Yb7DNmk3GuCtz+oS3nZOY4TXEV3V5KsknDGQN7Fpu3KRMQVWRc1J073xKdf0FC9EHOctSyzsACmp5Ag==}
- engines: {node: '>=18'}
- peerDependencies:
- ai: ^5.0.0
- zod: ^3.24.1 || ^v4
-
'@openrouter/[email protected]':
resolution: {integrity: sha512-a6Nc8dPRHakRH9966YJ/HZJhLOds7DuPTscNZDoAr+Aw+tEFUlacSJMvb/b3gukn74mgbuaJRji9YOn62ipfVg==}
engines: {node: '>=18'}
@@ -4310,6 +4282,67 @@ packages:
'@speed-highlight/[email protected]':
resolution: {integrity: sha512-G4ewlBNhUtlLvrJTb88d2mdy2KRijzs4UhnlrOSRT4bmjh/IqNElZa3zkrZ+TC47TwtlDWzVLFADljF1Ijp5hA==}
+ '@standard-community/[email protected]':
+ resolution: {integrity: sha512-4+ZPorwDRt47i+O7RjyuaxHRK/37QY/LmgxlGrRrSTLYoFatEOzvqIc85GTlM18SFZ5E91C+v0o/M37wZPpUHA==}
+ peerDependencies:
+ '@standard-schema/spec': ^1.0.0
+ '@types/json-schema': ^7.0.15
+ '@valibot/to-json-schema': ^1.3.0
+ arktype: ^2.1.20
+ effect: ^3.16.8
+ quansync: ^0.2.11
+ sury: ^10.0.0
+ typebox: ^1.0.17
+ valibot: ^1.1.0
+ zod: ^3.25.0 || ^4.0.0
+ zod-to-json-schema: ^3.24.5
+ peerDependenciesMeta:
+ '@valibot/to-json-schema':
+ optional: true
+ arktype:
+ optional: true
+ effect:
+ optional: true
+ sury:
+ optional: true
+ typebox:
+ optional: true
+ valibot:
+ optional: true
+ zod:
+ optional: true
+ zod-to-json-schema:
+ optional: true
+
+ '@standard-community/[email protected]':
+ resolution: {integrity: sha512-htj+yldvN1XncyZi4rehbf9kLbu8os2Ke/rfqoZHCMHuw34kiF3LP/yQPdA0tQ940y8nDq3Iou8R3wG+AGGyvg==}
+ peerDependencies:
+ '@standard-community/standard-json': ^0.3.5
+ '@standard-schema/spec': ^1.0.0
+ arktype: ^2.1.20
+ effect: ^3.17.14
+ openapi-types: ^12.1.3
+ sury: ^10.0.0
+ typebox: ^1.0.0
+ valibot: ^1.1.0
+ zod: ^3.25.0 || ^4.0.0
+ zod-openapi: ^4
+ peerDependenciesMeta:
+ arktype:
+ optional: true
+ effect:
+ optional: true
+ sury:
+ optional: true
+ typebox:
+ optional: true
+ valibot:
+ optional: true
+ zod:
+ optional: true
+ zod-openapi:
+ optional: true
+
'@standard-schema/[email protected]':
resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}
@@ -4628,12 +4661,6 @@ packages:
react:
optional: true
- resolution: {integrity: sha512-80U/3kmdBW6g+JkLXpz/P2EwkyEaWlPlYtuLUpx/JYK9F7WZh9NnkYoh1KvUi1Sbpo0NyurBTvX0a2AG9mmbDA==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.25.76 || ^4.1.8
-
resolution: {integrity: sha512-8zBx0b/owis4eJI2tAlV8a1Rv0BANmLxontcAelkLNwEHhgfgXeKpDkhNB6OgV+BJSwboIUDkgd9312DdJnCOQ==}
engines: {node: '>=18'}
@@ -5774,6 +5801,21 @@ packages:
zod-openapi:
optional: true
+ resolution: {integrity: sha512-t3u4v8YCltExDl4d9cLqg/mcrYFSs9Gjb5puF1CePPrvv1JQOo1Kc50HAmGt47CWHIoc/W8Q9LY3t3yqU0dxFw==}
+ peerDependencies:
+ '@hono/standard-validator': ^0.2.0
+ '@standard-community/standard-json': ^0.3.5
+ '@standard-community/standard-openapi': ^0.2.9
+ '@types/json-schema': ^7.0.15
+ hono: ^4.8.3
+ openapi-types: ^12.1.3
+ peerDependenciesMeta:
+ '@hono/standard-validator':
+ optional: true
+ hono:
+ optional: true
+
resolution: {integrity: sha512-WemPi9/WfyMwZs+ZUXdiwcCh9Y+m7L+8vki9MzDw3jJ+W9Lc+12HGsd368Qc1vZi1xwW8BWMMsnK5efYKPdt4g==}
engines: {node: '>=16.9.0'}
@@ -7892,6 +7934,9 @@ packages:
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
engines: {node: '>=0.4'}
+ resolution: {integrity: sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==}
+
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
@@ -7980,38 +8025,12 @@ snapshots:
'@ai-sdk/provider-utils': 2.2.8([email protected])
zod: 4.3.6
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.10([email protected])
- zod: 4.3.6
-
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.12([email protected])
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider': 2.0.0
'@ai-sdk/provider-utils': 3.0.12([email protected])
zod: 4.3.6
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.10([email protected])
- '@vercel/oidc': 3.1.0
- zod: 4.3.6
-
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.17([email protected])
- '@vercel/oidc': 3.0.5
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider': 2.0.0
@@ -8026,18 +8045,6 @@ snapshots:
'@vercel/oidc': 3.1.0
zod: 4.3.6
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.10([email protected])
- zod: 4.3.6
-
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.17([email protected])
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider': 2.0.0
@@ -8058,30 +8065,12 @@ snapshots:
pkce-challenge: 5.0.1
zod: 4.3.6
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.16([email protected])
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider': 2.0.0
'@ai-sdk/provider-utils': 3.0.16([email protected])
zod: 4.3.6
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.10([email protected])
- zod: 4.3.6
-
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.12([email protected])
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider': 2.0.0
@@ -8094,18 +8083,6 @@ snapshots:
'@ai-sdk/provider-utils': 2.2.8([email protected])
zod: 4.3.6
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.10([email protected])
- zod: 4.3.6
-
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.12([email protected])
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider': 2.0.0
@@ -8138,13 +8115,6 @@ snapshots:
secure-json-parse: 2.7.0
zod: 4.3.6
- dependencies:
- '@ai-sdk/provider': 2.0.0
- '@standard-schema/spec': 1.1.0
- eventsource-parser: 3.0.6
- zod: 4.3.6
-
dependencies:
'@ai-sdk/provider': 2.0.0
@@ -8159,44 +8129,44 @@ snapshots:
eventsource-parser: 3.0.6
zod: 4.3.6
dependencies:
'@ai-sdk/provider': 2.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
- zod: 3.25.76
+ zod: 4.3.6
dependencies:
'@ai-sdk/provider': 2.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
zod: 4.3.6
dependencies:
'@ai-sdk/provider': 2.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
- zod: 3.25.76
+ zod: 4.3.6
dependencies:
- '@ai-sdk/provider': 2.0.0
+ '@ai-sdk/provider': 2.0.1
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
zod: 4.3.6
dependencies:
- '@ai-sdk/provider': 2.0.0
+ '@ai-sdk/provider': 3.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
- zod: 4.3.6
+ zod: 3.25.76
dependencies:
- '@ai-sdk/provider': 2.0.1
+ '@ai-sdk/provider': 3.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
zod: 4.3.6
@@ -8220,19 +8190,13 @@ snapshots:
dependencies:
json-schema: 0.4.0
- '@ai-sdk/[email protected]':
+ '@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0
+ '@ai-sdk/[email protected]':
dependencies:
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- react: 18.3.1
- swr: 2.3.8([email protected])
- throttleit: 2.1.0
- optionalDependencies:
- zod: 3.25.76
+ json-schema: 0.4.0
dependencies:
@@ -8258,20 +8222,6 @@ snapshots:
zod: 4.3.6
zod-to-json-schema: 3.25.1([email protected])
- dependencies:
- '@ai-sdk/openai-compatible': 1.0.19([email protected])
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.10([email protected])
- zod: 4.3.6
-
- dependencies:
- '@ai-sdk/openai-compatible': 1.0.22([email protected])
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.12([email protected])
- zod: 3.25.76
-
dependencies:
'@ai-sdk/openai-compatible': 1.0.22([email protected])
@@ -9641,6 +9591,12 @@ snapshots:
dependencies:
'@braidai/lang': 1.1.2
+ '@lukeed/[email protected]': {}
+
+ '@lukeed/[email protected]':
+ dependencies:
+ '@lukeed/csprng': 1.1.0
+
'@manypkg/[email protected]':
dependencies:
'@babel/runtime': 7.28.6
@@ -9657,22 +9613,23 @@ snapshots:
globby: 11.1.0
read-yaml-file: 1.1.0
dependencies:
'@a2a-js/sdk': 0.2.5
- '@ai-sdk/anthropic-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/google-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/openai-compatible-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/openai-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/anthropic-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/google-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/mistral-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/openai-compatible-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/openai-v5': '@ai-sdk/[email protected]([email protected])'
'@ai-sdk/provider': 1.1.3
'@ai-sdk/provider-utils': 2.2.8([email protected])
- '@ai-sdk/provider-utils-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/provider-utils-v5': '@ai-sdk/[email protected]([email protected])'
'@ai-sdk/provider-v5': '@ai-sdk/[email protected]'
'@ai-sdk/ui-utils': 1.2.11([email protected])
- '@ai-sdk/xai-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/xai-v5': '@ai-sdk/[email protected]([email protected])'
'@isaacs/ttlcache': 1.4.1
'@opentelemetry/api': 1.9.0
'@opentelemetry/auto-instrumentations-node': 0.62.2(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))
'@opentelemetry/core': 2.5.0(@opentelemetry/[email protected])
@@ -9688,14 +9645,14 @@ snapshots:
'@opentelemetry/semantic-conventions': 1.39.0
'@sindresorhus/slugify': 2.2.1
date-fns: 3.6.0
dotenv: 16.6.1
hono: 4.11.5
js-tiktoken: 1.0.21
json-schema: 0.4.0
- json-schema-to-zod: 2.7.0
+ lru-cache: 11.2.5
p-map: 7.0.4
p-retry: 7.1.1
pino: 9.14.0
@@ -9722,142 +9679,76 @@ snapshots:
- valibot
- zod-openapi
dependencies:
'@a2a-js/sdk': 0.2.5
- '@ai-sdk/anthropic-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/google-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/mistral-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/openai-compatible-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/openai-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
'@ai-sdk/provider-utils-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/provider-utils-v6': '@ai-sdk/[email protected]([email protected])'
'@ai-sdk/provider-v5': '@ai-sdk/[email protected]'
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- '@ai-sdk/xai-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/provider-v6': '@ai-sdk/[email protected]'
+ '@ai-sdk/ui-utils-v5': '@ai-sdk/[email protected]([email protected])'
'@isaacs/ttlcache': 1.4.1
- '@opentelemetry/api': 1.9.0
- '@opentelemetry/auto-instrumentations-node': 0.62.2(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))
- '@opentelemetry/core': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/exporter-trace-otlp-grpc': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/exporter-trace-otlp-http': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/otlp-exporter-base': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/otlp-transformer': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/resources': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-metrics': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-node': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-trace-base': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-trace-node': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/semantic-conventions': 1.39.0
+ '@lukeed/uuid': 2.0.1
+ '@mastra/schema-compat': 1.0.0([email protected])
+ '@modelcontextprotocol/sdk': 1.25.3(@cfworker/[email protected])([email protected])([email protected])
'@sindresorhus/slugify': 2.2.1
- date-fns: 3.6.0
- dotenv: 16.6.1
+ dotenv: 17.2.3
hono: 4.11.5
js-tiktoken: 1.0.21
json-schema: 0.4.0
lru-cache: 11.2.5
p-map: 7.0.4
p-retry: 7.1.1
- pino: 9.14.0
- pino-pretty: 13.1.3
radash: 12.1.1
- sift: 17.1.3
- xstate: 5.25.1
+ xxhash-wasm: 1.1.0
zod: 3.25.76
- zod-to-json-schema: 3.25.1([email protected])
transitivePeerDependencies:
- - '@hono/arktype-validator'
- - '@hono/effect-validator'
- - '@hono/typebox-validator'
- - '@hono/valibot-validator'
- - '@hono/zod-validator'
- - '@sinclair/typebox'
- - '@valibot/to-json-schema'
- - arktype
- - effect
- - encoding
+ - '@cfworker/json-schema'
+ - '@hono/standard-validator'
+ - '@standard-community/standard-json'
+ - '@standard-community/standard-openapi'
+ - '@types/json-schema'
- openapi-types
- - react
- supports-color
- - valibot
- - zod-openapi
dependencies:
'@a2a-js/sdk': 0.2.5
- '@ai-sdk/anthropic-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/google-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/mistral-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/openai-compatible-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/openai-v5': '@ai-sdk/[email protected]([email protected])'
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
'@ai-sdk/provider-utils-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/provider-utils-v6': '@ai-sdk/[email protected]([email protected])'
'@ai-sdk/provider-v5': '@ai-sdk/[email protected]'
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- '@ai-sdk/xai-v5': '@ai-sdk/[email protected]([email protected])'
+ '@ai-sdk/provider-v6': '@ai-sdk/[email protected]'
+ '@ai-sdk/ui-utils-v5': '@ai-sdk/[email protected]([email protected])'
'@isaacs/ttlcache': 1.4.1
- '@opentelemetry/api': 1.9.0
- '@opentelemetry/auto-instrumentations-node': 0.62.2(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))
- '@opentelemetry/core': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/exporter-trace-otlp-grpc': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/exporter-trace-otlp-http': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/otlp-exporter-base': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/otlp-transformer': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/resources': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-metrics': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-node': 0.203.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-trace-base': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/sdk-trace-node': 2.5.0(@opentelemetry/[email protected])
- '@opentelemetry/semantic-conventions': 1.39.0
+ '@lukeed/uuid': 2.0.1
+ '@mastra/schema-compat': 1.0.0([email protected])
+ '@modelcontextprotocol/sdk': 1.25.3(@cfworker/[email protected])([email protected])([email protected])
'@sindresorhus/slugify': 2.2.1
- date-fns: 3.6.0
- dotenv: 16.6.1
+ dotenv: 17.2.3
hono: 4.11.5
js-tiktoken: 1.0.21
json-schema: 0.4.0
lru-cache: 11.2.5
p-map: 7.0.4
p-retry: 7.1.1
- pino: 9.14.0
- pino-pretty: 13.1.3
radash: 12.1.1
- sift: 17.1.3
- xstate: 5.25.1
+ xxhash-wasm: 1.1.0
zod: 4.3.6
- zod-to-json-schema: 3.25.1([email protected])
transitivePeerDependencies:
- - '@hono/arktype-validator'
- - '@hono/effect-validator'
- - '@hono/typebox-validator'
- - '@hono/valibot-validator'
- - '@hono/zod-validator'
- - '@sinclair/typebox'
- - '@valibot/to-json-schema'
- - arktype
- - effect
- - encoding
+ - '@cfworker/json-schema'
+ - '@hono/standard-validator'
+ - '@standard-community/standard-json'
+ - '@standard-community/standard-openapi'
+ - '@types/json-schema'
- openapi-types
- - react
- supports-color
- - valibot
- - zod-openapi
dependencies:
'@apidevtools/json-schema-ref-parser': 14.2.1(@types/[email protected])
'@modelcontextprotocol/sdk': 1.25.3(@cfworker/[email protected])([email protected])([email protected])
date-fns: 4.1.0
exit-hook: 4.0.0
@@ -9872,10 +9763,10 @@ snapshots:
- hono
- supports-color
dependencies:
'@apidevtools/json-schema-ref-parser': 14.2.1(@types/[email protected])
'@modelcontextprotocol/sdk': 1.25.3(@cfworker/[email protected])([email protected])([email protected])
date-fns: 4.1.0
exit-hook: 4.0.0
@@ -9890,10 +9781,10 @@ snapshots:
- hono
- supports-color
dependencies:
'@apidevtools/json-schema-ref-parser': 14.2.1(@types/[email protected])
'@modelcontextprotocol/sdk': 1.25.3(@cfworker/[email protected])([email protected])([email protected])
date-fns: 4.1.0
exit-hook: 4.0.0
@@ -9908,29 +9799,26 @@ snapshots:
- hono
- supports-color
dependencies:
json-schema: 0.4.0
+ json-schema-to-zod: 2.7.0
zod: 4.3.6
zod-from-json-schema: 0.5.2
zod-from-json-schema-v3: [email protected]
zod-to-json-schema: 3.25.1([email protected])
dependencies:
- json-schema: 0.4.0
json-schema-to-zod: 2.7.0
zod: 3.25.76
zod-from-json-schema: 0.5.2
zod-from-json-schema-v3: [email protected]
zod-to-json-schema: 3.25.1([email protected])
dependencies:
- json-schema: 0.4.0
json-schema-to-zod: 2.7.0
zod: 4.3.6
zod-from-json-schema: 0.5.2
@@ -10213,17 +10101,6 @@ snapshots:
- utf-8-validate
- ws
- dependencies:
- zod: 4.3.6
-
- dependencies:
- '@openrouter/sdk': 0.1.27
- zod: 3.25.76
-
dependencies:
'@openrouter/sdk': 0.1.27
@@ -11290,6 +11167,44 @@ snapshots:
'@speed-highlight/[email protected]': {}
+ dependencies:
+ '@standard-schema/spec': 1.1.0
+ '@types/json-schema': 7.0.15
+ quansync: 1.0.0
+ optionalDependencies:
+ effect: 3.19.15
+ zod: 3.25.76
+ zod-to-json-schema: 3.25.1([email protected])
+
+ dependencies:
+ '@standard-schema/spec': 1.1.0
+ '@types/json-schema': 7.0.15
+ quansync: 1.0.0
+ optionalDependencies:
+ effect: 3.19.15
+ zod: 4.3.6
+ zod-to-json-schema: 3.25.1([email protected])
+
+ dependencies:
+ '@standard-schema/spec': 1.1.0
+ openapi-types: 12.1.3
+ optionalDependencies:
+ effect: 3.19.15
+ zod: 3.25.76
+
+ dependencies:
+ '@standard-schema/spec': 1.1.0
+ openapi-types: 12.1.3
+ optionalDependencies:
+ effect: 3.19.15
+ zod: 4.3.6
+
'@standard-schema/[email protected]': {}
@@ -11665,18 +11580,6 @@ snapshots:
dependencies:
humanize-ms: 1.2.1
- dependencies:
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- '@ai-sdk/react': 1.2.12([email protected])([email protected])
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- '@opentelemetry/api': 1.9.0
- jsondiffpatch: 0.6.0
- zod: 3.25.76
- optionalDependencies:
- react: 18.3.1
-
dependencies:
'@ai-sdk/provider': 1.1.3
@@ -11689,22 +11592,6 @@ snapshots:
optionalDependencies:
react: 18.3.1
- dependencies:
- '@ai-sdk/gateway': 1.0.33([email protected])
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.10([email protected])
- '@opentelemetry/api': 1.9.0
- zod: 4.3.6
-
- dependencies:
- '@ai-sdk/gateway': 2.0.12([email protected])
- '@ai-sdk/provider': 2.0.0
- '@ai-sdk/provider-utils': 3.0.17([email protected])
- '@opentelemetry/api': 1.9.0
- zod: 3.25.76
-
dependencies:
'@ai-sdk/gateway': 2.0.12([email protected])
@@ -12934,23 +12821,32 @@ snapshots:
dependencies:
json-schema-walker: 2.0.0
openapi-types: 12.1.3
optionalDependencies:
effect: 3.19.15
hono: 4.11.5
- zod: 3.25.76
+ zod: 4.3.6
dependencies:
- json-schema-walker: 2.0.0
+ '@types/json-schema': 7.0.15
+ openapi-types: 12.1.3
+ optionalDependencies:
+ hono: 4.11.5
+
+ dependencies:
+ '@types/json-schema': 7.0.15
openapi-types: 12.1.3
optionalDependencies:
- effect: 3.19.15
hono: 4.11.5
- zod: 4.3.6
@@ -15313,6 +15209,8 @@ snapshots:
+
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 2de781855..261057985 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -19,6 +19,7 @@ catalog:
'@cloudflare/vitest-pool-workers': ^0.9.2
'@cloudflare/workers-types': ^4.20250917.0
'@composio/client': 0.1.0-alpha.56
+ '@mastra/core': ^1.0.4
'@modelcontextprotocol/sdk': ^1.25.2
ai: ^6.0.27
hono: ^4.11.4
diff --git a/ts/packages/providers/mastra/package.json b/ts/packages/providers/mastra/package.json
index bbd1251d6..485d898de 100644
--- a/ts/packages/providers/mastra/package.json
+++ b/ts/packages/providers/mastra/package.json
@@ -31,7 +31,8 @@
"scripts": {
"clean": "git clean -xdf node_modules",
"build": "bun run --bun tsdown",
- "test": "vitest run"
+ "test": "vitest run",
+ "typecheck": "tsc --noEmit --skipLibCheck"
},
"keywords": [
"composio",
@@ -43,14 +44,18 @@
"packageManager": "[email protected]",
"peerDependencies": {
"@composio/core": "0.5.5",
- "@mastra/core": "^0.21.1",
- "@mastra/mcp": "^0.12.0"
+ "@mastra/core": "^1.0.4",
+ "zod": "^3.25 || ^4"
},
"devDependencies": {
"@composio/core": "workspace:*",
+ "@mastra/core": "catalog:",
"tsdown": "catalog:",
"typescript": "catalog:",
"vitest": "^3.1.4",
"zod": "catalog:"
+ },
+ "dependencies": {
+ "@mastra/schema-compat": "^1.0.0"
}
}
diff --git a/ts/packages/providers/mastra/src/index.ts b/ts/packages/providers/mastra/src/index.ts
index f45e787fd..dccae6054 100644
--- a/ts/packages/providers/mastra/src/index.ts
+++ b/ts/packages/providers/mastra/src/index.ts
@@ -10,11 +10,11 @@ import {
BaseAgenticProvider,
Tool,
ExecuteToolFn,
- jsonSchemaToZodSchema,
McpUrlResponse,
removeNonRequiredProperties,
} from '@composio/core';
-import { createTool } from '@mastra/core';
+import { applyCompatLayer } from '@mastra/schema-compat';
+import { createTool } from '@mastra/core/tools';
export type MastraTool = ReturnType<typeof createTool>;
@@ -88,17 +88,29 @@ export class MastraProvider extends BaseAgenticProvider<
required?: string[];
}
)
- : (inputParams ?? {});
+ : inputParams;
+
+ const inputSchema = applyCompatLayer({
+ schema: parameters ?? {},
+ compatLayers: [],
+ mode: 'jsonSchema',
+ });
+
+ const outputSchema = applyCompatLayer({
+ schema: tool.outputParameters ?? {},
+ compatLayers: [],
+ mode: 'jsonSchema',
+ });
const mastraTool = createTool({
id: tool.slug,
description: tool.description ?? '',
- inputSchema: parameters ? jsonSchemaToZodSchema(parameters) : undefined,
- outputSchema: tool.outputParameters
- ? jsonSchemaToZodSchema(tool.outputParameters)
- : undefined,
- execute: async ({ context }) => {
- const result = await executeTool(tool.slug, context);
+ // @ts-ignore
+ inputSchema,
+ // @ts-ignore
+ outputSchema,
+ execute: async (inputData, _context) => {
+ const result = await executeTool(tool.slug, inputData as Record<string, unknown>);
return result;
},
});
diff --git a/ts/packages/providers/mastra/test/mastra.test.ts b/ts/packages/providers/mastra/test/mastra.test.ts
index d2ecf5f92..3804335ed 100644
--- a/ts/packages/providers/mastra/test/mastra.test.ts
+++ b/ts/packages/providers/mastra/test/mastra.test.ts
@@ -1,7 +1,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { MastraProvider } from '../src';
import { Tool } from '@composio/core';
-import { createTool } from '@mastra/core';
+import { createTool } from '@mastra/core/tools';
// Define an interface for our mocked Mastra tool
interface MockedMastraTool {
@@ -13,8 +13,8 @@ interface MockedMastraTool {
_isMockedMastraTool: boolean;
}
-// Mock the @mastra/core module
-vi.mock('@mastra/core', () => {
+// Mock the @mastra/core/tools module
+vi.mock('@mastra/core/tools', () => {
return {
createTool: vi.fn().mockImplementation(toolConfig => {
return {
@@ -29,12 +29,12 @@ vi.mock('@mastra/core', () => {
};
});
-// Mock the jsonSchemaToZodSchema function from @composio/core
-vi.mock('@composio/core', async () => {
- const actual = await vi.importActual('@composio/core');
+// Mock the applyCompatLayer function from @mastra/schema-compat
+vi.mock('@mastra/schema-compat', async () => {
+ const actual = await vi.importActual('@mastra/schema-compat');
return {
...(actual as object),
- jsonSchemaToZodSchema: vi.fn().mockImplementation(schema => {
+ applyCompatLayer: vi.fn().mockImplementation(({ schema }) => {
return { type: 'mock-zod-schema', originalSchema: schema };
}),
};
@@ -157,7 +157,7 @@ describe('MastraProvider', () => {
id: toolWithoutOutputParams.slug,
description: toolWithoutOutputParams.description,
inputSchema: { type: 'mock-zod-schema', originalSchema: mockTool.inputParameters },
- outputSchema: undefined,
+ outputSchema: { type: 'mock-zod-schema', originalSchema: {} },
execute: expect.any(Function),
});
@@ -193,10 +193,10 @@ describe('MastraProvider', () => {
const executeFunction = (createTool as any).mock.calls[0][0].execute;
// Test the execute function
- const context = { input: 'test-value' };
- const result = await executeFunction({ context });
+ const inputData = { input: 'test-value' };
+ const result = await executeFunction(inputData);
- expect(mockExecuteToolFn).toHaveBeenCalledWith(mockTool.slug, context);
+ expect(mockExecuteToolFn).toHaveBeenCalledWith(mockTool.slug, inputData);
expect(result).toEqual({
data: { result: 'success' },
error: null,
@@ -212,10 +212,10 @@ describe('MastraProvider', () => {
const executeFunction = (createTool as any).mock.calls[0][0].execute;
// Test that the version is passed correctly
- const context = { input: 'version-test' };
- await executeFunction({ context });
+ const inputData = { input: 'version-test' };
+ await executeFunction(inputData);
- expect(mockExecuteToolFn).toHaveBeenCalledWith(toolWithVersion.slug, context);
+ expect(mockExecuteToolFn).toHaveBeenCalledWith(toolWithVersion.slug, inputData);
});
it('should handle tools without version information', async () => {
@@ -226,10 +226,10 @@ describe('MastraProvider', () => {
const executeFunction = (createTool as any).mock.calls[0][0].execute;
// Test that undefined version is passed correctly
- const context = { input: 'no-version-test' };
- await executeFunction({ context });
+ const inputData = { input: 'no-version-test' };
+ await executeFunction(inputData);
- expect(mockExecuteToolFn).toHaveBeenCalledWith(toolWithoutVersion.slug, context);
+ expect(mockExecuteToolFn).toHaveBeenCalledWith(toolWithoutVersion.slug, inputData);
});
it('should handle empty context parameter', async () => {
@@ -238,8 +238,8 @@ describe('MastraProvider', () => {
// Extract the execute function from the call to createTool()
const executeFunction = (createTool as any).mock.calls[0][0].execute;
- // Test the execute function with empty context
- const result = await executeFunction({ context: {} });
+ // Test the execute function with empty input
+ const result = await executeFunction({});
expect(mockExecuteToolFn).toHaveBeenCalledWith(mockTool.slug, {});
expect(result).toEqual({
@@ -255,8 +255,8 @@ describe('MastraProvider', () => {
// Extract the execute function from the call to createTool()
const executeFunction = (createTool as any).mock.calls[0][0].execute;
- // Test the execute function without context
- const result = await executeFunction({});
+ // Test the execute function without any parameters
+ const result = await executeFunction(undefined);
expect(mockExecuteToolFn).toHaveBeenCalledWith(mockTool.slug, undefined);
expect(result).toEqual({
@@ -434,7 +434,7 @@ describe('MastraProvider', () => {
id: 'minimal-tool',
description: 'A minimal tool',
inputSchema: { type: 'mock-zod-schema', originalSchema: {} },
- outputSchema: undefined,
+ outputSchema: { type: 'mock-zod-schema', originalSchema: {} },
execute: expect.any(Function),
});
@@ -452,9 +452,7 @@ describe('MastraProvider', () => {
) as unknown as MockedMastraTool;
const executeFunction = (createTool as any).mock.calls[0][0].execute;
- await expect(executeFunction({ context: { input: 'test' } })).rejects.toThrow(
- 'Execution failed'
- );
+ await expect(executeFunction({ input: 'test' })).rejects.toThrow('Execution failed');
});
it('should handle tools with malformed schemas', () => {