@mcpjam/sdk 0.8.2 → 0.8.3

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
@@ -583,7 +583,8 @@ function scrubMetaAndStructuredContentFromToolResult(result) {
583
583
  }
584
584
  async function convertMCPToolsToVercelTools(listToolsResult, {
585
585
  schemas = "automatic",
586
- callTool
586
+ callTool,
587
+ needsApproval
587
588
  }) {
588
589
  const tools = {};
589
590
  for (const toolDescription of listToolsResult.tools) {
@@ -612,7 +613,8 @@ async function convertMCPToolsToVercelTools(listToolsResult, {
612
613
  description,
613
614
  inputSchema: jsonSchema(normalizedInputSchema),
614
615
  execute,
615
- ...toModelOutput ? { toModelOutput } : {}
616
+ ...toModelOutput ? { toModelOutput } : {},
617
+ ...needsApproval != null ? { needsApproval } : {}
616
618
  });
617
619
  } else {
618
620
  const overrides = schemas;
@@ -623,7 +625,8 @@ async function convertMCPToolsToVercelTools(listToolsResult, {
623
625
  description,
624
626
  inputSchema: overrides[name].inputSchema,
625
627
  execute,
626
- ...toModelOutput ? { toModelOutput } : {}
628
+ ...toModelOutput ? { toModelOutput } : {},
629
+ ...needsApproval != null ? { needsApproval } : {}
627
630
  });
628
631
  }
629
632
  tools[name] = vercelTool;
@@ -898,6 +901,7 @@ var MCPClientManager = class {
898
901
  const listToolsResult = await this.listTools(id);
899
902
  const tools = await convertMCPToolsToVercelTools(listToolsResult, {
900
903
  schemas: options.schemas,
904
+ needsApproval: options.needsApproval,
901
905
  callTool: async ({ name, args, options: callOptions }) => {
902
906
  const requestOptions = callOptions?.abortSignal ? { signal: callOptions.abortSignal } : void 0;
903
907
  const result = await this.executeTool(