Title: Tool input validation returns with misleading error referencing `outputSchema` · Issue #986 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: Tool input validation returns with misleading error referencing `outputSchema` · Issue #986 · modelcontextprotocol/java-sdk
X Title: Tool input validation returns with misleading error referencing `outputSchema` · Issue #986 · modelcontextprotocol/java-sdk
Description: Bug description The tool input validation introduced in #873 returns with a misleading error message referencing outputSchema when validation fails. For example, the first test case in ToolInputValidationIntegrationTests#invalidInput_wit...
Open Graph Description: Bug description The tool input validation introduced in #873 returns with a misleading error message referencing outputSchema when validation fails. For example, the first test case in ToolInputVal...
X Description: Bug description The tool input validation introduced in #873 returns with a misleading error message referencing outputSchema when validation fails. For example, the first test case in ToolInputVal...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/986
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tool input validation returns with misleading error referencing `outputSchema`","articleBody":"**Bug description**\n\nThe tool input validation introduced in https://github.com/modelcontextprotocol/java-sdk/pull/873 returns with a misleading error message referencing `outputSchema` when validation fails. For example, the first test case in \n[ToolInputValidationIntegrationTests#invalidInput_withDefaultValidation_shouldReturnToolError](https://github.com/modelcontextprotocol/java-sdk/blob/c8ab3411b9191ffbbb30f0baaa56b3a26e076dbe/mcp-test/src/test/java/io/modelcontextprotocol/server/ToolInputValidationIntegrationTests.java#L174) leads to the following error message, but only tests for the presence of `age` in the error message substring:\n\n```\nValidation failed: structuredContent does not match tool outputSchema. Validation errors: [: required property 'age' not found]\n```\n\nInstead of referring to `structuredContent` and `outputSchema`, the error message should clearly indicate that the error is referring to the input data as otherwise it's misleading to consumers/LLMs.\n\n**Environment**\n\nMCP SDK 2.0.0-M3 (via Spring AI 2.0.0-M7)\n\n**Steps to reproduce**\n\n- Run `ToolInputValidationIntegrationTests#invalidInput_withDefaultValidation_shouldReturnToolError` \u0026 inspect the produced error message.\n- or create an MCP server with tool input validation enabled and call a tool with invalid input data\n\n**Expected behavior**\n\n- A concise error response stating that the listed schema validation errors refer to input parameters.\n- Better assertions in the tool input validation test, not only checking for presence of a substring.\n\n\n**Minimal Complete Reproducible example**\n\nSee steps to reproduce.\n","author":{"url":"https://github.com/maff","@type":"Person","name":"maff"},"datePublished":"2026-05-28T06:18:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/986/java-sdk/issues/986"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:51b3bcd8-6bf6-4110-42fb-9a986838de3f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 855C:56614:1157269:17888FC:6A5D110B |
| html-safe-nonce | 8342a69afa48d37f5c52da87d9a89a1e9bb66fb7042cca889e3b9d6078f6e9a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTVDOjU2NjE0OjExNTcyNjk6MTc4ODhGQzo2QTVEMTEwQiIsInZpc2l0b3JfaWQiOiIzMjY5MjAxMTI2MDY0MTk3ODk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 827ba2ac77776f0d2870000adbddab9e383e8a6686b01220f7e7937733b5234c |
| hovercard-subject-tag | issue:4538176705 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/java-sdk/986/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7bda36d4424f6a5a369d5ff6cd3ef703bb8022545357789a160d03b72fd9d925/modelcontextprotocol/java-sdk/issues/986 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7bda36d4424f6a5a369d5ff6cd3ef703bb8022545357789a160d03b72fd9d925/modelcontextprotocol/java-sdk/issues/986 |
| og:image:alt | Bug description The tool input validation introduced in #873 returns with a misleading error message referencing outputSchema when validation fails. For example, the first test case in ToolInputVal... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maff |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width