Fix MCP JSON Schema validation for tools/list endpoint
- Fix inputSchema properties to use quoted string keys for proper JSON Schema format - Remove debug logging added for Accept header troubleshooting - Remove unnecessary tools/list workaround in mcp#ToolsCall service - The properties field in inputSchema must be a record/object, not an array - All 6 tool schemas now properly defined with string keys: "path", "action", "renderMode", "parameters", "query", "name", "arguments"
Showing
2 changed files
with
3 additions
and
3 deletions
This diff is collapsed.
Click to expand it.
| ... | @@ -539,12 +539,12 @@ class EnhancedMcpServlet extends HttpServlet { | ... | @@ -539,12 +539,12 @@ class EnhancedMcpServlet extends HttpServlet { |
| 539 | 539 | ||
| 540 | String method = request.getMethod() | 540 | String method = request.getMethod() |
| 541 | String acceptHeader = request.getHeader("Accept") | 541 | String acceptHeader = request.getHeader("Accept") |
| 542 | 542 | ||
| 543 | logger.info("Enhanced MCP JSON-RPC Request: ${method} ${request.requestURI} - Accept: ${acceptHeader}") | 543 | logger.info("Enhanced MCP JSON-RPC Request: ${method} ${request.requestURI} - Accept: ${acceptHeader}") |
| 544 | 544 | ||
| 545 | // Validate Accept header per MCP 2025-11-25 spec requirement #2 | 545 | // Validate Accept header per MCP 2025-11-25 spec requirement #2 |
| 546 | // Client MUST include Accept header with at least one of: application/json or text/event-stream | 546 | // Client MUST include Accept header with at least one of: application/json or text/event-stream |
| 547 | if (!acceptHeader || !acceptHeader.contains("application/json") && !acceptHeader.contains("text/event-stream")) { | 547 | if (!acceptHeader || !(acceptHeader.contains("application/json") || acceptHeader.contains("text/event-stream"))) { |
| 548 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST) | 548 | response.setStatus(HttpServletResponse.SC_BAD_REQUEST) |
| 549 | response.setContentType("application/json") | 549 | response.setContentType("application/json") |
| 550 | response.writer.write(JsonOutput.toJson([ | 550 | response.writer.write(JsonOutput.toJson([ | ... | ... |
-
Please register or sign in to post a comment