@mastra/mcp 0.11.2 → 0.11.3-alpha.0

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.
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSche
12
12
  import { asyncExitHook, gracefulExit } from 'exit-hook';
13
13
  import { z } from 'zod';
14
14
  import { convertJsonSchemaToZod } from 'zod-from-json-schema';
15
+ import { convertJsonSchemaToZod as convertJsonSchemaToZod$1 } from 'zod-from-json-schema-v3';
15
16
  import equal from 'fast-deep-equal';
16
17
  import { v5 } from 'uuid';
17
18
  import { randomUUID } from 'crypto';
@@ -505,7 +506,12 @@ var InternalMastraMCPClient = class extends MastraBase {
505
506
  }
506
507
  try {
507
508
  await $RefParser.dereference(inputSchema);
508
- return convertJsonSchemaToZod(inputSchema);
509
+ const jsonSchemaToConvert = "jsonSchema" in inputSchema ? inputSchema.jsonSchema : inputSchema;
510
+ if ("toJSONSchema" in z) {
511
+ return convertJsonSchemaToZod(jsonSchemaToConvert);
512
+ } else {
513
+ return convertJsonSchemaToZod$1(jsonSchemaToConvert);
514
+ }
509
515
  } catch (error) {
510
516
  let errorDetails;
511
517
  if (error instanceof Error) {
@@ -536,7 +542,12 @@ var InternalMastraMCPClient = class extends MastraBase {
536
542
  }
537
543
  try {
538
544
  await $RefParser.dereference(outputSchema);
539
- return convertJsonSchemaToZod(outputSchema);
545
+ const jsonSchemaToConvert = "jsonSchema" in outputSchema ? outputSchema.jsonSchema : outputSchema;
546
+ if ("toJSONSchema" in z) {
547
+ return convertJsonSchemaToZod(jsonSchemaToConvert);
548
+ } else {
549
+ return convertJsonSchemaToZod$1(jsonSchemaToConvert);
550
+ }
540
551
  } catch (error) {
541
552
  let errorDetails;
542
553
  if (error instanceof Error) {