From 7b68e28f05634bbb6b1f1bae9a50a054226d0710 Mon Sep 17 00:00:00 2001 From: Allen Zhou <46854522+allenzhou101@users.noreply.github.com> Date: Wed, 19 Feb 2025 10:30:17 -0800 Subject: [PATCH] Prettier formatting --- mcp-client-typescript/index.ts | 11 +++++------ mcp-client-typescript/tsconfig.json | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mcp-client-typescript/index.ts b/mcp-client-typescript/index.ts index b2eac7e..be89f65 100644 --- a/mcp-client-typescript/index.ts +++ b/mcp-client-typescript/index.ts @@ -34,7 +34,7 @@ class MCPClient { async connectToServer(serverScriptPath: string) { /** * Connect to an MCP server - * + * * @param serverScriptPath - Path to the server script (.py or .js) */ try { @@ -68,7 +68,7 @@ class MCPClient { }); console.log( "Connected to server with tools:", - this.tools.map(({ name }) => name) + this.tools.map(({ name }) => name), ); } catch (e) { console.log("Failed to connect to MCP server: ", e); @@ -79,7 +79,7 @@ class MCPClient { async processQuery(query: string) { /** * Process a query using Claude and available tools - * + * * @param query - The user's input query * @returns Processed response as a string */ @@ -90,7 +90,6 @@ class MCPClient { }, ]; - // Initial Claude API call const response = await this.anthropic.messages.create({ model: "claude-3-5-sonnet-20241022", @@ -117,7 +116,7 @@ class MCPClient { }); toolResults.push(result); finalText.push( - `[Calling tool ${toolName} with args ${JSON.stringify(toolArgs)}]` + `[Calling tool ${toolName} with args ${JSON.stringify(toolArgs)}]`, ); // Continue conversation with tool results @@ -134,7 +133,7 @@ class MCPClient { }); finalText.push( - response.content[0].type === "text" ? response.content[0].text : "" + response.content[0].type === "text" ? response.content[0].text : "", ); } } diff --git a/mcp-client-typescript/tsconfig.json b/mcp-client-typescript/tsconfig.json index 0287de9..78c3d9d 100644 --- a/mcp-client-typescript/tsconfig.json +++ b/mcp-client-typescript/tsconfig.json @@ -12,4 +12,4 @@ }, "include": ["index.ts"], "exclude": ["node_modules"] -} \ No newline at end of file +}