{"record":{"id":"b239bc89c8b9de0c","repo":"spring-projects/spring-ai","slug":"no-complete-methods-found-in-the-provided-complete","errorCode":null,"errorMessage":"No complete methods found in the provided complete objects: <completeObjects>","messagePattern":"No complete methods found in the provided complete objects: <completeObjects>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/provider/complete/AsyncStatelessMcpCompleteProvider.java","lineNumber":94,"sourceCode":"\t\t\t\t\tvar completeAnnotation = mcpCompleteMethod.getAnnotation(McpComplete.class);\n\t\t\t\t\tvar completeRef = CompleteAdapter.asCompleteReference(completeAnnotation, mcpCompleteMethod);\n\n\t\t\t\t\tBiFunction<McpTransportContext, CompleteRequest, Mono<CompleteResult>> methodCallback = AsyncStatelessMcpCompleteMethodCallback\n\t\t\t\t\t\t.builder()\n\t\t\t\t\t\t.method(mcpCompleteMethod)\n\t\t\t\t\t\t.bean(completeObject)\n\t\t\t\t\t\t.complete(completeAnnotation)\n\t\t\t\t\t\t.build();\n\n\t\t\t\t\treturn new AsyncCompletionSpecification(completeRef, 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 (completeSpecs.isEmpty()) {\n\t\t\tif (logger.isWarnEnabled()) {\n\t\t\t\tlogger.warn(\"No complete methods found in the provided complete objects: \" + this.completeObjects);\n\t\t\t}\n\t\t}\n\n\t\treturn completeSpecs;\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}\n\n}\n","sourceCodeStart":76,"sourceCodeEnd":111,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/provider/complete/AsyncStatelessMcpCompleteProvider.java#L76-L111","documentation":"AsyncStatelessMcpCompleteProvider.getCompleteSpecifications() scans the supplied complete objects for completion-annotated methods suitable for a stateless async server. If the resulting completeSpecs list is empty, it warns that no complete methods were found. The server is built without completions, so client completion requests return nothing.","triggerScenarios":"Passing completion provider objects to a stateless async MCP server where no method matches the completion annotation/scan rules (missing @McpComplete, wrong signature, or non-matching reactive types).","commonSituations":"Migrating completion providers from a stateful to a stateless server where scan rules differ; forgetting the annotation; using methods with imperative signatures in a reactive scan.","solutions":["Add @McpComplete annotations with correct prompt references to at least one method per complete object","Confirm the methods satisfy the stateless async scan (reactive return types, expected argument shape)","Log or inspect completeObjects passed to the builder to confirm the intended instances are registered"],"exampleFix":"// before\npublic class MyCompletes { List<String> complete(String p) { return List.of(); } }\n// after\npublic class MyCompletes {\n  @McpComplete(prompt = \"my-prompt\")\n  public Mono<List<String>> complete(String p) { return Mono.just(List.of(\"suggestion\")); }\n}","handlingStrategy":"validation","validationCode":"boolean hasComplete = java.util.Arrays.stream(completeObject.getClass().getDeclaredMethods())\n  .anyMatch(m -> m.isAnnotationPresent(McpComplete.class));\nif (!hasComplete) {\n  throw new IllegalStateException(\"No @McpComplete methods on \" + completeObject + \" for stateless server\");\n}","typeGuard":"static boolean hasAnnotatedCompleteMethods(Object o) {\n  return java.util.Arrays.stream(o.getClass().getDeclaredMethods())\n    .anyMatch(m -> m.isAnnotationPresent(McpComplete.class));\n}","tryCatchPattern":null,"preventionTips":["Ensure at least one @McpComplete-annotated method per registered complete object","Match signatures to the stateless async scan (reactive return types)","Watch startup logs for the 'No complete methods found' warning"],"tags":["spring-ai","mcp","completion","stateless-server","annotation-scan"],"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-14T11:17:12.474Z"}