refactor(core): use assertConnected in McpClient discover method (#10989)

This commit is contained in:
Alexander
2025-10-14 01:57:10 +09:00
committed by GitHub
parent 19c1d73405
commit 7beaa368a9
+1 -3
View File
@@ -132,9 +132,7 @@ export class McpClient {
* Discovers tools and prompts from the MCP server. * Discovers tools and prompts from the MCP server.
*/ */
async discover(cliConfig: Config): Promise<void> { async discover(cliConfig: Config): Promise<void> {
if (this.status !== MCPServerStatus.CONNECTED) { this.assertConnected();
throw new Error('Client is not connected.');
}
const prompts = await this.discoverPrompts(); const prompts = await this.discoverPrompts();
const tools = await this.discoverTools(cliConfig); const tools = await this.discoverTools(cliConfig);