@ai-sdk/mcp 0.0.39 → 0.0.40

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-sdk/mcp
2
2
 
3
+ ## 0.0.40
4
+
5
+ ### Patch Changes
6
+
7
+ - c87913e: fix(mcp): allow MCP tools to execute without options
8
+
3
9
  ## 0.0.39
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod/v4';
2
- import { FetchFunction, FlexibleSchema, Tool } from '@ai-sdk/provider-utils';
2
+ import { FetchFunction, FlexibleSchema, Tool, ToolCallOptions } from '@ai-sdk/provider-utils';
3
3
  import { JSONObject } from '@ai-sdk/provider';
4
4
 
5
5
  declare const JSONRPCRequestSchema: z.ZodObject<{
@@ -245,12 +245,16 @@ type MCPTransportConfig = {
245
245
  type ToolSchemas = Record<string, {
246
246
  inputSchema: FlexibleSchema<JSONObject | unknown>;
247
247
  }> | 'automatic' | undefined;
248
+ /** Base MCP tool type with execute */
249
+ type McpToolBase<INPUT = unknown, OUTPUT = CallToolResult> = Tool<INPUT, OUTPUT> & {
250
+ execute: (input: INPUT, options?: ToolCallOptions) => ReturnType<NonNullable<Tool<INPUT, OUTPUT>['execute']>>;
251
+ };
248
252
  type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
249
253
  inputSchema: FlexibleSchema<any>;
250
254
  }> ? {
251
255
  [K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
252
256
  inputSchema: FlexibleSchema<infer INPUT>;
253
- } ? Tool<INPUT, CallToolResult> & Required<Pick<Tool<INPUT, CallToolResult>, 'execute'>> : never;
257
+ } ? McpToolBase<INPUT, CallToolResult> : never;
254
258
  } : McpToolSet<Record<string, {
255
259
  inputSchema: FlexibleSchema<unknown>;
256
260
  }>>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod/v4';
2
- import { FetchFunction, FlexibleSchema, Tool } from '@ai-sdk/provider-utils';
2
+ import { FetchFunction, FlexibleSchema, Tool, ToolCallOptions } from '@ai-sdk/provider-utils';
3
3
  import { JSONObject } from '@ai-sdk/provider';
4
4
 
5
5
  declare const JSONRPCRequestSchema: z.ZodObject<{
@@ -245,12 +245,16 @@ type MCPTransportConfig = {
245
245
  type ToolSchemas = Record<string, {
246
246
  inputSchema: FlexibleSchema<JSONObject | unknown>;
247
247
  }> | 'automatic' | undefined;
248
+ /** Base MCP tool type with execute */
249
+ type McpToolBase<INPUT = unknown, OUTPUT = CallToolResult> = Tool<INPUT, OUTPUT> & {
250
+ execute: (input: INPUT, options?: ToolCallOptions) => ReturnType<NonNullable<Tool<INPUT, OUTPUT>['execute']>>;
251
+ };
248
252
  type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
249
253
  inputSchema: FlexibleSchema<any>;
250
254
  }> ? {
251
255
  [K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
252
256
  inputSchema: FlexibleSchema<infer INPUT>;
253
- } ? Tool<INPUT, CallToolResult> & Required<Pick<Tool<INPUT, CallToolResult>, 'execute'>> : never;
257
+ } ? McpToolBase<INPUT, CallToolResult> : never;
254
258
  } : McpToolSet<Record<string, {
255
259
  inputSchema: FlexibleSchema<unknown>;
256
260
  }>>;