From dac5c93d147fa95ad260e31162ccda899de76a28 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 3 Dec 2026 21:00:00 +0100 Subject: [PATCH] Assert zero-tool capability behavior for comma-only allowlist --- scripts/test-mcp-tool-allowlist.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/test-mcp-tool-allowlist.ts b/scripts/test-mcp-tool-allowlist.ts index 6304c99..cc235ad 100644 --- a/scripts/test-mcp-tool-allowlist.ts +++ b/scripts/test-mcp-tool-allowlist.ts @@ -164,8 +164,16 @@ async function main(): Promise { process.env.VOIDBOT_MCP_TOOL_ALLOWLIST = ","; await withConnectedClient(context, async (client) => { - const listed = await client.listTools(); - assert.deepEqual(listed.tools.map((tool) => tool.name), [], "[comma-only] Expected 0 tools"); + assert.equal( + client.getServerCapabilities()?.tools, + undefined, + "[comma-only] Expected no tools capability to be advertised", + ); + await assert.rejects( + () => client.listTools(), + /Method not found|-32601/, + "[comma-only] Expected listTools to fail closed when zero tools are registered", + ); await assertToolRefused(client, { name: "get_exact_source_document", arguments: { sourceId: "ExampleRepo:README.md" },