Commit 0bd5348
[UPDATE PRIMITIVE] Normalize camelCase params to kebab-case with actionable error messages for CLI tools (#224)
* Initial plan
* feat: improve error messages for unrecognized CLI tool params and accept camelCase aliases
Add parameter normalization layer (buildEnhancedToolSchema) that:
- Silently normalizes camelCase/snake_case keys to kebab-case equivalents
(e.g. sourceRoot → source-root)
- Rejects truly unknown properties with the property name in the error
and a "did you mean?" suggestion when a close match exists
- Applies to all 16+ CLI tools that use kebab-case parameter names
Closes #208 (Area 2)
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/5ed1c1a7-10c5-4e53-8454-128d1d6e46ae
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
* [UPDATE PRIMITIVE] Fix ZodEffects schema rejection in CLI tool registration and resolve_queries parameter name (#225)
* fix: use registerTool() instead of deprecated tool() to fix ZodEffects schema rejection by MCP SDK
The MCP SDK's tool() method argument parsing rejects ZodEffects schemas
(from buildEnhancedToolSchema) as 'unrecognized objects' because its
isZodRawShapeCompat() check returns false for Zod schema instances.
registerTool() passes inputSchema directly to getZodSchemaObject(),
which correctly recognises any Zod schema instance, avoiding the error:
'Tool codeql_bqrs_decode expected a Zod schema or ToolAnnotations,
but received an unrecognized object'
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/ba14c9e0-173d-49fd-820b-b77bfdd973b0
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
* fix: use correct parameter name 'directory' instead of 'path' for codeql_resolve_queries integration test
The codeql_resolve_queries tool schema defines 'directory' as the parameter
for specifying the directory to search for queries, but the integration test
runner was sending 'path' which was rejected as an unknown property by the
parameter normalization layer.
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/ba14c9e0-173d-49fd-820b-b77bfdd973b0
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
* fix: capture suggestion alongside unknownEntries for "did you mean?" hints
The hint is now stored at determination time rather than re-computed
in the error loop (where it was always undefined). When both kebab-case
and camelCase forms are provided (e.g. source-root + sourceRoot), the
duplicate is now rejected with a "did you mean?" suggestion instead of
being silently ignored.
Agent-Logs-Url: https://github.com/advanced-security/codeql-development-mcp-server/sessions/02a09bd4-39e4-4e83-968e-8562405a9f4c
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
* More fixes for PR review feedback
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Co-authored-by: Nathan Randall <data-douser@github.com>1 parent 2cf8b49 commit 0bd5348
File tree
8 files changed
+584
-65
lines changed- client/src/lib
- server
- dist
- src/lib
- test/src
- lib
- tools
8 files changed
+584
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | | - | |
1088 | | - | |
| 1087 | + | |
| 1088 | + | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188583 | 188583 | | |
188584 | 188584 | | |
188585 | 188585 | | |
| 188586 | + | |
| 188587 | + | |
| 188588 | + | |
| 188589 | + | |
| 188590 | + | |
| 188591 | + | |
| 188592 | + | |
| 188593 | + | |
| 188594 | + | |
| 188595 | + | |
| 188596 | + | |
| 188597 | + | |
| 188598 | + | |
| 188599 | + | |
| 188600 | + | |
| 188601 | + | |
| 188602 | + | |
| 188603 | + | |
| 188604 | + | |
| 188605 | + | |
| 188606 | + | |
| 188607 | + | |
| 188608 | + | |
| 188609 | + | |
| 188610 | + | |
| 188611 | + | |
| 188612 | + | |
| 188613 | + | |
| 188614 | + | |
| 188615 | + | |
| 188616 | + | |
| 188617 | + | |
| 188618 | + | |
| 188619 | + | |
| 188620 | + | |
| 188621 | + | |
| 188622 | + | |
| 188623 | + | |
| 188624 | + | |
| 188625 | + | |
| 188626 | + | |
| 188627 | + | |
| 188628 | + | |
| 188629 | + | |
| 188630 | + | |
| 188631 | + | |
| 188632 | + | |
| 188633 | + | |
| 188634 | + | |
188586 | 188635 | | |
188587 | 188636 | | |
188588 | 188637 | | |
| |||
193491 | 193540 | | |
193492 | 193541 | | |
193493 | 193542 | | |
193494 | | - | |
| 193543 | + | |
| 193544 | + | |
193495 | 193545 | | |
193496 | | - | |
193497 | | - | |
| 193546 | + | |
| 193547 | + | |
| 193548 | + | |
| 193549 | + | |
| 193550 | + | |
| 193551 | + | |
| 193552 | + | |
| 193553 | + | |
| 193554 | + | |
193498 | 193555 | | |
193499 | 193556 | | |
193500 | 193557 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| |||
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
106 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
107 | 119 | | |
108 | | - | |
109 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
110 | 129 | | |
111 | 130 | | |
112 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
0 commit comments