Skip to content

Commit 5b9635f

Browse files
committed
feat: test snake_case tool naming convention
1 parent 5466412 commit 5b9635f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/mcp-server-supabase/src/server.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,4 +598,24 @@ describe('tools', () => {
598598

599599
await expect(run()).rejects.toThrow('syntax error at or near "invalid"');
600600
});
601+
602+
// We use snake_case because it aligns better with most MCP clients
603+
test('all tools follow snake_case naming convention', async () => {
604+
const { client } = await setup();
605+
606+
const { tools } = await client.listTools();
607+
608+
for (const tool of tools) {
609+
expect(tool.name, 'expected tool name to be snake_case').toMatch(
610+
/^[a-z0-9_]+$/
611+
);
612+
613+
const parameterNames = Object.keys(tool.inputSchema.properties ?? {});
614+
for (const name of parameterNames) {
615+
expect(name, 'expected parameter to be snake_case').toMatch(
616+
/^[a-z0-9_]+$/
617+
);
618+
}
619+
}
620+
});
601621
});

0 commit comments

Comments
 (0)