@@ -3,9 +3,9 @@ import { StreamableHTTPClientTransport } from '../../client/streamableHttp.js';
33import {
44 ListToolsRequest ,
55 ListToolsResultSchema ,
6- CallToolRequest ,
76 CallToolResultSchema ,
87 LoggingMessageNotificationSchema ,
8+ CallToolResult ,
99} from '../../types.js' ;
1010
1111/**
@@ -57,11 +57,11 @@ async function main(): Promise<void> {
5757 // 2. Start multiple notification tools in parallel
5858 console . log ( '\n=== Starting Multiple Notification Streams in Parallel ===' ) ;
5959 const toolResults = await startParallelNotificationTools ( client ) ;
60-
60+
6161 // Log the results from each tool call
6262 for ( const [ caller , result ] of Object . entries ( toolResults ) ) {
6363 console . log ( `\n=== Tool result for ${ caller } ===` ) ;
64- result . content . forEach ( ( item : { type : string ; text : any ; } ) => {
64+ result . content . forEach ( ( item : { type : string ; text ?: string ; } ) => {
6565 if ( item . type === 'text' ) {
6666 console . log ( ` ${ item . text } ` ) ;
6767 } else {
@@ -113,7 +113,7 @@ async function listTools(client: Client): Promise<void> {
113113 * Start multiple notification tools in parallel with different configurations
114114 * Each tool call includes a caller parameter to identify its notifications
115115 */
116- async function startParallelNotificationTools ( client : Client ) : Promise < Record < string , any > > {
116+ async function startParallelNotificationTools ( client : Client ) : Promise < Record < string , CallToolResult > > {
117117 try {
118118 // Define multiple tool calls with different configurations
119119 const toolCalls = [
@@ -162,7 +162,7 @@ async function startParallelNotificationTools(client: Client): Promise<Record<st
162162 ] ;
163163
164164 console . log ( `Starting ${ toolCalls . length } notification tools in parallel...` ) ;
165-
165+
166166 // Start all tool calls in parallel
167167 const toolPromises = toolCalls . map ( ( { caller, request } ) => {
168168 console . log ( `Starting tool call for ${ caller } ...` ) ;
@@ -176,9 +176,9 @@ async function startParallelNotificationTools(client: Client): Promise<Record<st
176176
177177 // Wait for all tool calls to complete
178178 const results = await Promise . all ( toolPromises ) ;
179-
179+
180180 // Organize results by caller
181- const resultsByTool : Record < string , any > = { } ;
181+ const resultsByTool : Record < string , CallToolResult > = { } ;
182182 results . forEach ( ( { caller, result } ) => {
183183 resultsByTool [ caller ] = result ;
184184 } ) ;
0 commit comments