{"record":{"id":"8219b4438b94904d","repo":"spring-projects/spring-ai","slug":"no-elicitation-methods-found-8219b4","errorCode":null,"errorMessage":"No elicitation methods found","messagePattern":"No elicitation methods found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/provider/elicitation/SyncMcpElicitationProvider.java","lineNumber":113,"sourceCode":"\t\t\t\t\t\t&& ElicitRequest.class.isAssignableFrom(method.getParameterTypes()[0]))\n\t\t\t\t.sorted((m1, m2) -> m1.getName().compareTo(m2.getName()))\n\t\t\t\t.map(mcpElicitationMethod -> {\n\t\t\t\t\tvar elicitationAnnotation = mcpElicitationMethod.getAnnotation(McpElicitation.class);\n\n\t\t\t\t\tFunction<ElicitRequest, ElicitResult> methodCallback = SyncMcpElicitationMethodCallback.builder()\n\t\t\t\t\t\t.method(mcpElicitationMethod)\n\t\t\t\t\t\t.bean(elicitationObject)\n\t\t\t\t\t\t.elicitation(elicitationAnnotation)\n\t\t\t\t\t\t.build();\n\n\t\t\t\t\treturn new SyncElicitationSpecification(elicitationAnnotation.clients(), methodCallback);\n\t\t\t\t})\n\t\t\t\t.toList())\n\t\t\t.flatMap(List::stream)\n\t\t\t.toList();\n\n\t\tif (elicitationHandlers.isEmpty()) {\n\t\t\tlogger.warn(\"No elicitation methods found\");\n\t\t}\n\t\tif (elicitationHandlers.size() > 1) {\n\t\t\tif (logger.isWarnEnabled()) {\n\t\t\t\tlogger.warn(\"Multiple elicitation methods found: \" + elicitationHandlers.size());\n\t\t\t}\n\t\t}\n\n\t\treturn elicitationHandlers;\n\t}\n\n\t/**\n\t * Returns the methods of the given bean class.\n\t * @param bean the bean instance\n\t * @return the methods of the bean class\n\t */\n\tprotected Method[] doGetClassMethods(Object bean) {\n\t\treturn bean.getClass().getDeclaredMethods();\n\t}","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/provider/elicitation/SyncMcpElicitationProvider.java#L95-L131","documentation":"SyncMcpElicitationProvider scans provider objects for @McpElicitation methods with synchronous signatures and builds handler specifications. An empty result logs this warning; no exception is thrown and the server runs without an elicitation handler. The library emits it because passing objects to an elicitation provider while yielding zero handlers usually indicates a wiring or annotation mistake.","triggerScenarios":"getElicitationSpecifications() finds no method annotated @McpElicitation (or none matching the sync predicate filters) in the supplied objects, or the objects list is empty.","commonSituations":"Missing @McpElicitation annotation; async (Mono/Flux) handler given to the sync provider; handler declared in a superclass; elicitation bean not actually injected into the provider constructor.","solutions":["Add @McpElicitation to a method in the supplied bean with a synchronous signature matching what the sync provider's predicates accept","Move the annotated method into the class itself if it currently lives in a superclass or interface","Switch to AsyncMcpElicitationProvider if the handler returns Mono/Flux","Remove the provider registration if elicitation is intentionally unused"],"exampleFix":"// before\nclass Handlers { } // empty bean registered as elicitation source\n\n// after\nclass Handlers {\n    @McpElicitation\n    public ElicitResult handle(ElicitRequest request) { ... }\n}\nnew SyncMcpElicitationProvider(List.of(new Handlers()));","handlingStrategy":"validation","validationCode":"if (Arrays.stream(bean.getClass().getDeclaredMethods())\n        .noneMatch(m -> m.isAnnotationPresent(McpElicitation.class))) {\n    throw new IllegalStateException(\"No @McpElicitation handler in \" + bean.getClass());\n}","typeGuard":"static boolean hasSyncElicitationHandler(Object bean) {\n    return Arrays.stream(bean.getClass().getDeclaredMethods())\n        .anyMatch(m -> m.isAnnotationPresent(McpElicitation.class));\n}","tryCatchPattern":null,"preventionTips":["Annotate a sync handler before registering the sync elicitation provider","Do not mix reactive handlers with the sync provider","Only register elicitation objects when elicitation is actually used"],"tags":["mcp","spring-ai","annotation-scanning","elicitation"],"backgroundTag":"empty-result-set","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}