@ai-sdk/mcp 1.0.77 → 1.0.78

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.mjs CHANGED
@@ -79,7 +79,11 @@ var ToolSchema = z.object({
79
79
  outputSchema: z.optional(z.object({}).loose()),
80
80
  annotations: z.optional(
81
81
  z.object({
82
- title: z.optional(z.string())
82
+ title: z.optional(z.string()),
83
+ readOnlyHint: z.optional(z.boolean()),
84
+ destructiveHint: z.optional(z.boolean()),
85
+ idempotentHint: z.optional(z.boolean()),
86
+ openWorldHint: z.optional(z.boolean())
83
87
  }).loose()
84
88
  ),
85
89
  _meta: ToolMetaSchema
@@ -2568,6 +2572,18 @@ var DefaultMCPClient = class {
2568
2572
  }
2569
2573
  const self = this;
2570
2574
  const outputSchema = schemas !== "automatic" ? (_a3 = schemas[name3]) == null ? void 0 : _a3.outputSchema : void 0;
2575
+ const metadata = {
2576
+ clientName: this.clientInfo.name,
2577
+ ...annotations != null ? {
2578
+ annotations: {
2579
+ ...annotations.title != null ? { title: annotations.title } : {},
2580
+ ...annotations.readOnlyHint != null ? { readOnlyHint: annotations.readOnlyHint } : {},
2581
+ ...annotations.destructiveHint != null ? { destructiveHint: annotations.destructiveHint } : {},
2582
+ ...annotations.idempotentHint != null ? { idempotentHint: annotations.idempotentHint } : {},
2583
+ ...annotations.openWorldHint != null ? { openWorldHint: annotations.openWorldHint } : {}
2584
+ }
2585
+ } : {}
2586
+ };
2571
2587
  const execute = async (args, options) => {
2572
2588
  var _a4;
2573
2589
  (_a4 = options == null ? void 0 : options.abortSignal) == null ? void 0 : _a4.throwIfAborted();
@@ -2583,9 +2599,7 @@ var DefaultMCPClient = class {
2583
2599
  const toolWithExecute = schemas === "automatic" ? dynamicTool({
2584
2600
  description,
2585
2601
  title: resolvedTitle,
2586
- metadata: {
2587
- clientName: this.clientInfo.name
2588
- },
2602
+ metadata,
2589
2603
  inputSchema: jsonSchema({
2590
2604
  ...inputSchema,
2591
2605
  properties: (_b3 = inputSchema.properties) != null ? _b3 : {},
@@ -2596,9 +2610,7 @@ var DefaultMCPClient = class {
2596
2610
  }) : tool({
2597
2611
  description,
2598
2612
  title: resolvedTitle,
2599
- metadata: {
2600
- clientName: this.clientInfo.name
2601
- },
2613
+ metadata,
2602
2614
  inputSchema: schemas[name3].inputSchema,
2603
2615
  ...outputSchema != null ? { outputSchema } : {},
2604
2616
  execute,