From 7beaa368a9df80363d24f0ca3307e322c8c512ce Mon Sep 17 00:00:00 2001 From: Alexander <133993514+raiki61@users.noreply.github.com> Date: Tue, 14 Oct 2025 01:57:10 +0900 Subject: [PATCH] refactor(core): use assertConnected in McpClient discover method (#10989) --- packages/core/src/tools/mcp-client.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/tools/mcp-client.ts b/packages/core/src/tools/mcp-client.ts index dc49f9386b..1b5e5edd6f 100644 --- a/packages/core/src/tools/mcp-client.ts +++ b/packages/core/src/tools/mcp-client.ts @@ -132,9 +132,7 @@ export class McpClient { * Discovers tools and prompts from the MCP server. */ async discover(cliConfig: Config): Promise { - if (this.status !== MCPServerStatus.CONNECTED) { - throw new Error('Client is not connected.'); - } + this.assertConnected(); const prompts = await this.discoverPrompts(); const tools = await this.discoverTools(cliConfig);