{"record":{"id":"36ee07d3ea52a2e8","repo":"spring-projects/spring-ai","slug":"elicitation-not-supported-by-the-client","errorCode":null,"errorMessage":"Elicitation not supported by the client: ","messagePattern":"Elicitation not supported by the client: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/context/DefaultMcpSyncRequestContext.java","lineNumber":97,"sourceCode":"\t\tif (!this.rootsEnabled()) {\n\t\t\tthrow new IllegalStateException(\"Roots not supported by the client: \" + this.exchange.getClientInfo());\n\t\t}\n\t\treturn this.exchange.listRoots();\n\t}\n\n\t// Elicitation\n\n\t@Override\n\tpublic boolean elicitEnabled() {\n\t\treturn !(this.exchange.getClientCapabilities() == null\n\t\t\t\t|| this.exchange.getClientCapabilities().elicitation() == null);\n\t}\n\n\t@Override\n\tpublic <T> StructuredElicitResult<T> elicit(Class<T> type) {\n\n\t\tif (!this.elicitEnabled()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\"Elicitation not supported by the client: \" + this.exchange.getClientInfo());\n\t\t}\n\n\t\tAssert.notNull(type, \"Elicitation response type must not be null\");\n\n\t\tElicitResult elicitResult = this.elicitationInternal(\"Please provide the required information.\", type, null);\n\n\t\tif (elicitResult.action() != ElicitResult.Action.ACCEPT) {\n\t\t\treturn new StructuredElicitResult<>(elicitResult.action(), null, elicitResult.meta());\n\t\t}\n\n\t\treturn new StructuredElicitResult<>(elicitResult.action(),\n\t\t\t\tjsonHelper.convertFromMap(elicitResult.content(), type), elicitResult.meta());\n\t}\n\n\t@Override\n\tpublic <T> StructuredElicitResult<T> elicit(ParameterizedTypeReference<T> type) {\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/context/DefaultMcpSyncRequestContext.java#L79-L115","documentation":"Thrown by DefaultMcpSyncRequestContext.elicit when the connected MCP client has not declared the elicitation capability (elicitEnabled() is false); the tool asks the client for structured input but the client cannot respond to elicitation requests.","triggerScenarios":"Thrown at mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/context/DefaultMcpSyncRequestContext.java:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check elicitEnabled() before calling elicit()","Connect with an MCP client that supports the elicitation capability","Redesign the tool to use optional arguments instead of runtime elicitation"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}