diff --git a/src/client/index.test.ts b/src/client/index.test.ts index 1209b60c..a1b43b2b 100644 --- a/src/client/index.test.ts +++ b/src/client/index.test.ts @@ -227,10 +227,19 @@ test("should respect server capabilities", async () => { await expect(client.listResources()).resolves.not.toThrow(); await expect(client.listTools()).resolves.not.toThrow(); - // This should throw because prompts are not supported + // These should throw because prompts, logging, and completions are not supported await expect(client.listPrompts()).rejects.toThrow( "Server does not support prompts", ); + await expect(client.setLoggingLevel("error")).rejects.toThrow( + "Server does not support logging", + ); + await expect( + client.complete({ + ref: { type: "ref/prompt", name: "test" }, + argument: { name: "test", value: "test" }, + }), + ).rejects.toThrow("Server does not support completions"); }); test("should respect client notification capabilities", async () => { diff --git a/src/client/index.ts b/src/client/index.ts index bcad952c..d6b2ed33 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -237,9 +237,9 @@ export class Client< break; case "completion/complete": - if (!this._serverCapabilities?.prompts) { + if (!this._serverCapabilities?.completions) { throw new Error( - `Server does not support prompts (required for ${method})`, + `Server does not support completions (required for ${method})`, ); } break;