11import { v4 as uuid } from "uuid" ;
22import { experimental_createMCPClient as createMCPClient , tool as createVercelTool } from "ai" ;
3- import type { ToolCallOptions } from "ai" ;
3+ import type { Tool } from "ai" ;
44import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js" ;
55import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js" ;
66
@@ -36,9 +36,10 @@ export class AccuracyTestingClient {
3636 const rewrappedVercelTools : VercelMCPClientTools = { } ;
3737 for ( const [ toolName , tool ] of Object . entries ( vercelTools ) ) {
3838 rewrappedVercelTools [ toolName ] = createVercelTool ( {
39- ...tool ,
40- // eslint-disable-next-line
41- execute : ( async ( args : unknown , options : ToolCallOptions ) => {
39+ // tool is an insantiated tool, while createVercelTool requires a tool definition.
40+ // by using this explicit casting, we ensure the type system understands what we are doing.
41+ ...( tool as Tool < unknown , unknown > ) ,
42+ execute : async ( args , options ) => {
4243 this . llmToolCalls . push ( {
4344 toolCallId : uuid ( ) ,
4445 toolName : toolName ,
@@ -62,7 +63,7 @@ export class AccuracyTestingClient {
6263 content : JSON . stringify ( error ) ,
6364 } ;
6465 }
65- } ) as any , // eslint-disable-line
66+ } ,
6667 } ) as VercelMCPClientTools [ string ] ;
6768 }
6869
0 commit comments