@mastra/mcp 2.0.0 → 2.1.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
@@ -11175,7 +11175,7 @@ function toStandardSchema$5(schema) {
11175
11175
  return new AiSdkSchemaWrapper(schema);
11176
11176
  }
11177
11177
  //#endregion
11178
- //#region ../schema-compat/dist/json-schema-DaHLYDhg.js
11178
+ //#region ../schema-compat/dist/json-schema-R8yfooPa.js
11179
11179
  var require_code$1 = /* @__PURE__ */ __commonJSMin$1(((exports) => {
11180
11180
  Object.defineProperty(exports, "__esModule", { value: true });
11181
11181
  exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
@@ -14873,13 +14873,12 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
14873
14873
  if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
14874
14874
  const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
14875
14875
  if (!malformedIPLiteral) malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
14876
+ if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
14877
+ let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
14878
+ if (!isIP) host = normalizePercentEncoding(host.toLowerCase());
14879
+ parsed.host = reescapeHostDelimiters(host, isIP);
14880
+ }
14876
14881
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
14877
- if (uri.indexOf("%") !== -1) {
14878
- if (parsed.host !== void 0 && !malformedIPLiteral) {
14879
- const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
14880
- parsed.host = reescapeHostDelimiters(host, isIP);
14881
- }
14882
- }
14883
14882
  if (parsed.path) parsed.path = normalizePathEncoding(parsed.path);
14884
14883
  if (parsed.query) parsed.query = normalizeQueryFragmentEncoding(parsed.query);
14885
14884
  if (parsed.fragment) parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
@@ -18219,7 +18218,7 @@ function toStandardSchema$3(zodSchema) {
18219
18218
  return wrapper;
18220
18219
  }
18221
18220
  //#endregion
18222
- //#region ../schema-compat/dist/schema-BwlBcZRB.js
18221
+ //#region ../schema-compat/dist/schema-e0VHpMt0.js
18223
18222
  /**
18224
18223
  * Supported JSON Schema targets for z.toJSONSchema().
18225
18224
  * Works with both real Zod v4 and Zod 3.25's v4 compat layer.
@@ -23815,6 +23814,7 @@ var InternalMastraMCPClient = class extends MastraBase {
23815
23814
  const rawMeta = tool._meta;
23816
23815
  return {
23817
23816
  name: tool.name,
23817
+ ...tool.title ? { title: tool.title } : {},
23818
23818
  ...tool.description ? { description: tool.description } : {},
23819
23819
  inputSchema: tool.inputSchema,
23820
23820
  ...tool.outputSchema ? { outputSchema: tool.outputSchema } : {},
@@ -23834,6 +23834,7 @@ var InternalMastraMCPClient = class extends MastraBase {
23834
23834
  toolFromDefinition({ definition }) {
23835
23835
  const tool = {
23836
23836
  name: definition.name,
23837
+ title: definition.title,
23837
23838
  description: definition.description,
23838
23839
  inputSchema: definition.inputSchema,
23839
23840
  outputSchema: definition.outputSchema,
@@ -23879,6 +23880,7 @@ var InternalMastraMCPClient = class extends MastraBase {
23879
23880
  let requireApproval;
23880
23881
  let needsApprovalFn;
23881
23882
  const annotations = tool.annotations;
23883
+ const title = tool.title || annotations?.title;
23882
23884
  if (typeof this.requireToolApproval === "function") {
23883
23885
  const serverApprovalFn = this.requireToolApproval;
23884
23886
  const toolName = tool.name;
@@ -23927,6 +23929,7 @@ var InternalMastraMCPClient = class extends MastraBase {
23927
23929
  };
23928
23930
  const mastraTool = createTool({
23929
23931
  id: `${this.name}_${tool.name}`,
23932
+ title,
23930
23933
  description: tool.description || "",
23931
23934
  inputSchema: this.convertInputSchema(tool.inputSchema),
23932
23935
  outputSchema: this.convertOutputSchema(tool.outputSchema),
@@ -26370,6 +26373,7 @@ var MCPServer = class extends MCPServerBase {
26370
26373
  const info = this.toolInfo(name, tool);
26371
26374
  const validation = specTypeSchemas.Tool["~standard"].validate({
26372
26375
  name,
26376
+ title: tool.title,
26373
26377
  description: info.description,
26374
26378
  inputSchema: info.inputSchema,
26375
26379
  outputSchema: info.outputSchema,