MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / resetConnection

Method resetConnection

cli/src/mcp/client.ts:358–372  ·  view source on GitHub ↗
(clearPersistentSession: boolean)

Source from the content-addressed store, hash-verified

356 }
357
358 private async resetConnection(clearPersistentSession: boolean): Promise<void> {
359 if (this.transport) {
360 await closeTransportQuietly(this.transport);
361 this.transport = undefined;
362 }
363
364 if (!clearPersistentSession) {
365 return;
366 }
367
368 this.cachedSessionId = undefined;
369 this.cachedTools = undefined;
370 this.discoveredTools = undefined;
371 await this.cacheStore.clear(this.endpoint.toString());
372 }
373}
374
375function readToolText(result: ToolCallResult, context: string): string {

Callers 2

tryDirectToolCallMethod · 0.95
callMappedToolWithSdkMethod · 0.95

Calls 2

closeTransportQuietlyFunction · 0.85
clearMethod · 0.65

Tested by

no test coverage detected