Assert zero-tool capability behavior for comma-only allowlist
This commit is contained in:
parent
1401fbe167
commit
dac5c93d14
1 changed files with 10 additions and 2 deletions
|
|
@ -164,8 +164,16 @@ async function main(): Promise<void> {
|
|||
|
||||
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" },
|
||||
|
|
|
|||
Loading…
Reference in a new issue