ai 4.3.4 → 4.3.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # ai
2
2
 
3
+ ## 4.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 452bf12: fix (ai/mcp): better support for zero-argument MCP tools
8
+
3
9
  ## 4.3.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -7524,6 +7524,7 @@ var MCPClient = class {
7524
7524
  async tools({
7525
7525
  schemas = "automatic"
7526
7526
  } = {}) {
7527
+ var _a17;
7527
7528
  const tools = {};
7528
7529
  try {
7529
7530
  const listToolsResult = await this.listTools();
@@ -7531,14 +7532,18 @@ var MCPClient = class {
7531
7532
  if (schemas !== "automatic" && !(name17 in schemas)) {
7532
7533
  continue;
7533
7534
  }
7534
- const parameters = schemas === "automatic" ? (0, import_ui_utils10.jsonSchema)(inputSchema) : schemas[name17].parameters;
7535
+ const parameters = schemas === "automatic" ? (0, import_ui_utils10.jsonSchema)({
7536
+ ...inputSchema,
7537
+ properties: (_a17 = inputSchema.properties) != null ? _a17 : {},
7538
+ additionalProperties: false
7539
+ }) : schemas[name17].parameters;
7535
7540
  const self = this;
7536
7541
  const toolWithExecute = tool({
7537
7542
  description,
7538
7543
  parameters,
7539
7544
  execute: async (args, options) => {
7540
- var _a17;
7541
- (_a17 = options == null ? void 0 : options.abortSignal) == null ? void 0 : _a17.throwIfAborted();
7545
+ var _a18;
7546
+ (_a18 = options == null ? void 0 : options.abortSignal) == null ? void 0 : _a18.throwIfAborted();
7542
7547
  return self.callTool({
7543
7548
  name: name17,
7544
7549
  args,