Don't double-add completion handler
This commit is contained in:
parent
eba6461567
commit
dbf560f24a
1 changed files with 8 additions and 0 deletions
|
|
@ -175,7 +175,13 @@ export class McpServer {
|
|||
this._toolHandlersInitialized = true;
|
||||
}
|
||||
|
||||
private _completionHandlerInitialized = false;
|
||||
|
||||
private setCompletionRequestHandler() {
|
||||
if (this._completionHandlerInitialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.server.assertCanSetRequestHandler(
|
||||
CompleteRequestSchema.shape.method.value,
|
||||
);
|
||||
|
|
@ -198,6 +204,8 @@ export class McpServer {
|
|||
}
|
||||
},
|
||||
);
|
||||
|
||||
this._completionHandlerInitialized = true;
|
||||
}
|
||||
|
||||
private async handlePromptCompletion(
|
||||
|
|
|
|||
Loading…
Reference in a new issue