spring-projects/spring-ai · info
No complete methods found in the provided complete objects:
Error message
No complete methods found in the provided complete objects: <completeObjects>
What it means
SyncStatelessMcpCompleteProvider scans the supplied completeObjects for methods annotated with @McpComplete (sync/stateless signature, non-reactive return type, bidirectional parameters) and builds SyncCompletionSpecification entries. When the resulting list is empty it logs this warning; nothing is thrown, and the server simply registers zero completion providers. It exists to surface a likely wiring mistake: you handed the provider objects that contain no usable completion methods.
Source
Thrown at mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/provider/complete/SyncStatelessMcpCompleteProvider.java:93
var completeAnnotation = mcpCompleteMethod.getAnnotation(McpComplete.class);
var completeRef = CompleteAdapter.asCompleteReference(completeAnnotation, mcpCompleteMethod);
BiFunction<McpTransportContext, CompleteRequest, CompleteResult> methodCallback = SyncStatelessMcpCompleteMethodCallback
.builder()
.method(mcpCompleteMethod)
.bean(completeObject)
.complete(completeAnnotation)
.build();
return new SyncCompletionSpecification(completeRef, methodCallback);
})
.toList())
.flatMap(List::stream)
.toList();
if (completeSpecs.isEmpty()) {
if (logger.isWarnEnabled()) {
logger.warn("No complete methods found in the provided complete objects: " + this.completeObjects);
}
}
return completeSpecs;
}
/**
* Returns the methods of the given bean class.
* @param bean the bean instance
* @return the methods of the bean class
*/
protected Method[] doGetClassMethods(Object bean) {
return bean.getClass().getDeclaredMethods();
}
}
View on GitHub (pinned to 98a7beda4f)
Solutions
- Verify each object passed to the provider has at least one public method annotated with @McpComplete with a sync (non-reactive) return type and no bidirectional parameters
- Move @McpComplete methods into the class itself rather than a superclass or interface (only getDeclaredMethods is scanned)
- If you use reactive (Mono/Flux) completion methods, use the Async stateless complete provider instead of the sync one
- Check annotation scanning/import configuration so the beans actually reach the provider (e.g. @McpTool-compatible registration), and confirm the warn is not just an informational log from an optional feature
- If completions are intentionally unused, remove the completeObjects registration instead of registering empty holders
Example fix
// before
new SyncStatelessMcpCompleteProvider(List.of(new CompletionService())); // no @McpComplete methods inside
// after
class CompletionService {
@McpComplete(prompt = "code-completion")
public CompleteResult complete(CompleteRequest request) { ... }
}
new SyncStatelessMcpCompleteProvider(List.of(new CompletionService())); Defensive patterns
Strategy: validation
Validate before calling
long found = Arrays.stream(completeObject.getClass().getDeclaredMethods())
.filter(m -> m.isAnnotationPresent(McpComplete.class))
.count();
if (found == 0) throw new IllegalStateException(
completeObject.getClass().getName() + " has no @McpComplete methods"); Type guard
static boolean hasCompleteMethods(Object bean) {
return Arrays.stream(bean.getClass().getDeclaredMethods())
.anyMatch(m -> m.isAnnotationPresent(McpComplete.class));
} Prevention
- Always pair each provider registration with at least one matching annotated method in the supplied bean
- Keep MCP annotated methods on the concrete class, not superclasses or interfaces
- Match provider variant (sync/async, stateful/stateless) to your method signatures
- Run an integration test that starts the server and asserts feature counts before deploying
When it happens
Trigger: Calling getCompleteSpecifications() when none of the completeObjects have a method passing all filters: annotated with @McpComplete, non-reactive return type (McpPredicates.filterReactiveReturnTypeMethod), and no bidirectional parameters (filterMethodWithBidirectionalParameters). Also triggered by methods declared on a superclass/interface (only getDeclaredMethods is scanned) or reactive methods accidentally given to the sync provider.
Common situations: Registering a plain Spring bean that forgot @McpComplete annotations; annotating methods on a parent class; passing reactive completion methods to the synchronous stateless provider; using annotation auto-configuration where no completion beans exist at all; bean proxies hiding annotated methods when annotations lack @Inherited-compatible placement.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- No async complete methods found in the provided complete obj
- No complete methods found in the provided complete objects:
- No elicitation methods found
- Multiple elicitation methods found: <count>
- No elicitation methods found
AI-assisted analysis of spring-projects/spring-ai@98a7beda4f (2026-09-11).
Data as JSON: /api/errors/6bbc662d920c2f3a.
Report an issue: GitHub.