@@ -268,7 +268,7 @@ export class MCPClient {
268268 /**
269269 * Makes a tool call with error handling and retries.
270270 */
271- private async callTool < T > ( toolName : string , args : Record < string , any > = { } ) : Promise < T > {
271+ private async callTool < T > ( toolName : string , args : Record < string , unknown > = { } ) : Promise < T > {
272272 this . ensureConnected ( ) ;
273273
274274 const operation = async ( ) : Promise < T > => {
@@ -293,9 +293,9 @@ export class MCPClient {
293293 // Try to parse as MCP error response
294294 let mcpError ;
295295 try {
296- mcpError = JSON . parse ( ( result [ 'error' ] as any ) . message ) ;
296+ mcpError = JSON . parse ( ( result [ 'error' ] as { message : string } ) . message ) ;
297297 } catch {
298- mcpError = { code : - 1 , message : ( result [ 'error' ] as any ) . message } ;
298+ mcpError = { code : - 1 , message : ( result [ 'error' ] as { message : string } ) . message } ;
299299 }
300300 console . log ( `Parsed MCP error for ${ toolName } :` , mcpError ) ;
301301 throw mapMcpError ( mcpError , toolName ) ;
@@ -316,7 +316,7 @@ export class MCPClient {
316316 try {
317317 const parsedData = JSON . parse ( content . text ) ;
318318 return parsedData ;
319- } catch ( parseError ) {
319+ } catch ( _parseError ) {
320320 if ( this . config . debug ) {
321321 console . log ( `Failed to parse MCP text content for ${ toolName } :` , content . text ) ;
322322 }
@@ -362,7 +362,7 @@ export class MCPClient {
362362 if ( typeof finalResult === 'object' && finalResult !== null ) {
363363 console . log ( `Final result has vector property: ${ 'vector' in finalResult } ` ) ;
364364 if ( 'vector' in finalResult ) {
365- const vectorValue = ( finalResult as any ) . vector ;
365+ const vectorValue = ( finalResult as { vector ?: unknown } ) . vector ;
366366 console . log ( `Vector value type: ${ typeof vectorValue } , isArray: ${ Array . isArray ( vectorValue ) } , length: ${ Array . isArray ( vectorValue ) ? vectorValue . length : 'N/A' } ` ) ;
367367 }
368368 }
@@ -491,7 +491,7 @@ export class MCPClient {
491491 * Retrieves an object instance by ID and type.
492492 */
493493 async getObjectById ( params : GetObjectByIdParams ) : Promise < ObjectInstance | null > {
494- const rawResult = await this . callTool < any > ( 'get_object_by_id' , {
494+ const rawResult = await this . callTool < unknown > ( 'get_object_by_id' , {
495495 object_id : params . object_id ,
496496 type_name : params . type_name ,
497497 } ) ;
@@ -509,7 +509,7 @@ export class MCPClient {
509509 try {
510510 const parsedData = JSON . parse ( rawResult [ 0 ] . text ) ;
511511 result = parsedData ;
512- } catch ( parseError ) {
512+ } catch ( _parseError ) {
513513 throw new Error ( `Failed to parse MCP text response: ${ rawResult [ 0 ] . text } ` ) ;
514514 }
515515 } else if ( rawResult && typeof rawResult === 'object' ) {
@@ -530,7 +530,7 @@ export class MCPClient {
530530 /**
531531 * Deserializes properties, converting datetime strings to Date objects.
532532 */
533- private deserializeProperties ( properties : Record < string , any > ) : Record < string , any > {
533+ private deserializeProperties ( properties : Record < string , unknown > ) : Record < string , unknown > {
534534 const deserialized = { ...properties } ;
535535
536536 for ( const [ key , value ] of Object . entries ( deserialized ) ) {
@@ -590,7 +590,7 @@ export class MCPClient {
590590 * Retrieves relations between objects.
591591 */
592592 async getRelation ( params : GetRelationParams ) : Promise < RelationInstanceList > {
593- const rawResult = await this . callTool < any > ( 'get_relation' , {
593+ const rawResult = await this . callTool < unknown > ( 'get_relation' , {
594594 from_object_id : params . from_object_id ,
595595 to_object_id : params . to_object_id ,
596596 relation_type_name : params . relation_type_name ,
@@ -609,7 +609,7 @@ export class MCPClient {
609609 try {
610610 const parsedData = JSON . parse ( rawResult [ 0 ] . text ) ;
611611 result = parsedData ;
612- } catch ( parseError ) {
612+ } catch ( _parseError ) {
613613 throw new Error ( `Failed to parse MCP text response: ${ rawResult [ 0 ] . text } ` ) ;
614614 }
615615 } else if ( rawResult && typeof rawResult === 'object' ) {
@@ -714,12 +714,12 @@ export class MCPClient {
714714 try {
715715 const parsedData = JSON . parse ( rawResult [ 0 ] . text ) ;
716716 vector = parsedData . vector ;
717- } catch ( parseError ) {
717+ } catch ( _parseError ) {
718718 throw new Error ( `Failed to parse MCP text response: ${ rawResult [ 0 ] . text } ` ) ;
719719 }
720- } else if ( ( rawResult as any ) . vector ) {
720+ } else if ( ( rawResult as { vector ?: unknown } ) . vector ) {
721721 // Direct format: {"vector": [numbers]}
722- vector = ( rawResult as any ) . vector ;
722+ vector = ( rawResult as { vector : number [ ] } ) . vector ;
723723 } else {
724724 throw new Error ( `Invalid embedding vector response format: ${ JSON . stringify ( rawResult ) } ` ) ;
725725 }
@@ -762,7 +762,7 @@ export class MCPClient {
762762 process . stdout . write ( 'MCPClient.executeComplexQuery called with:' + JSON . stringify ( params , null , 2 ) + '\n' ) ;
763763 }
764764
765- const rawResult = await this . callTool < any > ( 'execute_complex_query' , {
765+ const rawResult = await this . callTool < unknown > ( 'execute_complex_query' , {
766766 query : params . query ,
767767 } ) ;
768768
@@ -779,7 +779,7 @@ export class MCPClient {
779779 try {
780780 const parsedData = JSON . parse ( rawResult [ 0 ] . text ) ;
781781 result = parsedData ;
782- } catch ( parseError ) {
782+ } catch ( _parseError ) {
783783 throw new Error ( `Failed to parse MCP text response: ${ rawResult [ 0 ] . text } ` ) ;
784784 }
785785 } else if ( rawResult && typeof rawResult === 'object' ) {
@@ -839,7 +839,7 @@ export class MCPClient {
839839 ] ,
840840 } ,
841841 } ) ;
842- } catch ( error ) {
842+ } catch ( _error ) {
843843 // Object type might already exist, continue
844844 }
845845
0 commit comments